MySQL crash randomly every few days.

November 2, 2013 2.4k views
Previously it has similar problem, but after I enabled the SWAP file, it actually solve the problem. But recently the similar error came out again and the Mysql crash randomly every few days. Error message as below: 131102 5:59:34 [Note] Plugin 'FEDERATED' is disabled. 131102 5:59:34 InnoDB: The InnoDB memory heap is disabled 131102 5:59:34 InnoDB: Mutexes and rw_locks use GCC atomic builtins 131102 5:59:34 InnoDB: Compressed tables use zlib 1.2.7 131102 5:59:34 InnoDB: Using Linux native AIO 131102 5:59:34 InnoDB: Initializing buffer pool, size = 1.0G InnoDB: mmap(1098907648 bytes) failed; errno 12 131102 5:59:34 InnoDB: Completed initialization of buffer pool 131102 5:59:34 InnoDB: Fatal error: cannot allocate memory for the buffer pool 131102 5:59:34 [ERROR] Plugin 'InnoDB' init function returned error. 131102 5:59:34 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 131102 5:59:34 [ERROR] Unknown/unsupported storage engine: InnoDB 131102 5:59:34 [ERROR] Aborting 131102 5:59:34 [Note] /usr/sbin/mysqld: Shutdown complete My Droplet is 1GB ram with 2GB swap on. Should I enlarge the swap file? Any help will be greatly appreciate. Thanks.
3 Answers
yes you should increase it to 4GB and I would not expect you to have any other issues. The only other time I used to get that error is if I ran out of disk space from log files.
I would be careful with swap. it can slow things down sometimes
I don't recommend creating a large swap file -- 512MB should suffice.

In this case I recommend upgrading your droplet as it simply doesn't have enough RAM to host all of the programs running on it.
Have another answer? Share your knowledge.