You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Martin Sarsale <ms...@buenosaires.gov.ar> on 2003/07/28 20:19:38 UTC

[users@httpd] machine slowdown

Dear all:

We're using Apache/1.3.27 on our main web server (pentium 3, 733mhz, 256mb ram  + 256mb swap, linux 2.4.20-18.7, redhat 7.3). 

This is the problem:
we're having a big number of connections (about 100 simultaneous clients with peaks of 250 (then, MaxChildren is reached)) and after the server is running for some time, it stops answering requests and the system becomes _very_ slow: it's not possible to log in via ssh and when login via the console everything works really slow (some seconds pass between each program executed). 

We found that we had to kill apache or unplug the network cable to get system up again.
 
We're saving the output of 'top' each minute and analized them: at least one minute before the system becomes unusable there's still 57mb (swap) free and the server is 72.2% idle:

369 processes: 368 sleeping, 1 running, 0 zombie, 0 stopped
CPU states: 19.3% user,  8.4% system,  0.0% nice, 72.2% idle
Mem:   255516K av,  252064K used,    3452K free,       0K shrd,    1548K buff
Swap:  408796K av,  350988K used,   57808K free                   14328K cached


Server info reports:

Total accesses: 21343 - Total Traffic: 81.9 MB
CPU Usage: u118.26 s27.15 cu.18 cs.07 - 16.6% CPU load
24.3 requests/sec - 95.6 kB/second - 4021 B/request
250 requests currently being processed, 0 idle servers

WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWKWWWWWWWWWWW
WWWWWWWWWWKWWWWWKWWWWWWWWWWWWWWWWWWWWWKWWWWWWWWKWWWKKWWWWWWWWWWW
WWWWKWWWWWWWWWWWWWWWWWWWWWWWWWWWWWKWWWWKWWWWWWWWWKKWWWWKKWWWKWWK
WWKWWWKWWKWRWWWWWKWWWKKWWWKWRWWWWWKWWKKKWWWWWWWKKWKWKKWKKW......


Our apache config is the following (server-info):

Apache Server Information

Server Settings, mod_ssl.c, mod_dav.c, mod_php4.c, mod_setenvif.c, mod_so.c, mod_headers.c, mod_expires.c, mod_auth_db.c, mod_auth_anon.c, mod_auth.c, mod_access.c, mod_rewrite.c, mod_alias.c, mod_userdir.c, mod_actions.c, mod_imap.c, mod_asis.c, mod_cgi.c, mod_dir.c, mod_autoindex.c, mod_include.c, mod_info.c, mod_status.c, mod_negotiation.c, mod_mime.c, mod_log_referer.c, mod_log_agent.c, mod_log_config.c, mod_env.c, mod_aspseek.c, mod_throttle.c, mod_bandwidth.c, mod_vhost_alias.c, http_core.cServer Version: Apache/1.3.27 (Unix) (Red-Hat/Linux) mod_ssl/2.8.5 OpenSSL/0.9.6 DAV/1.0.2 PHP/4.2.1 mod_throttle/3.1.2
Server Built: Oct 23 2002 14:51:49
API Version: 19990320:13
Run Mode: standalone
User/Group: apache(48)/48
Hostname/port: www.buenosaires.gov.ar:443
Daemons: start: 8    min idle: 5    max idle: 20    max: 250
Max Requests: per child: 100    keep alive: on    max per connection: 100
Threads: per child: 0   
Excess requests: per child: 0   
Timeouts: connection: 300    keep-alive: 15
Server Root: /etc/httpd
Config File: conf/httpd.conf
PID File: /var/run/httpd.pid
Scoreboard File: logs/apache_runtime_status

We're worried about this problem, we are experiencing this kind of problems 5 o 6 times/day: we've tried reducing the max number of clients but nothing happened.

Thanks in advance!

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] machine slowdown

Posted by Victor Tsang <vi...@outblaze.com>.
You swapped.  try decrease your max children to a number which will give
you no swap or buy more ram.  

To find a appropiate max children value, do a top and sort the display
by memory usage, check out how much memory you apache children are
using, and use your available physical memory to divide by that.


Tor.

