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?
Post Views: 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 lowerapc.ttl
– number of seconds a cache entry is allowed to idleapc.user_ttl
– number of seconds a cache entry is allowed to idle (user)apc.num_files_hint
number of filesapc.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.
http://www.jimwestergren.com/wordpress-with-redis-as-a-frontend-cache/