On a server i have multiple rails apache + postgres apps and a mysql + php. The only PHP app is a wordpress. Except for wordpress everything runs fine.
Every 40-50 days, mysql stop to work. Here is the messages that are logged before a crash :
160408 19:20:31 [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. 160408 19:20:31 [Note] Plugin 'FEDERATED' is disabled. 160408 19:20:31 InnoDB: The InnoDB memory heap is disabled 160408 19:20:31 InnoDB: Mutexes and rw_locks use GCC atomic builtins 160408 19:20:31 InnoDB: Compressed tables use zlib 220.127.116.11 160408 19:20:31 InnoDB: Initializing buffer pool, size = 128.0M InnoDB: mmap(137363456 bytes) failed; errno 12 160408 19:20:31 InnoDB: Completed initialization of buffer pool 160408 19:20:31 InnoDB: Fatal error: cannot allocate memory for the buffer pool 160408 19:20:31 [ERROR] Plugin 'InnoDB' init function returned error. 160408 19:20:31 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 160408 19:20:31 [ERROR] Unknown/unsupported storage engine: InnoDB 160408 19:20:31 [ERROR] Aborting 160408 19:20:31 [Note] /usr/sbin/mysqld: Shutdown complete
The error logs are empty except on the day of the crash, and this message is repeated 4 times starting at 19:20:25.
To restore wordpress, I just restart mysql and it works. I already increased the ram of the server in the past, it only increased the time before a crash. The number of visits on this wordpress are around 1000 a month.
How can i prevent mysql from crashing? Maybe it would be easier just to restart mysql every week?
EDIT : the VM has 1200 mo of ram, I may have some config problem related to memory, what should i do?