Page 1 of 1
Slow http (apache) performance
Posted: Fri Sep 18, 2009 12:27 pm
by biggles
I have run into a problem with one of my servers. It have started to perform extremely bad when it handles http requests. It simply is slow. I really can't say that I have changed anything. It is a VPS but it doesn't feel slow in any other aspect. Plesk control panel is ok, ASL gui is ok, but webmail and web pages are slow. It takes 5-10 seconds to display a page. Really don't know where to start. Tried to restart but it doesn't help. top doesn't show anything demanding resources... Any got any suggestions?
Re: Slow http (apache) performance
Posted: Sat Sep 19, 2009 8:41 am
by mikeshinn
Are you using the RBL rules? If so, and if you dont use a local caching DNS server (and make sure its first in your nameserver list) you will experience slowness as you lookup the RBL entry for every connection.
Any thing that can slow down apache tremendously is if you do name lookups on your logs in realtime. In other words, if your system doesnt log the IP but the hostname in your access logs.
Re: Slow http (apache) performance
Posted: Sat Sep 19, 2009 8:44 am
by scott
First check out the apache benchmark utility, called ab. I like to get a feel for the performance of a system by using that against a flat HTML file. 300-400 queries/sec is pretty normal for static content.
Keep in mind a VPS is using shared resources too, so another VPS on the box could be the culprit here. All it takes is one of them under load to effect the others.
Re: Slow http (apache) performance
Posted: Sat Sep 19, 2009 8:47 am
by mikeshinn
Excellent point, a VPS could be experiencing slow downs because of another virtual machine on the same system and you would never be able to figure it out from your VPS.
Re: Slow http (apache) performance
Posted: Sun Sep 20, 2009 10:05 am
by biggles
Thanks a lot. Will try out the performance tomorrow and maybe open a support ticket at my hosting company.
Re: Slow http (apache) performance
Posted: Mon Sep 21, 2009 3:16 pm
by biggles
It was the ASL RBL that had been turned on by one of the ASL 2.1 upgrades. Tricky to find (if you're not an ART, of course)!
Thanks again for your help!
Re: Slow http (apache) performance
Posted: Tue Sep 22, 2009 6:54 pm
by mikeshinn
Our pleasure. If you want to use the RBLs you really want to use a local DNS server on the box for all your DNS lookups. In fact, you want to do this on any box. Local DNS is lightspeed compared to a remote DNS server.
Re: Slow http (apache) performance
Posted: Thu Sep 24, 2009 11:33 am
by mneese
Biggles...
I went through similar thing with the RBL turned on in the upgrade...i am sure that i set it on in my configuration cycles...slowed some sites down to 900 bites/sec...people were closing the connection, so the error i was getting on this was referring to the closed connection...
Anyway, with ASL's support help, we set up the local DNS caching...really quite simple...but i have to say it has improved the speed on a lot of functions such as yum updates, upgrades, and of course the html downloads...the sites (joomla) that were going at 900bytes/sec and failing increased in speed up to 20,000+ bytes/sec...dramatic difference...
I see that "AB" is part of apache, but does anyone have some good commands for this utility?
Re: Slow http (apache) performance
Posted: Thu Sep 24, 2009 12:33 pm
by scott
It will also make a huge difference for processing web statistics, and spamassassin performance.
Re: Slow http (apache) performance
Posted: Fri Sep 25, 2009 12:53 am
by biggles
And the correct way of doing it is to install bind (installed by Plesk) and make sure 127.0.0.1 is in resolve.conf, right?
Re: Slow http (apache) performance
Posted: Fri Sep 25, 2009 8:25 am
by scott
and make sure its listed first (nameserver 127.0.0.1), the libc resolver on your system might not support more than 3 nameserver entries.
Re: Slow http (apache) performance
Posted: Fri Sep 25, 2009 10:02 am
by faris
We've switched to using the OpenDNS DNS servers instead of using localhost. It seems to be extremely fast.
I've not added them as forwarders - we just use them in resolv.conf and don't use 127.0.0.1.
In theory I'd hope that this should help with spamassassin (and spamdyke) dns lookups, as they are most likely cached on the OpenDNS side due to the volume of users looking up the same things.
At any rate we do DNS lookups on several rbls via ASL on several VPSes and there's no perceptible hit in terms of performance. I was surprised how well it works, to be honest.
Faris.
Re: Slow http (apache) performance
Posted: Fri Sep 25, 2009 11:28 am
by mikeshinn
I'd still use a local server and set it up to use OpenDNS as forwarders. You're not doing any caching in your case, and that will be much slower than a local resolver.
Re: Slow http (apache) performance
Posted: Fri Sep 25, 2009 9:43 pm
by faris
I'll do that and report back.
Faris.