Issue MySQL Stopped

I have a issue with my server. My databases MySQL stops working and I have no idea why. when you consume too many resources, someone can help me.

When the issue happend i reboot service and databases work 30 or 45 min and stopped again.

I have LAMP server installed in my cloud i use default config for Apache, MySQL and PHP.

My Sever Have 1GB Ram, 1 CPU and 20 GB, I installed Wordpress.

Can someone help me with this problem?

6 Replies

Some more information, including error messages, would be helpful.

If it is working after a reboot, there is a chance you have run out of disk space. The following command may provide some insight.

df -h

It doesn't sound like a case of running out of inodes, but couldn't hurt to check.

df -i

@sjacobs:

Some more information, including error messages, would be helpful.

If it is working after a reboot, there is a chance you have run out of disk space. The following command may provide some insight.

df -h

It doesn't sound like a case of running out of inodes, but couldn't hurt to check.

df -i

****Hello sjacobs thanks for your support

This info of Disk**** ````
$ df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/root 1248000 50400 1197600 5% /
devtmpfs 126148 1376 124772 2% /dev
tmpfs 126632 1 126631 1% /dev/shm
tmpfs 126632 1167 125465 1% /run
tmpfs 126632 16 126616 1% /sys/fs/cgroup
tmpfs 126632 1 126631 1% /run/user/1000

****Memory****

]$ free -m
total used free shared buff/cache available
Mem: 989 731 25 42 232 177
Swap: 511 80 431

****ERROR****

$ sudo systemctl status mariadb.service

mariadb.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Active: inactive (dead) since Fri 2017-12-08 06:59:44 UTC; 13h ago
Process: 3550 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=0/SUCCESS)
Process: 3549 ExecStart=/usr/bin/mysqld_safe --basedir=/usr (code=exited, status=0/SUCCESS)
Process: 3509 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS)
Main PID: 3549 (code=exited, status=0/SUCCESS)

****LOG****

$ sudo cat /var/log/mariadb/mariadb.log

171208 06:59:38 mysqldsafe Number of processes running now: 0 171208 06:59:39 mysqldsafe mysqld restarted
171208 6:59:40 [Note] /usr/libexec/mysqld (mysqld 5.5.56-MariaDB) starting as process 18349 …
171208 6:59:40 InnoDB: The InnoDB memory heap is disabled
171208 6:59:40 InnoDB: Mutexes and rw_locks use GCC atomic builtins
171208 6:59:40 InnoDB: Compressed tables use zlib 1.2.7
171208 6:59:40 InnoDB: Using Linux native AIO
171208 6:59:40 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137756672 bytes) failed; errno 12
171208 6:59:40 InnoDB: Completed initialization of buffer pool
171208 6:59:40 InnoDB: Fatal error: cannot allocate memory for the buffer pool
171208 6:59:40 [ERROR] Plugin 'InnoDB' init function returned error.
171208 6:59:40 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
171208 6:59:43 [ERROR] mysqld: Out of memory (Needed 128917504 bytes)
171208 6:59:43 [ERROR] mysqld: Out of memory (Needed 96681984 bytes)
171208 6:59:43 [ERROR] mysqld: Out of memory (Needed 72499200 bytes)
171208 6:59:43 [Note] Plugin 'FEEDBACK' is disabled.
171208 6:59:44 [ERROR] Unknown/unsupported storage engine: InnoDB
171208 6:59:44 [ERROR] Aborting

171208 6:59:44 [Note] /usr/libexec/mysqld: Shutdown complete

171208 06:59:44 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended

````

MySQL tries to consume memory beyond what is available on this machine, and crashes. This is clear from the database log.

Either drastically reduce memory settings (and suffer the performance consequences) or add more memory to the Linode, either by upgrading it or by adding more swap by reducing the root filesystem in size.

Have you adjusted the default values for both Apache and MySQL? Based on your Linode size, it appears that you are planning on light usage.

For MySQL, I would recommend that you run mysqltuner. Look at the "Maximum possible memory usage" line. If I recall correctly, the default connection count is 150. I have mine set to 32 but have never used more than 7. My max size is 242M.

I don't use Apache but there have been multiple discussions here about tuning Apache. Search for "prefork".

DS

Thanks so much dasand, emestee i make test with apachebuddy and mysqltuner and then i say the result!

Take a look at the examples listed in this template. There is a base default setting when the server memory is only 1GB.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct