I hope you can help me. I can not stand having to keep restarting my ec2 instance on Amazon.
I have two wordpress sites hosted there. My sites have always worked well until two months ago, one of them started having this problem. I tried all ways pack up, and the only solution was to reconfigure.
Now that all was right with the two. The second site started the same problem. I think Amazon is clowning me.
I am using a free micro instance. If anyone knows what the problem is, please help me!
Your issue will be the limited memory that is allocated to the T1 Micro instances in EC2. I’m assuming you are using ANI Linux in this case and if an alternate version of Linux is used then you may have different locations for your log and config files.
Make sure you are the root user.
Have a look at your MySQL logs in the following location:
If you see repeated instances of the following it’s pretty certain that the 0.6GB of memory allocated to the micro instance is not cutting it.
You will notice in the log excerpt above that my buffer pool size is set to 12MB. This can be configured by adding the line
innodb_buffer_pool_size = 12M
to your MySQL config file/etc/my.cnf
.A pretty good way to deal with InnoDB chewing up your memory is to create a swap file.
Start by checking the status of your memory:
You will most probably see that your swap is not doing much:
To start ensure you are logged in as the root user and run the following command:
Wait for a bit as the command is not verbose but you should see the following response after about 15 seconds when the process is complete:
Next set up the swapspace with:
Now set up the swap event:
If you get a permissions response you can ignore it or address the swap file by changing the permissions to
600
with thechmod
command.Now add the following line to
/etc/fstab
to create the swap spaces on server start:Restart your MySQL instance:
Finally check to see if your swap file is working correctly with the
free -m
command.You should see something like:
Hope this helps.