I have a VPS with 30 WordPress sites. I am running nginx & APC and notice it eats up my RAM up to 1GB, and it increases each time I add another site. I notice APC is the one that's causing the increasing of RAM usage. Is there a way to optimize this?

  • Whenever a site is added to a server, it does use some memory, increasing the total memory usage. No matter how much we optimize, there is no way to change this default behavior. There are tons of ways to optimize a server, including optimizing APC. It really depends on your particular server configuration (btw, you haven't provided much information about the current APC settings). Instead of concentrating on APC, you may try other ways to optimize a server, such as the use of a caching layer. Sep 2, 2013 at 13:16

2 Answers 2


It's hard to answer this given that each site is most likely different and each server is also configured differently.

If these sites are individual WordPress installs then 1GB /30 sites is normal, an absolute bare minimum per site would be 32MB for apc.shm_size, this equals 960MB with no overhead.

32MB is in my opinion way to low, it's impossible to tell from your question how loaded the sites are but you should be looking at having more RAM allocated to APC, this would exceed 1GB of RAM easily.

Some Solutions:
1. Remove APC
2. Increase RAM or put less sites on the VPS
3. Run one WordPress install (multisite or symlinked)
4. Find sites/themes/plugins that are eating up the most RAM and move them somewhere else or optimize them.

You should look over the APC settings, this is like fine tuning a car, it can make a big difference or destroy your server so be careful.

Reference : http://www.php.net/manual/en/apc.configuration.php

Some things that will effect your RAM use:

  • apc.max_file_size - set to 2M or lower
  • apc.ttl - number of seconds a cache entry is allowed to idle
  • apc.user_ttl - number of seconds a cache entry is allowed to idle (user)
  • apc.num_files_hint number of files
  • apc.stat turning this off can make a huge difference but it has major drawbacks, please read up on it.

ps. Do not play with APC settings on a production server.


I am using for caching Redis for wordpress.I got amazing results.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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