How to fix mysql service stopping intermittently on AWS micro instance

I was having this problem since last few days. My mysql server was getting killed on its own on aws/ec2 micro instance. So far I was restarting the whole instance to fix this problem.

When I looked at the log (/var/log/mysqld.log) on my centos linux instance, here is what I saw:

130304 23:55:47 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
130304 23:55:47 InnoDB: Completed initialization of buffer pool
130304 23:55:47 InnoDB: Fatal error: cannot allocate memory for the buffer pool
130304 23:55:47 [ERROR] Plugin 'InnoDB' init function returned error.
130304 23:55:47 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

After reducing innodb_buffer_pool_size (default 256M) to 10M in /etc/my.cnf the problem seems to have gone away. Here is the value I changed in /etc/my.cnf (On Ubuntu the location is /etc/mysql/my.cnf)

[mysqld]
innodb_buffer_pool_size = 10M

This worked on both CentOS and Ubuntu Linux. I took a very low value for now as I don’t have too much data and traffic. I’ll watch and see if this needs to be increased in next few days.

Share this article: share on Google+ share on facebook share on linkedin tweet this submit to reddit

Comments

Click here to write/view comments