Martin Sarsale wrote:
> 
> Dear all:
> 
> We're using Apache/1.3.27 on our main web server (pentium 3, 733mhz, 256mb ram  + 256mb swap, linux 2.4.20-18.7, redhat 7.3).
> 
> This is the problem:
> we're having a big number of connections (about 100 simultaneous clients with peaks of 250 (then, MaxChildren is reached)) and after the server is running for some time, it stops answering requests and the system becomes _very_ slow: it's not possible to log in via ssh and when login via the console everything works really slow (some seconds pass between each program executed).
> 
> We found that we had to kill apache or unplug the network cable to get system up again.
> 
> We're saving the output of 'top' each minute and analized them: at least one minute before the system becomes unusable there's still 57mb (swap) free and the server is 72.2% idle:
> 
> 369 processes: 368 sleeping, 1 running, 0 zombie, 0 stopped
> CPU states: 19.3% user,  8.4% system,  0.0% nice, 72.2% idle
> Mem:   255516K av,  252064K used,    3452K free,       0K shrd,    1548K buff
> Swap:  408796K av,  350988K used,   57808K free                   14328K cached
> 
> Server info reports:
> 
> Total accesses: 21343 - Total Traffic: 81.9 MB
> CPU Usage: u118.26 s27.15 cu.18 cs.07 - 16.6% CPU load
> 24.3 requests/sec - 95.6 kB/second - 4021 B/request
> 250 requests currently being processed, 0 idle servers
> 
> WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWKWWWWWWWWWWW
> WWWWWWWWWWKWWWWWKWWWWWWWWWWWWWWWWWWWWWKWWWWWWWWKWWWKKWWWWWWWWWWW
> WWWWKWWWWWWWWWWWWWWWWWWWWWWWWWWWWWKWWWWKWWWWWWWWWKKWWWWKKWWWKWWK
> WWKWWWKWWKWRWWWWWKWWWKKWWWKWRWWWWWKWWKKKWWWWWWWKKWKWKKWKKW......
> 
> Our apache config is the following (server-info):
> 
> Apache Server Information
> 
> Server Settings, mod_ssl.c, mod_dav.c, mod_php4.c, mod_setenvif.c, mod_so.c, mod_headers.c, mod_expires.c, mod_auth_db.c, mod_auth_anon.c, mod_auth.c, mod_access.c, mod_rewrite.c, mod_alias.c, mod_userdir.c, mod_actions.c, mod_imap.c, mod_asis.c, mod_cgi.c, mod_dir.c, mod_autoindex.c, mod_include.c, mod_info.c, mod_status.c, mod_negotiation.c, mod_mime.c, mod_log_referer.c, mod_log_agent.c, mod_log_config.c, mod_env.c, mod_aspseek.c, mod_throttle.c, mod_bandwidth.c, mod_vhost_alias.c, http_core.cServer Version: Apache/1.3.27 (Unix) (Red-Hat/Linux) mod_ssl/2.8.5 OpenSSL/0.9.6 DAV/1.0.2 PHP/4.2.1 mod_throttle/3.1.2
> Server Built: Oct 23 2002 14:51:49
> API Version: 19990320:13
> Run Mode: standalone
> User/Group: apache(48)/48
> Hostname/port: www.buenosaires.gov.ar:443
> Daemons: start: 8    min idle: 5    max idle: 20    max: 250
> Max Requests: per child: 100    keep alive: on    max per connection: 100
> Threads: per child: 0
> Excess requests: per child: 0
> Timeouts: connection: 300    keep-alive: 15
> Server Root: /etc/httpd
> Config File: conf/httpd.conf
> PID File: /var/run/httpd.pid
> Scoreboard File: logs/apache_runtime_status
> 
> We're worried about this problem, we are experiencing this kind of problems 5 o 6 times/day: we've tried reducing the max number of clients but nothing happened.
> 
> Thanks in advance!
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] machine slowdown

Posted by Joshua Slive <jo...@slive.ca>.
On Mon, 28 Jul 2003, Joshua Slive wrote:
> On Mon, 28 Jul 2003, Martin Sarsale wrote:
> > This is the problem: we're having a big number of connections (about 100
>
> You are out of memory.  The system is swapping back and forth to disk and

Of course, I also should have directed you to read
http://httpd.apache.org/docs/misc/perf-tuning.html
which contains some useful info.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] machine slowdown

Posted by Joshua Slive <jo...@slive.ca>.
On Mon, 28 Jul 2003, Martin Sarsale wrote:
> This is the problem: we're having a big number of connections (about 100
> simultaneous clients with peaks of 250 (then, MaxChildren is reached))
> and after the server is running for some time, it stops answering
> requests and the system becomes _very_ slow: it's not possible to log in
> via ssh and when login via the console everything works really slow
> (some seconds pass between each program executed).

> Mem:   255516K av,  252064K used,    3452K free,       0K shrd,    1548K buff
> Swap:  408796K av,  350988K used,   57808K free                   14328K cached

You are out of memory.  The system is swapping back and forth to disk and
thrashing itself to death.  To verify this, there is probably a program on
linux that will tell you the exact swapping activity.  I don't remember
what it is, however.

Some ways you can fix the problem:

1. Reduce MaxClients.  You said you did this, but obviously you haven't
reduced it enough since you are still out of memory.

2. Buy more memory.

3. Try to trim down apache so that it takes less memory.  Do you really
need all those modules?  How much memory is each httpd using?

4. Try apache 2 with a threaded mpm like worker (but make sure all the
modules you need are supported).

5. You can also try reducing the KeepaliveTimeout, which should help get
rid of some of the requests in the "K" state in your server status report.
But that probably won't be enough to solve your problem, since most of the
requests are in "W" (sending response).

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org