Join 1M+ other developers and:
- Get help and share knowledge in Q&A
- Subscribe to topics of interest
- Get courses & tools that help you grow as a developer or small business owner
New $5 MySQL/Wordpress Crashing — InnoDB memory issue
We’ve set up a few independent websites using a minimum $5 droplet, using WordPress and MySQL.
In the minimum config, doing stuff in the admin panel, MySQL crashes regularly. This means we get an “Error — Failed to create a database connection”. When I go into the droplet via
ssh I have to restart the service, using
It’s the latest version of the droplet (set up in mid and late 2019), using Ubuntu 18.04, and WordPress 5.0+.
service mysql start
The mysql error log shows
2020-01-14T20:00:24.293860Z 0 [ERROR] InnoDB: mmap(137428992 bytes) failed; errno 12 2020-01-14T20:00:24.293878Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool 2020-01-14T20:00:24.293885Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error 2020-01-14T20:00:24.293895Z 0 [ERROR] Plugin 'InnoDB' init function returned error. 2020-01-14T20:00:24.307238Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 2020-01-14T20:00:24.307284Z 0 [ERROR] Failed to initialize builtin plugins. 2020-01-14T20:00:24.307291Z 0 [ERROR] Aborting 2020-01-14T20:00:24.308788Z 0 [Note] Binlog end 2020-01-14T20:00:24.315381Z 0 [Note] Shutting down plugin 'CSV' 2020-01-14T20:00:24.319326Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
Based on this, it seems some problem with InnoDB and memory.
This is a blog with almost zero traffic, and only two logged-in users, doing very basic things like uploading images. It seems to happen because we’re trying to do something, but sometimes the server fails on its own.
The InnoDB buffer size is set at default currently - 128MB.
In the past, I’ve only been able to fix this by upgrading to a $10 droplet, but is that necessary? I think there may be a configuration issue.
Thanks in advance.
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.×