Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have been running a very small wordpress site on Amazon EC2 for about 2 months, using the free tier micro instance.

I have been getting billed a few dollars each month for going over the disk I/O allowance.

I have looked into how I can reduce the disk I/O, and made some changes such add allowing browser caching of images by changing apache.conf, minimising images and plugins, etc.

I then added APC module to PHP. I expected this to reduce I/O a lot, but it seems to be making no difference.

APC status (apc.php):

vmstat output during the load of a single webpage:

It seems that there is I/O going on during the load of the webpage. I don't understand why, since the PHP should be in the APC cache and the images are already cached in my browser.

My goal is to simply reduce I/O, and therefore cost. Is there anything I can do to achieve this? For example, is APC setup incorrectly or is there some other technique to avoid I/O?

(PS: W3TC wordpress plugin didnt work for me. I probably didn't install it correctly - it locked me out of the site, overloaded the CPU and brought the site down.)

share|improve this question
up vote 4 down vote accepted

We can see that your instance is running very low on memory, and is actually swapping. This is disk I/O for which you'll get billed, and also causes your site to run slower.

Free up some memory by stopping unnecessary processes and tuning your web server to run fewer workers (e.g. Apache or php-fpm).

share|improve this answer
Thank you. I know how to reduce the number of workers, but how would I go about finding unnecessary processes? – z c May 13 '13 at 18:10
Look through the process list, know what everything is and whether you need it running. Those almost certainly will give rise to separate questions. – Michael Hampton May 13 '13 at 18:11
I have reduced the apache workers from 20 to 10, and lowered the amount of memory used by some variables in my.cnf. After an apache graceful restart, available memory became 300MB (of total 512MB), however it soon went down to 160MB after an hour. I guess I will keep watching it and hope it doesn't hit zero. – z c May 13 '13 at 19:54

A few things...

  1. Try something like batcache for Wordpress, as it only caches the pages that are hit frequently and thus reduces some overhead from pre-caching everything

  2. I'd recommend switching to NGINX for your HTTP server if you have very little memory available. It's super efficient.

  3. Check the resource utilization of MySQL. In 99% of cases, it is configured too generously and eats all available server memory.

share|improve this answer
Thank you. How would I check the resource utilization of MySQL? – z c May 13 '13 at 18:09
This is a good place to start:, also install something like htop on your server to see what's actively eating up your memory. – yaycmyk May 14 '13 at 15:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.