David David - 10 days ago 5
MySQL Question

EC2 MySQL crashing continously

I have an EC2 instance set on the x64 amazon linux ami.

I am using PHP & Wordpress with W3 total cache & php-apc backed by MySQL to test a blog which can handle a decent number of connections relatively cheaply.

However, my mysql keeps crashing out.

Taken from the /var/log/mysqld.log

120912 8:44:24 InnoDB: Completed initialization of buffer pool
120912 8:44:24 InnoDB: Fatal error: cannot allocate memory for the buffer pool
120912 8:44:24 [ERROR] Plugin 'InnoDB' init function returned error.
120912 8:44:24 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
120912 8:44:24 [ERROR] Unknown/unsupported storage engine: InnoDB


Anyone know the reason this could be happening?

Current memory usage (below)

[root@ip-obscure mysql]# free -m
total used free shared buffers cached
Mem: 594 363 230 0 3 67
-/+ buffers/cache: 293 301
Swap: 0 0 0

Answer

I imagine your instance is lacking memory needed to do what you are wanting to do.

Have you considered using RDS for MySQL? That is really the preferred methodology in the AWS world (at least for DB's taht don't require a high degree of custom configuration) and will give you much better performance than running MySQL on EBS storage (which I assume you are doing as otherwise you have no way of persisting your DB content).

Comments