Slow http (apache) performance
Slow http (apache) performance
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?
- mikeshinn
- Atomicorp Staff - Site Admin
- Posts: 4155
- Joined: Thu Feb 07, 2008 7:49 pm
- Location: Chantilly, VA
Re: Slow http (apache) performance
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.
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.
Michael Shinn
Atomicorp - Security For Everyone
Atomicorp - Security For Everyone
-
- Atomicorp Staff - Site Admin
- Posts: 8355
- Joined: Wed Dec 31, 1969 8:00 pm
- Location: earth
- Contact:
Re: Slow http (apache) performance
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.
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.
- mikeshinn
- Atomicorp Staff - Site Admin
- Posts: 4155
- Joined: Thu Feb 07, 2008 7:49 pm
- Location: Chantilly, VA
Re: Slow http (apache) performance
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.
Michael Shinn
Atomicorp - Security For Everyone
Atomicorp - Security For Everyone
Re: Slow http (apache) performance
Thanks a lot. Will try out the performance tomorrow and maybe open a support ticket at my hosting company.
Re: Slow http (apache) performance
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!
Thanks again for your help!
- mikeshinn
- Atomicorp Staff - Site Admin
- Posts: 4155
- Joined: Thu Feb 07, 2008 7:49 pm
- Location: Chantilly, VA
Re: Slow http (apache) performance
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.
Michael Shinn
Atomicorp - Security For Everyone
Atomicorp - Security For Everyone
Re: Slow http (apache) performance
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?
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?
-
- Atomicorp Staff - Site Admin
- Posts: 8355
- Joined: Wed Dec 31, 1969 8:00 pm
- Location: earth
- Contact:
Re: Slow http (apache) performance
It will also make a huge difference for processing web statistics, and spamassassin performance.
Re: Slow http (apache) performance
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?
-
- Atomicorp Staff - Site Admin
- Posts: 8355
- Joined: Wed Dec 31, 1969 8:00 pm
- Location: earth
- Contact:
Re: Slow http (apache) performance
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
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.
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.
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>
- mikeshinn
- Atomicorp Staff - Site Admin
- Posts: 4155
- Joined: Thu Feb 07, 2008 7:49 pm
- Location: Chantilly, VA
Re: Slow http (apache) performance
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.
Michael Shinn
Atomicorp - Security For Everyone
Atomicorp - Security For Everyone
Re: Slow http (apache) performance
I'll do that and report back.
Faris.
Faris.
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>