By deanoboy
I created a new droplet from a one-click app of phpmyadmin on ubuntu 14.4 then uploaded a wordpress site (did some basic stuff like enable mod rewrite and firewall etc…). Left the server/site alone for a couple of hours and next time I look I see the database is down and I had to restart
This is the mysql error log:
170117 17:39:35 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
170117 17:39:35 [Note] Plugin 'FEDERATED' is disabled.
170117 17:39:35 InnoDB: The InnoDB memory heap is disabled
170117 17:39:35 InnoDB: Mutexes and rw_locks use GCC atomic builtins
170117 17:39:35 InnoDB: Compressed tables use zlib 1.2.8
170117 17:39:35 InnoDB: Using Linux native AIO
170117 17:39:35 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
170117 17:39:35 InnoDB: Completed initialization of buffer pool
170117 17:39:35 InnoDB: Fatal error: cannot allocate memory for the buffer pool
170117 17:39:35 [ERROR] Plugin 'InnoDB' init function returned error.
170117 17:39:35 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
170117 17:39:35 [ERROR] Unknown/unsupported storage engine: InnoDB
170117 17:39:35 [ERROR] Aborting
170117 17:39:35 [Note] /usr/sbin/mysqld: Shutdown complete
170117 17:39:36 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
170117 17:39:36 [Note] Plugin 'FEDERATED' is disabled.
170117 17:39:36 InnoDB: The InnoDB memory heap is disabled
170117 17:39:36 InnoDB: Mutexes and rw_locks use GCC atomic builtins
170117 17:39:36 InnoDB: Compressed tables use zlib 1.2.8
170117 17:39:36 InnoDB: Using Linux native AIO
170117 17:39:36 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
170117 17:39:36 InnoDB: Completed initialization of buffer pool
170117 17:39:36 InnoDB: Fatal error: cannot allocate memory for the buffer pool
170117 17:39:36 [ERROR] Plugin 'InnoDB' init function returned error.
170117 17:39:36 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
170117 17:39:36 [ERROR] Unknown/unsupported storage engine: InnoDB
170117 17:39:36 [ERROR] Aborting
170117 17:39:36 [Note] /usr/sbin/mysqld: Shutdown complete
Any ideas what went wrong and how to stop it happening again?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Go with the lines that say ERROR.
170117 17:39:35 InnoDB: Fatal error: cannot allocate memory for the buffer pool
Your droplet needs more memory or you need to make MySQL use less of it.
This comment has been deleted
It does appear that you’re running out of memory from the details provided. In order to prevent these issues, you should upgrade your droplet. MySQL and forks, such as MariaDB, can be ran on 512MB droplets, but it’s a balancing act and you’d need to be comfortable working from the CLI in order to work on optimizing your configurations.
You can reduce the amount of RAM required by MySQL (or MariaDB) in order to work with less RAM, but what works for a little while may not work long-term. It’s also a trade off. Working with less RAM often means that MySQL won’t perform as well as it should and would with more RAM free.
Looking beyond MySQL, WordPress can sometimes be resource intensive, so it’s important to enable some sort of caching, especially on resource-constrained servers. W3TC and WP Super Cache are two that instantly come to mind when it comes to caching. They will allow you to use PHP’s built-in object caching (if OPCode Caching is enabled), though that too takes RAM (as would Memcached or Redis).
The benefit to enabling caching, however, is that you an reduce the resources required by your web server as a result since instead of constantly performing dynamic operations normally required by WordPress, the caching serves statically generated pages until the cache is updated.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.