Portal Home > Knowledgebase > Articles Database > Need apache optimization!


Need apache optimization!




Posted by Ruriko, 07-24-2010, 10:43 PM
Can someone help me optimize apache? my site sometimes become unreachable even though my vps is still running. I full reboot fixes everything but I don't want to keep doing this every few days just to reboot. My vps has 2GB ram. It receives about 4k+ unique hits with 20k+ page views daily. It is a dynamic site powered on wordpress and cached. I think I get 100+ concurrent users

Posted by Ankheg, 07-24-2010, 11:14 PM
Try lowering the timeout to 5 seconds, and change the worker maxrequestsperchild to 4000. Is this a Xen VPS, or OpenVZ, or something else? is 2GB RAM the guaranteed memory, or burst? Do you have swap space? How much? Is it getting used? Also, what caching are you doing for Wordpress, and how is it configured? You may need to / probably will want to consider tweaking your PHP settings, as well, and probably MySQL, while you're at it. 4K uniques per day under Wordpress should be a breeze, with a *lot* less than 2GB of RAM.

Posted by aroel, 07-24-2010, 11:22 PM
have you considered to use another webserver? i have more than 1 million hits daily and more than 300k pv, nginx serve it well, only use 300mb out of my 4gb memory

Posted by Ruriko, 07-24-2010, 11:31 PM
It's 1GB guaranteed and 2GB burst. It is OpenVZ. I use a plugin called wp-super-cache and have set delete cache every 3hours. This is my mysql

Posted by Ankheg, 07-24-2010, 11:55 PM
Craking the Apache timeout setting way, way down should help. I'd up query_cache_size to something more like 24M, up query_cache_limit to 4M, and crank wait_timeout way down, to more like 20. Also, I know it sounds stupid, but are you sure wp_super_cache is actually working? Oh, and have you added cache-control headers to images, et cetera? You can greatly reduce the number of requests Apache serves to repeat visitors that way.

Posted by fwaggle, 07-25-2010, 01:42 AM
You don't mention what MPM you're using, and you have the configurations for both Worker and Prefork in your paste. If you're using Prefork and don't have gobs of RAM, give Worker a try and see if that's any quicker. On the whole though, if it's just the one site on your VPS and you're not trying to do shared hosting or anything... give nginx or lighttpd a shot. They haul ass at serving static content compared to Apache (Apache can be made to do it, it just huffs and puffs a bit).

Posted by Ankheg, 07-25-2010, 02:23 AM
Lighttpd, Nginx, or whatever will certainly work, if configured correctly. On a VPS with 1GB of usable RAM, though, Apache shouldn't have even the slightest problem handling 4K uniques per day under Wordpress (unless, maybe, disk i/o performance is really abysmal, since WP Super Cache does disk-based caching. And if that's the case, switching webservers isn't going to help.) We do well over that on some Wordpress-based sites on shared PIII machines with 512MB RAM...

Posted by Ruriko, 07-25-2010, 03:54 AM
Yes wp super cache is working you can see it live here http://www.lovelyanime.com Now let's see if it doesn't crash within 48hours. How do I find out what MPM I'm running? cause I'm just using the default settings on webmin

Posted by Crashus, 07-25-2010, 09:03 AM
are you using prefork or worker?

Posted by Ankheg, 07-25-2010, 03:01 PM
You, uh, realize your version of Wordpress is several months out of date, right? And that your DNS is completely and utterly borked? And that your site doesn't appear to support GZip? You need to fix more than just Apache, is what I'm saying.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
staminus down (Views: 631)
UK Telehouse (Views: 596)