homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

Slow Apache, fast server
Apache periodically becomes very slow

 8:17 pm on Dec 25, 2010 (gmt 0)

A few days ago I reinstalled one of my dedicated servers and got a new IP address. It runs Debian and Apache 2. Never had performance problems with this server.

After reinstallation everything was OK and I opened my website to the visitors. After some time i noticed that Apache periodically becames very slow. I can 10-20 clicks and pages load immediately. Then for some 2-3 minutes I can hardly open some page. Then it works fast again.

When this problem happends, everything runs fast on the server, except Apache. Server load is only ~0.2 - 0.3.

Apache configuration file has default settings and I was running this website with the same scripts and with th same Apache default settings for a long time. Never had problems.

Hostname lookups are disabled.

Any ideas? Thanks.



 8:21 pm on Dec 25, 2010 (gmt 0)

Reinstalled as in reinstalled the O/S?

The default installation probably has a load of stuff you don't need. Services which are started but not required. Memory tuned for other services not apache.

Are you sure the same config file is in use or has a default config been created?


 8:37 pm on Dec 25, 2010 (gmt 0)

Have you checked to see if your server is hacked?

Tons of spam being pushed thru a server in small bursts is actually a low CPU load but a high bandwidth load, and with little bandwidth Apache would appear excruciatingly slow.


 9:09 pm on Dec 25, 2010 (gmt 0)

Frank_Rizzo, yes, renistalled the OS.

incrediBILL, yes, I have checked. Mail logfiles donīt contain anything unusual.


 10:20 pm on Dec 25, 2010 (gmt 0)

It's strange that very often page starts loaging very fast and then it stops for some time, then contiunues loading.


 11:06 pm on Dec 25, 2010 (gmt 0)

Have you tried it on different pcs from different ISPs? It sounds as if you are noticing the problem on your browser?

If it is the server then it sounds like memory swapping. What's the memory stats like? How much swap file is used?


 8:31 am on Dec 26, 2010 (gmt 0)

Have you tried it from a different location?

It's possible your ISP is suffering intermittent packet loss.

For instance, when I see an issue on Comcast, I also check using my Sprint Broadband connection to see if it happens there as well.

Try a traceroute from your PC to your site a few times and see if you're dropping packets.

You may find out it has nothing to do with your server.


 9:53 am on Dec 26, 2010 (gmt 0)

Memory stats:

MemTotal: 3629392 kB
MemFree: 460792 kB
Buffers: 214420 kB
Cached: 2434304 kB
SwapCached: 628 kB
Active: 1254820 kB
Inactive: 1713984 kB
HighTotal: 2749072 kB
HighFree: 95056 kB
LowTotal: 880320 kB
LowFree: 365736 kB
SwapTotal: 7815544 kB
SwapFree: 7814916 kB
Dirty: 7960 kB
Writeback: 0 kB
AnonPages: 317476 kB
Mapped: 14260 kB
Slab: 177684 kB
SReclaimable: 165988 kB
SUnreclaim: 11696 kB
PageTables: 6224 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 9630240 kB
Committed_AS: 990128 kB
VmallocTotal: 114680 kB
VmallocUsed: 6644 kB
VmallocChunk: 107808 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 4096 kB


 2:15 pm on Dec 26, 2010 (gmt 0)

I got messages from some users that they have the same problem - periodically website becomes very slow. So, I think it's not ISP problem.


 3:56 pm on Dec 26, 2010 (gmt 0)

Here are traceroute results to my server:

1 <1 ms <1 ms <1 ms ...
2 39 ms 38 ms 38 ms ...
3 39 ms 38 ms 40 ms ...
4 71 ms 71 ms 72 ms ...
5 121 ms 99 ms 100 ms ...
6 96 ms 96 ms 96 ms ...
7 92 ms 96 ms 96 ms ...
8 106 ms 102 ms 106 ms ...
9 135 ms 133 ms 133 ms ...
10 134 ms 133 ms 132 ms ...
11 135 ms 140 ms 157 ms ...
12 143 ms 142 ms 138 ms ...
13 140 ms 140 ms 140 ms my.datacenter [...]
14 * * * Request timed out
15 138 ms 138 ms 138 ms my.server [...]

There are 3 asterisks before my server. I did some 10 traceroutes and these 3 asterisks appear in all results.

Other servers in the same datacenter show the same tracerout results: 3 asterisks before server.

What does it mean?


 6:44 pm on Dec 26, 2010 (gmt 0)

So you have root access on the server?

drop into a shell and run "top". Then do your 10-20 clicks until your server gets lathargic. Whatch the top utility closely. See any system pigs? Is it really Apache that is getting slow or something else (like php/mysql) on the server? Are you running a real server, or is this virtual? (if virtual - all bets are off)

> 3 asterisks

no worries there. It just means that box/router does not respond to pings.


 12:17 pm on Dec 27, 2010 (gmt 0)

I changed Apache configuration file and the problem is gone. New settings:

<IfModule prefork.c>
StartServers 15
MinSpareServers 10
MaxSpareServers 20
ServerLimit 512
MaxClients 512
MaxRequestsPerChild 0

It's very strange. For years I was using Apache's default settings and never experienced speed problems.


 2:59 am on Dec 29, 2010 (gmt 0)

I wonder if your OS was updated and something in the OS was different?

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved