|
I have several Wordpress sites on a 2 GB node, running Ubuntu Linux, Apache2, MySql. Periodically, MySql will crash and die, and does not autorecover, requiring me to either reboot then node, or, if I'm at a place I can open the shell, do a mysql restart. When this problem happens, I look at Longview information, and see a sudden spike in Disc I/O at the exact time mysql crashed. It's a very short spike, but very sharp (I guess that's the definition of a spike...). Everything else looks normal. CPU, Memory, Network, etc., are all low and normal. Looking at the Apache website logs shows nothing unusually (sure, the usually nonsense from bots etc., but not abnormally so). I would attach an image of Longview chart, but I don't see an option to upload an image. Anyway, my disk I/o is typically really low, like 1 op/s or less on read, sometimes up to 2 or 3, and 0 swap. The spike shoots up to 40 Read and 100+ Swap. And then MySql dies.
The only errors I have found are in the sql error log file, and shows this:
150815 9:49:37 [Warning] Using unique option prefix myisam-recover instead of $ 150815 9:49:37 [Note] Plugin 'FEDERATED' is disabled. 150815 9:49:37 InnoDB: The InnoDB memory heap is disabled 150815 9:49:37 InnoDB: Mutexes and rw_locks use GCC atomic builtins 150815 9:49:37 InnoDB: Compressed tables use zlib 1.2.3.4 150815 9:49:37 InnoDB: Initializing buffer pool, size = 128.0M InnoDB: mmap(137363456 bytes) failed; errno 12 150815 9:49:37 InnoDB: Completed initialization of buffer pool 150815 9:49:37 InnoDB: Fatal error: cannot allocate memory for the buffer pool 150815 9:49:37 [ERROR] Plugin 'InnoDB' init function returned error. 150815 9:49:37 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 150815 9:49:37 [ERROR] Unknown/unsupported storage engine: InnoDB 150815 9:49:37 [ERROR] Aborting 150815 9:49:37 [Note] /usr/sbin/mysqld: Shutdown complete
The Initializing buffer pool, size = 128.0M and followed by InnoDB: Fatal error: cannot allocate memory for the buffer pool is clearly the problem and there is also an error about mmap(137363456 bytes) failed; errno 12 (but I have no idea what that means). However, at that exact time, memory was available. Only 443 MB of 2 GB were in use, and 100 MB of Swap, out of 256. Yet, mySql failed to start due to out of memory even though plenty of memory was available. And the spike was on Disk I/o. There was no spike in memory (or Network or CPU) at or near that time.
Any ideas or pointers would be appreciated. This is very frustrating.
|