httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tani Hosokawa <>
Subject Re: some questions about threaded apache
Date Mon, 21 Jun 1999 08:13:34 GMT
On Sun, 20 Jun 1999, Manoj Kasichainula wrote:

> On Sun, Jun 20, 1999 at 09:00:50PM -0700, Tani Hosokawa wrote:
> > Now, I assumed that MinSpareServers would be the number of processes, each
> > with a variable number of threads.
> Nope. The server in the apache-apr directory has a variable number of
> processes and a fixed number of threads right now.
> > So 1 and 2 would seem to be reasonable.
> I would think so.
> > However, when I use those values I get (according to
> > server-status) 0 idle servers, and I do see a noticeably slower connection
> > (although once connected I'm quick, presumably because I'm reusing my
> > connection).
> That's weird. My very hasty tests don't show this problem. Which
> modules do you have loaded? How much slower a connection are we
> talking about here?
> How many concurrent connections is your server running at? Most of our
> testing before was with ApacheBench, and the number of concurrent
> connections went up to around 100 (though ThreadsPerChild was low
> too). So I'm guessing you've been the best tester so far.

I've got mod_rewrite compiled in, I removed mod_userdir, I added
-DDYNAMIC_MODULE_LIMIT=0, other than that it's stock source (with
HARD_THREAD_LIMIT and HARD_SERVER_LIMIT increased of course).  I've tested
two servers, one with about 500 connections, the other was at about 1200
before I left (and it died at some point).

I'm talking about a 3-5 second wait before the connection actually
establishes.  After that initial connection, the problem seems to pretty
much go away, until I try to connect from somewhere else.

> > When I increased those values to 20/40, it never kills any
> > threads, so I always have a total of 1454 threads (I chose those numbers
> > because I've limited NR_TASKS to 1500 per user).
> Hmmm, there are actually more than 64 threads in a 64-thread server.
> There's the sigwait thread and the Linuxthreads monitor thread. So you
> might hit NR_TASKS.

Well, there's virtually no CGI happening on this server, so I doubt it'd
eat up the remaining tasks...

> I'm curious if mod_status is lying or not. Do ps and pstree agree with
> what mod_status is telling you?

pstree seems to agree with what I'm seeing.  The behaviour I saw before
seems to have evened out a little, but I've still got 1132 servers
running, with only about 500 actively serving requests.  The server that
was working really hard (about 1200 active connections) seems to have
crashed somewhere, and I wasn't around to watch... :(

     |           |-2*[httpd-apr---httpd-apr---httpd-apr]
     |           |-httpd-apr---httpd-apr---2*[httpd-apr]
     |           `-20*[httpd-apr---httpd-apr---64*[httpd-apr]]

> Also, I did notice one problem a while back when I tried to bang hard
> on the the hybrid server with default user settings in Red Hat (256
> processes).  When we hit that limit, the server hung in
> pthread_create. My guess is that the main thread sends a message to
> the monitor thread, which then chokes on the clone() call, and doesn't
> wake up the main thread. Hijinks then ensue.

I've seen similar behaviour under the preforked Apache.  I get a bunch of
unkillable processes that don't do anything but hang on to the the bound
socket so I can't start another Apache, so I end up needing to reboot...

> > As an aside, threaded Apache seems to handle load MUCH better than normal
> > Apache... 1.3.6 showing a consistent load of about 6-9 only has a load of
> > 1.2 on threaded apache :)
> Cool. That was the intention. I was worried that the benefit of
> threading wouldn't be as great on Linux because processes and threads
> are so similar.

tani hosokawa
river styx internet

View raw message