Question

MariaDB Shuts Down Frequently

Hello,

I’m using wordpress and my mariadb shuts down very frequently. dont understand why.

here’s my error logs:

170729 22:21:33 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended 170729 22:21:40 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 170729 22:21:40 [Note] /usr/libexec/mysqld (mysqld 5.5.52-MariaDB) starting as process 3724 … 170729 22:21:40 InnoDB: The InnoDB memory heap is disabled 170729 22:21:40 InnoDB: Mutexes and rw_locks use GCC atomic builtins 170729 22:21:40 InnoDB: Compressed tables use zlib 1.2.7 170729 22:21:40 InnoDB: Using Linux native AIO 170729 22:21:40 InnoDB: Initializing buffer pool, size = 512.0M InnoDB: mmap(551026688 bytes) failed; errno 12 170729 22:21:40 InnoDB: Completed initialization of buffer pool 170729 22:21:40 InnoDB: Fatal error: cannot allocate memory for the buffer pool 170729 22:21:40 [ERROR] Plugin ‘InnoDB’ init function returned error. 170729 22:21:40 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed. 170729 22:21:40 [ERROR] mysqld: Out of memory (Needed 128917504 bytes) 170729 22:21:40 [ERROR] mysqld: Out of memory (Needed 96681984 bytes) 170729 22:21:40 [Note] Plugin ‘FEEDBACK’ is disabled. 170729 22:21:40 [ERROR] Unknown/unsupported storage engine: InnoDB 170729 22:21:40 [ERROR] Aborting

170729 22:21:40 [Note] /usr/libexec/mysqld: Shutdown complete

170729 22:21:40 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended 170729 22:22:45 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 170729 22:22:46 [Note] /usr/libexec/mysqld (mysqld 5.5.52-MariaDB) starting as process 4043 … 170729 22:22:46 InnoDB: The InnoDB memory heap is disabled 170729 22:22:46 InnoDB: Mutexes and rw_locks use GCC atomic builtins 170729 22:22:46 InnoDB: Compressed tables use zlib 1.2.7 170729 22:22:46 InnoDB: Using Linux native AIO 170729 22:22:46 InnoDB: Initializing buffer pool, size = 512.0M InnoDB: mmap(551026688 bytes) failed; errno 12 170729 22:22:46 InnoDB: Completed initialization of buffer pool 170729 22:22:46 InnoDB: Fatal error: cannot allocate memory for the buffer pool 170729 22:22:46 [ERROR] Plugin ‘InnoDB’ init function returned error. 170729 22:22:46 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed. 170729 22:22:46 [Note] Plugin ‘FEEDBACK’ is disabled. 170729 22:22:46 [ERROR] Unknown/unsupported storage engine: InnoDB 170729 22:22:46 [ERROR] Aborting

170729 22:22:46 [Note] /usr/libexec/mysqld: Shutdown complete

170729 22:22:46 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended 170729 22:23:28 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 170729 22:23:28 [Note] /usr/libexec/mysqld (mysqld 5.5.52-MariaDB) starting as process 4378 … 170729 22:23:29 InnoDB: The InnoDB memory heap is disabled 170729 22:23:29 InnoDB: Mutexes and rw_locks use GCC atomic builtins 170729 22:23:29 InnoDB: Compressed tables use zlib 1.2.7 170729 22:23:29 InnoDB: Using Linux native AIO 170729 22:23:29 InnoDB: Initializing buffer pool, size = 512.0M InnoDB: mmap(551026688 bytes) failed; errno 12 170729 22:23:29 InnoDB: Completed initialization of buffer pool 170729 22:23:29 InnoDB: Fatal error: cannot allocate memory for the buffer pool 170729 22:23:29 [ERROR] Plugin ‘InnoDB’ init function returned error. 170729 22:23:29 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed. 170729 22:23:29 [Note] Plugin ‘FEEDBACK’ is disabled. 170729 22:23:29 [ERROR] Unknown/unsupported storage engine: InnoDB 170729 22:23:29 [ERROR] Aborting

170729 22:23:29 [Note] /usr/libexec/mysqld: Shutdown complete

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

What is your exact setup/configuration? What’s your Web server and do you have something in front of it (e.g. Varnish)?

By latest logs, it’s again Out of Memory.

2GB Droplet should run WordPress without a single problem. I’ve had 512MB Droplet running WordPress for long time, without any problem.

So what you can do. If you use Varnish or any other caching, in-memory caching, disable it until you get the site working. If that doesn’t help, try just running bare bones MySQL to make sure it works - in other words, stop Web server until you get MySQL up. If you got it up, start Web server once again and monitor situation. If not, make sure it’s exactly memory problem and not something bigger by checking MySQL logs one more time and Syslog as well. It’s file /var/log/syslog that you can open with any editor (requires root/ sudo). Observe for Out of memory and mysql entries. If it confirms OOM you can:

  • Try with lowering buffer size more (e.g. 128M)
  • Upgrading Droplet or free and less recommend install Swap. Try going with Swap as its not hard to setup and doesn’t cost you anything.

Test once again and repost the logs.

Hi @cagkana9f5cd873f5b8188e469

The root problem is not MariaDB, but one of your other services taking up large amounts of RAM, leaving very little for MariaDB, which means it’s being crashed, since it’s the largest single process.

Have a look at htop to get an overview of what is taking all the memory.

sudo yum install htop

Also, I can see it’s an older version of MariaDB. Please remember to update your system.

sudo yum update

As it says, it cannot allocate the memory for the buffer pool (in layman’s terms, you’re outta RAM). You can either lower your buffer pool size for something more suitable to the amount of RAM your droplet has, or you can increase the RAM of your droplet.