Slow http (apache) performance

Community support for Plesk, CPanel, WebMin and others with insight from two of the founders of Plesk. Ask for help here! No question is too simple or complicated. :-)
biggles
Forum Regular
Forum Regular
Posts: 806
Joined: Tue Jul 15, 2008 2:38 pm
Location: Sweden
Contact:

Slow http (apache) performance

Unread post 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?
User avatar
mikeshinn
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 4155
Joined: Thu Feb 07, 2008 7:49 pm
Location: Chantilly, VA

Re: Slow http (apache) performance

Unread post 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.
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Re: Slow http (apache) performance

Unread post 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.
User avatar
mikeshinn
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 4155
Joined: Thu Feb 07, 2008 7:49 pm
Location: Chantilly, VA

Re: Slow http (apache) performance

Unread post 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.
biggles
Forum Regular
Forum Regular
Posts: 806
Joined: Tue Jul 15, 2008 2:38 pm
Location: Sweden
Contact:

Re: Slow http (apache) performance

Unread post by biggles »

Thanks a lot. Will try out the performance tomorrow and maybe open a support ticket at my hosting company.
biggles
Forum Regular
Forum Regular
Posts: 806
Joined: Tue Jul 15, 2008 2:38 pm
Location: Sweden
Contact:

Re: Slow http (apache) performance

Unread post 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!
User avatar
mikeshinn
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 4155
Joined: Thu Feb 07, 2008 7:49 pm
Location: Chantilly, VA

Re: Slow http (apache) performance

Unread post 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.
mneese
Forum Regular
Forum Regular
Posts: 218
Joined: Thu Apr 23, 2009 12:08 pm

Re: Slow http (apache) performance

Unread post 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?
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Re: Slow http (apache) performance

Unread post by scott »

It will also make a huge difference for processing web statistics, and spamassassin performance.
biggles
Forum Regular
Forum Regular
Posts: 806
Joined: Tue Jul 15, 2008 2:38 pm
Location: Sweden
Contact:

Re: Slow http (apache) performance

Unread post 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?
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Re: Slow http (apache) performance

Unread post 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.
faris
Long Time Forum Regular
Long Time Forum Regular
Posts: 2321
Joined: Thu Dec 09, 2004 11:19 am

Re: Slow http (apache) performance

Unread post 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.
--------------------------------
<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>
User avatar
mikeshinn
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 4155
Joined: Thu Feb 07, 2008 7:49 pm
Location: Chantilly, VA

Re: Slow http (apache) performance

Unread post 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.
faris
Long Time Forum Regular
Long Time Forum Regular
Posts: 2321
Joined: Thu Dec 09, 2004 11:19 am

Re: Slow http (apache) performance

Unread post by faris »

I'll do that and report back.

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>
Post Reply