You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Marc G. Fournier" <sc...@hub.org> on 2004/02/29 03:05:22 UTC

FreeBSD 4.x and Apache2: worker MPM issue

Someone mentioned to me once that there is an easy/consistent way to
trigger the thread bug where you have 2+ workers in operation ...

Can someone send me a how to on this?

Thanks ...

----
Marc G. Fournier           Hub.Org Networking Services (http://www.hub.org)
Email: scrappy@hub.org           Yahoo!: yscrappy              ICQ: 7615664

Re: FreeBSD 4.x and Apache2: worker MPM issue

Posted by Paul Querna <ch...@force-elite.com>.
On Sat, 2004-02-28 at 23:59, Justin Erenkrantz wrote:
> Note that this is fixed on FreeBSD 5.2+ with either libkse or libthr.  libc_r, 
> the default in 5.2, still doesn't work - you have to use libmap.conf, etc.

btw, libkse is now the default for -CURRENT,  which means for the 5.3
Release end Users will not have to use libmap.conf. Hurrah, libc_r is
finally going away!

- Paul Querna


Re: FreeBSD 4.x and Apache2: worker MPM issue

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
--On Sunday, March 7, 2004 6:28 PM -0400 "Marc G. Fournier" <sc...@hub.org> 
wrote:

> 'k, then this is probably why I can't recreate it, since the
> ads.postgresql.org stuff itself keeps the hits pretty continous ...

Yup.  FWIW, I just tested against -STABLE as of Mar 11th (Brian just upgraded 
minotaur), and worker MPM still exhibits this same failure for me.

As long as you have continuous traffic, you should be relatively okay.  But, I 
wouldn't recommend it to anyone.  ;-)  -- justin

Re: FreeBSD 4.x and Apache2: worker MPM issue

Posted by "Marc G. Fournier" <sc...@hub.org>.
On Sun, 7 Mar 2004, Justin Erenkrantz wrote:

> --On Sunday, March 7, 2004 4:50 PM -0400 "Marc G. Fournier" <sc...@hub.org>
> wrote:
>
> > Now, from the way that Justin explains it, its possible that the hits are
> > continous enough not to exhibit the problem?
>
> Correct.  As long as there is traffic on the server, it'll appear to function.
> However, the 'last' request won't get a response until there's traffic again.
> To really test this, you need to be completely idle.

'k, then this is probably why I can't recreate it, since the
ads.postgresql.org stuff itself keeps the hits pretty continous ...

----
Marc G. Fournier           Hub.Org Networking Services (http://www.hub.org)
Email: scrappy@hub.org           Yahoo!: yscrappy              ICQ: 7615664

Re: FreeBSD 4.x and Apache2: worker MPM issue

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
--On Sunday, March 7, 2004 4:50 PM -0400 "Marc G. Fournier" <sc...@hub.org> 
wrote:

> Now, from the way that Justin explains it, its possible that the hits are
> continous enough not to exhibit the problem?

Correct.  As long as there is traffic on the server, it'll appear to function. 
However, the 'last' request won't get a response until there's traffic again. 
To really test this, you need to be completely idle.

We're due to update cvs.apache.org to -STABLE soon, so as soon as that 
happens, I can try against that.  -- justin

Re: FreeBSD 4.x and Apache2: worker MPM issue

Posted by "Marc G. Fournier" <sc...@hub.org>.
On Sun, 7 Mar 2004, Paul Querna wrote:

> How are you testing this?

By using it ... I have ads.postgresql.org pointing at both servers ...
they are hte banner ads running on  http://www.postgresql.org ... on my
one server (older version of 4.9-STABLE, the whole process does lock up
after a bit), but the two other servers have been serving steady ... also,
I have http://www.hub.org pointing at it ...

> I can do it with just a simple telnet or with Firefox.
> I don't understand how you can even 'pass' a simple test.

I have yet to be able to cause an Apache2 to lock up as you've described
using telnet :(

> What is your configure line?

According to config.log:

 ./configure \
	--prefix=/usr/local \
	--enable-layout=FreeBSD \
	--with-perl=/usr/bin/perl5.00503 \
	--with-port=80 \
	--with-expat=/usr/local \
	--libdir=/usr/local/lib/apache2 \
	--includedir=/usr/local/include/apache2 \
	--enable-v4-mapped \
	--with-dbm= sdbm \
	--enable-so \
	--enable-threads \
	--with-ssl=/usr \
	--enable-mods-shared=access auth auth_anon auth_dbm auth_digest dav dav_fs actions alias asis autoindex cache cern_meta cgi cgid charset_lite deflate dir disk_cache env expires file_ cache headers imap include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique _id userdir usertrack vhost_alias proxy proxy_connect proxy_ftp proxy_http ssl \
	--with-mpm=worker i386-portbld-free bsd4.9 \
	--prefix=/usr/local i386-portbld-freebsd4.9

> What is httpd linked to? (ldd httpd)

jupiter# ldd /usr/local/sbin/httpd
/usr/local/sbin/httpd:
        libz.so.2 => /usr/lib/libz.so.2 (0x280b0000)
        libssl.so.3 => /usr/lib/libssl.so.3 (0x280bd000)
        libcrypto.so.3 => /usr/lib/libcrypto.so.3 (0x280ec000)
        libaprutil-0.so.9 => /usr/local/lib/apache2/libaprutil-0.so.9 (0x281e3000)
        libexpat.so.4 => /usr/local/lib/libexpat.so.4 (0x281f6000)
        libapr-0.so.9 => /usr/local/lib/apache2/libapr-0.so.9 (0x28213000)
        libm.so.2 => /usr/lib/libm.so.2 (0x28231000)
        libcrypt.so.2 => /usr/lib/libcrypt.so.2 (0x2824c000)
        libc_r.so.4 => /usr/lib/libc_r.so.4 (0x28265000)

> Are you using the Apache 2.0.48 from the FreeBSD Ports?

Yes ...

----
Marc G. Fournier           Hub.Org Networking Services (http://www.hub.org)
Email: scrappy@hub.org           Yahoo!: yscrappy              ICQ: 7615664

Re: FreeBSD 4.x and Apache2: worker MPM issue

Posted by Paul Querna <ch...@force-elite.com>.
On Sun, 2004-03-07 at 13:50, Marc G. Fournier wrote:
> Now, from the way that Justin explains it, its possible that the hits are
> continous enough not to exhibit the problem?

How are you testing this?
I can do it with just a simple telnet or with Firefox.
I don't understand how you can even 'pass' a simple test.


What is your configure line? 
What is httpd linked to? (ldd httpd)

I added --enable-nonportable-atomics, but it doesn't make any difference
for me.  

Are you using the Apache 2.0.48 from the FreeBSD Ports?

-Paul Querna

Re: FreeBSD 4.x and Apache2: worker MPM issue

Posted by "Marc G. Fournier" <sc...@hub.org>.
On Sun, 7 Mar 2004, Paul Querna wrote:

> On Sat, 2004-03-06 at 18:50, Marc G. Fournier wrote:
> > Actually, I think it might have been fixed ... On my Jan 6th FreeBSD
> > server, I am getting weird responses with threading enabled, but two of my
> > others ones (Jan 23rd nd Feb 4th) both seem to be working consistently ...
>
> On my 4.9-STABLE machine built today:
> FreeBSD tsunami.in.force-elite.com 4.9-STABLE FreeBSD 4.9-STABLE #8: Sun
> Mar  7 10:49:58 PST 2004
> root@tsunami.in.force-elite.com:/usr/obj/usr/src/sys/tsunami  i386
>
> The worker MPM built from CVS HEAD as of Today does not work.
>
> It still exhibits the broken behavior as Justin has described it.
>
> Are you sure your machines are 4.9-STABLE and you are running the worker
> MPM?  Do you have something special in your configuration?

4.9-STABLE FreeBSD 4.9-STABLE #5: Fri Jan 23

and

4.9-STABLE FreeBSD 4.9-STABLE #7: Wed Feb  4

# /usr/local/sbin/httpd -V
Server version: Apache/2.0.48
Server built:   Mar  4 2004 16:47:08
Server's Module Magic Number: 20020903:4
Architecture:   32-bit
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/worker"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_FLOCK_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D HTTPD_ROOT="/usr/local"
 -D SUEXEC_BIN="/usr/local/bin/suexec"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_ERRORLOG="/var/log/httpd-error.log"
 -D AP_TYPES_CONFIG_FILE="etc/apache2/mime.types"
 -D SERVER_CONFIG_FILE="etc/apache2/httpd.conf"

Now, from the way that Justin explains it, its possible that the hits are
continous enough not to exhibit the problem?

----
Marc G. Fournier           Hub.Org Networking Services (http://www.hub.org)
Email: scrappy@hub.org           Yahoo!: yscrappy              ICQ: 7615664

Re: FreeBSD 4.x and Apache2: worker MPM issue

Posted by Paul Querna <ch...@force-elite.com>.
On Sat, 2004-03-06 at 18:50, Marc G. Fournier wrote:
> Actually, I think it might have been fixed ... On my Jan 6th FreeBSD
> server, I am getting weird responses with threading enabled, but two of my
> others ones (Jan 23rd nd Feb 4th) both seem to be working consistently ...

On my 4.9-STABLE machine built today:
FreeBSD tsunami.in.force-elite.com 4.9-STABLE FreeBSD 4.9-STABLE #8: Sun
Mar  7 10:49:58 PST 2004   
root@tsunami.in.force-elite.com:/usr/obj/usr/src/sys/tsunami  i386

The worker MPM built from CVS HEAD as of Today does not work.

It still exhibits the broken behavior as Justin has described it.

Are you sure your machines are 4.9-STABLE and you are running the worker
MPM?  Do you have something special in your configuration?

-Paul Querna

Re: FreeBSD 4.x and Apache2: worker MPM issue

Posted by "Marc G. Fournier" <sc...@hub.org>.
On Tue, 2 Mar 2004, Justin Erenkrantz wrote:

> I also know that I checked this a few months ago on minotaur (ASF's CVS
> server), which is running 4.9-STABLE (from Nov 29 2003).  So, if it got
> fixed, it's probably after that as it was still broken then.

Actually, I think it might have been fixed ... On my Jan 6th FreeBSD
server, I am getting weird responses with threading enabled, but two of my
others ones (Jan 23rd nd Feb 4th) both seem to be working consistently ...

At least so far ... the two that are working consistently have been
running:

2 days 4 hours 16 minutes 25 seconds

and

3 days 49 minutes 47 seconds



----
Marc G. Fournier           Hub.Org Networking Services (http://www.hub.org)
Email: scrappy@hub.org           Yahoo!: yscrappy              ICQ: 7615664

Re: FreeBSD 4.x and Apache2: worker MPM issue

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
--On Tuesday, March 2, 2004 11:47 AM -0400 "Marc G. Fournier" 
<sc...@hub.org> wrote:

> Note that *BSD is looking at a 4.10 RSN, and I'm trying to fight for
> trying to get this fixed, if its possible, which is why I'm trying to come
> up with some data to fight with ...
>
> Is there anywhere that there is a summary of this "gnarly stuff"?
> Something you could point me at, that I can use/question?

You'd have to look at the archives for dev@httpd.  I would have been the one 
posting it along with David Reid and Aaron Bannert.  We first looked at it in 
late 2001 and early 2002.  This was coupled with issues with sendfile in 
libc_r that we got Alfred P. to fix.

I'd look inside libc_r and see if someone committed some fixes to the 
scheduling and condition variable implementations recently.  If so, then yah, 
someone might have fixed this.  (Don't have the time to check the CVS history 
myself.)

I also know that I checked this a few months ago on minotaur (ASF's CVS 
server), which is running 4.9-STABLE (from Nov 29 2003).  So, if it got fixed, 
it's probably after that as it was still broken then.

> which is what I would expect ...
>
> now, running http_load with a rate of 2 (simple), I'm still left with
> those three processes ...

Okay.

> Great, so either it did get fixed at some point, and nobody has
> acknowledge it, or I'm really doing something wrong trying to trigger it
> :( that last one, if I read the notes on http_load, would have hit it 500
> times in 10 seconds, which should have simulated a good load, I would have
> thought?

The only sure-fire reproduction case we had was to use two copies of telnet 
against the server.  What happens if you don't use http_load at all?

Yes, it's possible it's been fixed in 4.x; we know it's fixed in 5.2+ with 
libkse and libthr.  But, the libc_r in 5.2 is still broken.  -- justin

Re: FreeBSD 4.x and Apache2: worker MPM issue

Posted by "Marc G. Fournier" <sc...@hub.org>.
On Mon, 1 Mar 2004, Justin Erenkrantz wrote:

> What we believed was that it was related to race conditions inside the
> OS scheduler handler where our poll calls got mixed up with the
> scheduler's polls.  We had it tracked down to some gnarly stuff inside
> the libc_r scheduler and gave up...

Note that *BSD is looking at a 4.10 RSN, and I'm trying to fight for
trying to get this fixed, if its possible, which is why I'm trying to come
up with some data to fight with ...

Is there anywhere that there is a summary of this "gnarly stuff"?
Something you could point me at, that I can use/question?

> > so am I mis-configuring something?  I'm running the default httpd.conf,
> > and the worker stuff is setup as:
> >
> > <IfModule worker.c>
> > StartServers         2
> > MaxClients         150
> > MinSpareThreads     25
> > MaxSpareThreads     75
> > ThreadsPerChild     25
> > MaxRequestsPerChild  0
> > </IfModule>
> >
> > so I would have expected no more then 4 processes to be running, no?
>
> Well, I'd expect it to be no more than 6 (150 / 25).  But, yah, I'm not making
> sense of your 'ps auxl' output either.  Is it possible that FreeBSD is showing
> the threads as processes?  That'd make the count about right if there is only
> one process.  (Linux used to do that, but I forget *BSD's behavior.)
>
> I also know that you must have two worker processes to trigger it.  You may
> need to set 'MinSpareThreads' to 50 to ensure that you always have two
> processes up.  If you look in STATUS ("FreeBSD, threads, and worker MPM"
> entry) that is the other pre-requisite.

k, changed it to:

StartServers         3
MaxClients         150
MinSpareThreads     50
MaxSpareThreads     75
ThreadsPerChild     25
MaxRequestsPerChild  0

ps auxl (shows the parent id so that I can find all children) shows:

pluto# ps auxl | grep 20098
root      20098  0.0  0.1  4516 2912  ??  Ss   11:44AM   0:00.06 /usr/local/sbin/     0 20098     1   0   2  0  4516 2912 poll   Ss    ??    0:00.06 /usr/local/sbin/httpd
www       20101  0.0  0.1  6408 3056  ??  S    11:44AM   0:00.03 /usr/local/sbin/    80 20101 20098   0   2  0  6408 3056 poll   S     ??    0:00.03 /usr/local/sbin/httpd
www       20102  0.0  0.1  6408 3056  ??  S    11:44AM   0:00.02 /usr/local/sbin/    80 20102 20098   0   2  0  6408 3056 poll   S     ??    0:00.02 /usr/local/sbin/httpd
www       20103  0.0  0.1  6408 3056  ??  S    11:44AM   0:00.01 /usr/local/sbin/    80 20103 20098   0   2  0  6408 3056 poll   S     ??    0:00.01 /usr/local/sbin/httpd

which is what I would expect ...

now, running http_load with a rate of 2 (simple), I'm still left with
those three processes ...

19 fetches, 1 max parallel, 28823 bytes, in 10.0108 seconds
1517 mean bytes/connection
1.89795 fetches/sec, 2879.19 bytes/sec
msecs/connect: 157.772 mean, 189.588 max, 152.671 min
msecs/first-response: 173.843 mean, 244.612 max, 160.396 min
HTTP response codes:
  code 200 -- 19

increase it  by 10x, still three, and a telnet/GET after still responsive:

192 fetches, 9 max parallel, 291264 bytes, in 10.0123 seconds
1517 mean bytes/connection
19.1764 fetches/sec, 29090.6 bytes/sec
msecs/connect: 162.432 mean, 228.586 max, 152.396 min
msecs/first-response: 174.894 mean, 221.808 max, 159.584 min
HTTP response codes:
  code 200 -- 192

increase it to 50, jumped to four, then went back down to three, and a
telnet/GET after still responsive:

> http_load -rate 50 -seconds 10 /tmp/urls
433 fetches, 77 max parallel, 656861 bytes, in 10.003 seconds
1517 mean bytes/connection
43.2871 fetches/sec, 65666.5 bytes/sec
msecs/connect: 443.495 mean, 3411.55 max, 251.228 min
msecs/first-response: 417.855 mean, 3750.21 max, 269.668 min
HTTP response codes:
  code 200 -- 433

Great, so either it did get fixed at some point, and nobody has
acknowledge it, or I'm really doing something wrong trying to trigger it
:( that last one, if I read the notes on http_load, would have hit it 500
times in 10 seconds, which should have simulated a good load, I would have
thought?



----
Marc G. Fournier           Hub.Org Networking Services (http://www.hub.org)
Email: scrappy@hub.org           Yahoo!: yscrappy              ICQ: 7615664

Re: FreeBSD 4.x and Apache2: worker MPM issue

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
--On Monday, March 1, 2004 11:37 AM -0400 "Marc G. Fournier" <sc...@hub.org> 
wrote:

> so I've effectively 'pounded' the server, followed by a telnet session to
> the same server doing a 'GET /' and it returned right away:

See below, I think you only have one worker process running.  You need 
multiple process to trigger it.

What we believed was that it was related to race conditions inside the OS 
scheduler handler where our poll calls got mixed up with the scheduler's 
polls.  We had it tracked down to some gnarly stuff inside the libc_r 
scheduler and gave up...

> so am I mis-configuring something?  I'm running the default httpd.conf,
> and the worker stuff is setup as:
>
> <IfModule worker.c>
> StartServers         2
> MaxClients         150
> MinSpareThreads     25
> MaxSpareThreads     75
> ThreadsPerChild     25
> MaxRequestsPerChild  0
> </IfModule>
>
> so I would have expected no more then 4 processes to be running, no?

Well, I'd expect it to be no more than 6 (150 / 25).  But, yah, I'm not making 
sense of your 'ps auxl' output either.  Is it possible that FreeBSD is showing 
the threads as processes?  That'd make the count about right if there is only 
one process.  (Linux used to do that, but I forget *BSD's behavior.)

I also know that you must have two worker processes to trigger it.  You may 
need to set 'MinSpareThreads' to 50 to ensure that you always have two 
processes up.  If you look in STATUS ("FreeBSD, threads, and worker MPM" 
entry) that is the other pre-requisite.

> I'm guessing that the MaxRequestsPerChild == 0 means unlimited?

Should, yah.  -- justin

Re: FreeBSD 4.x and Apache2: worker MPM issue

Posted by "Marc G. Fournier" <sc...@hub.org>.
On Sun, 29 Feb 2004, Justin Erenkrantz wrote:

> --On Sunday, February 29, 2004 4:06 PM -0400 "Marc G. Fournier"
> <sc...@hub.org> wrote:
>
> > k, if I'm understanding what you are saying, how do you test something
> > like that in a way that you can debug it?  What I'm reading is that if I
> > sent two queries (GET / and, say, GET /subdir), there is a chance that the
> > one that sent GET / will get the results for GET /subdir?
>
> No, that's not quite the problem.  It is:
>
> 1. Client requests GET /
> 2. *nothing happens*
> 3. Client (same or different) requests GET /subdir/
> 4. Server responds to GET / request issued in #1 (to the correct client)
> 5. *nothing happens*
> 6. Someone requests GET /subdir/foo/ issued in #3
> 7. Server responds to GET /subdir/ request
> 8. *nothing happens*
> ...repeat cycle...
>
> Does this make more sense?  The server won't respond to the first request
> until the second request is issued and so on.  We think it's a flaw in how
> libc_r implements the pthread condition variables.  But, again, it's been
> fixed with the thread library rewrites in 5.2.  -- justin

'k, this makes more sense ... but, is there no way to 'trigger' it to
debug?  As I said, I ran http_load at it, oh, wait, I wouldn't see the
problem with http_load, since, of course, its getting hit one after the
other, so masking it ... but, again, there has to be a trigger somewhere,
because results of http_load:

1981 fetches, 1017 max parallel, 2.99152e+06 bytes, in 30.0021 seconds
1510.11 mean bytes/connection
66.0286 fetches/sec, 99710.4 bytes/sec
msecs/connect: 1688.24 mean, 16187.5 max, 152.65 min
msecs/first-response: 1578.06 mean, 18004.3 max, 168.112 min
9 bad byte counts
HTTP response codes:
  code 200 -- 1972

so I've effectively 'pounded' the server, followed by a telnet session to
the same server doing a 'GET /' and it returned right away:

24.222.46.208 - - [01/Mar/2004:11:32:32 -0400] "GET / HTTP/1.0" 200 1517 "-" "http_load 04jan2002"
24.222.46.208 - - [01/Mar/2004:11:32:42 -0400] "GET /" 200 1517 "-" "-"

checking my server:

pluto# /usr/local/sbin/httpd -l
Compiled in modules:
  core.c
  worker.c
  http_core.c
  mod_so.c

I believe I'm compiled right ...

checking my backends, I seem to have alot more then I'm expecting to have:

pluto# ps auxl | grep 10231
root      10231  0.0  0.0  2296 1420  ??  Ss    4Feb04   3:47.82 /usr/local/sbin/     0 10231     1   0   2  0  2296 1420 select Ss    ??    3:47.82 /usr/local/sbin/httpd
www       10265  0.0  0.0  2720 1784  ??  I     4Feb04   0:03.80 /usr/local/sbin/    80 10265 10231   0   2  0  2720 1784 accept I     ??    0:03.80 /usr/local/sbin/httpd
www       10266  0.0  0.0  2648 1724  ??  I     4Feb04   0:03.91 /usr/local/sbin/    80 10266 10231   0   2  0  2648 1724 accept I     ??    0:03.91 /usr/local/sbin/httpd
www       10267  0.0  0.0  2720 1780  ??  I     4Feb04   0:04.12 /usr/local/sbin/    80 10267 10231   0   2  0  2720 1780 accept I     ??    0:04.12 /usr/local/sbin/httpd
www       10268  0.0  0.0  2648 1736  ??  I     4Feb04   0:03.74 /usr/local/sbin/    80 10268 10231   0   2  0  2648 1736 accept I     ??    0:03.74 /usr/local/sbin/httpd
www       10269  0.0  0.0  2644 1760  ??  I     4Feb04   0:03.86 /usr/local/sbin/    80 10269 10231   0   2  0  2644 1760 accept I     ??    0:03.86 /usr/local/sbin/httpd
www       13919  0.0  0.0  2644 1756  ??  I     4Feb04   0:04.26 /usr/local/sbin/    80 13919 10231   0   2  0  2644 1756 accept I     ??    0:04.26 /usr/local/sbin/httpd
www       52484  0.0  0.0  2644 1728  ??  I     5Feb04   0:03.93 /usr/local/sbin/    80 52484 10231   0   2  0  2644 1728 accept I     ??    0:03.93 /usr/local/sbin/httpd
www       31428  0.0  0.0  2644 1748  ??  I     7Feb04   0:03.82 /usr/local/sbin/    80 31428 10231   0   2  0  2644 1748 accept I     ??    0:03.82 /usr/local/sbin/httpd
www       31452  0.0  0.0  2644 1740  ??  I     7Feb04   0:03.71 /usr/local/sbin/    80 31452 10231   0   2  0  2644 1740 accept I     ??    0:03.71 /usr/local/sbin/httpd
www       85079  0.0  0.0  2644 1732  ??  I    17Feb04   0:03.71 /usr/local/sbin/    80 85079 10231   0   2  0  2644 1732 accept I     ??    0:03.71 /usr/local/sbin/httpd
www       57616  0.0  0.0  2572 1736  ??  I    11:31AM   0:00.20 /usr/local/sbin/    80 57616 10231   0   2  0  2572 1736 accept I     ??    0:00.20 /usr/local/sbin/httpd
www       57619  0.0  0.0  2572 1736  ??  I    11:31AM   0:00.16 /usr/local/sbin/    80 57619 10231   0   2  0  2572 1736 accept I     ??    0:00.16 /usr/local/sbin/httpd
www       57620  0.0  0.0  2572 1736  ??  I    11:31AM   0:00.16 /usr/local/sbin/    80 57620 10231   0   2  0  2572 1736 accept I     ??    0:00.16 /usr/local/sbin/httpd
www       57627  0.0  0.0  2572 1736  ??  I    11:31AM   0:00.12 /usr/local/sbin/    80 57627 10231   0   2  0  2572 1736 accept I     ??    0:00.12 /usr/local/sbin/httpd
www       57628  0.0  0.0  2572 1736  ??  I    11:31AM   0:00.12 /usr/local/sbin/    80 57628 10231   0   2  0  2572 1736 accept I     ??    0:00.12 /usr/local/sbin/httpd
www       57629  0.0  0.0  2572 1736  ??  I    11:31AM   0:00.17 /usr/local/sbin/    80 57629 10231   0   2  0  2572 1736 accept I     ??    0:00.17 /usr/local/sbin/httpd
www       57630  0.0  0.0  2572 1736  ??  I    11:31AM   0:00.09 /usr/local/sbin/    80 57630 10231   0   2  0  2572 1736 accept I     ??    0:00.09 /usr/local/sbin/httpd
www       57636  0.0  0.0  2572 1736  ??  I    11:31AM   0:00.10 /usr/local/sbin/    80 57636 10231   0   2  0  2572 1736 accept I     ??    0:00.10 /usr/local/sbin/httpd
www       57637  0.0  0.0  2572 1736  ??  I    11:31AM   0:00.09 /usr/local/sbin/    80 57637 10231   0   2  0  2572 1736 accept I     ??    0:00.09 /usr/local/sbin/httpd
www       57638  0.0  0.0  2572 1736  ??  I    11:31AM   0:00.12 /usr/local/sbin/    80 57638 10231   0   2  0  2572 1736 accept I     ??    0:00.12 /usr/local/sbin/httpd
www       57639  0.0  0.0  2572 1736  ??  I    11:31AM   0:00.10 /usr/local/sbin/    80 57639 10231   0   2  0  2572 1736 accept I     ??    0:00.10 /usr/local/sbin/httpd
www       57640  0.0  0.0  2572 1736  ??  I    11:31AM   0:00.12 /usr/local/sbin/    80 57640 10231   0   2  0  2572 1736 accept I     ??    0:00.12 /usr/local/sbin/httpd

so am I mis-configuring something?  I'm running the default httpd.conf,
and the worker stuff is setup as:

<IfModule worker.c>
StartServers         2
MaxClients         150
MinSpareThreads     25
MaxSpareThreads     75
ThreadsPerChild     25
MaxRequestsPerChild  0
</IfModule>

so I would have expected no more then 4 processes to be running, no?

I'm guessing that the MaxRequestsPerChild == 0 means unlimited?


----
Marc G. Fournier           Hub.Org Networking Services (http://www.hub.org)
Email: scrappy@hub.org           Yahoo!: yscrappy              ICQ: 7615664

Re: FreeBSD 4.x and Apache2: worker MPM issue

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
--On Sunday, February 29, 2004 4:06 PM -0400 "Marc G. Fournier" 
<sc...@hub.org> wrote:

> k, if I'm understanding what you are saying, how do you test something
> like that in a way that you can debug it?  What I'm reading is that if I
> sent two queries (GET / and, say, GET /subdir), there is a chance that the
> one that sent GET / will get the results for GET /subdir?

No, that's not quite the problem.  It is:

1. Client requests GET /
2. *nothing happens*
3. Client (same or different) requests GET /subdir/
4. Server responds to GET / request issued in #1 (to the correct client)
5. *nothing happens*
6. Someone requests GET /subdir/foo/ issued in #3
7. Server responds to GET /subdir/ request
8. *nothing happens*
...repeat cycle...

Does this make more sense?  The server won't respond to the first request 
until the second request is issued and so on.  We think it's a flaw in how 
libc_r implements the pthread condition variables.  But, again, it's been 
fixed with the thread library rewrites in 5.2.  -- justin

Re: FreeBSD 4.x and Apache2: worker MPM issue

Posted by "Marc G. Fournier" <sc...@hub.org>.
yOn Sun, 29 Feb 2004, Justin Erenkrantz wrote:

> --On Sunday, February 29, 2004 12:29 PM -0400 "Marc G. Fournier"
> <sc...@hub.org> wrote:
>
> > 'k, how do you manage 'simultaneously?  I tried using http_load with -rate
> > set to 10, and couldn't lock it up, and its supposed to start up 10
> > connections per sec, if I read the docs right ...
>
> You probably want to use telnet instead (i.e. two telnet sessions at
> once).  It'll service requests, but it's dependent on having the second
> request come in to service the first one.  That was unacceptable to us,
> and why we disabled threading by default.  -- justin

k, if I'm understanding what you are saying, how do you test something
like that in a way that you can debug it?  What I'm reading is that if I
sent two queries (GET / and, say, GET /subdir), there is a chance that the
one that sent GET / will get the results for GET /subdir?

----
Marc G. Fournier           Hub.Org Networking Services (http://www.hub.org)
Email: scrappy@hub.org           Yahoo!: yscrappy              ICQ: 7615664

Re: FreeBSD 4.x and Apache2: worker MPM issue

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
--On Sunday, February 29, 2004 12:29 PM -0400 "Marc G. Fournier" 
<sc...@hub.org> wrote:

> 'k, how do you manage 'simultaneously?  I tried using http_load with -rate
> set to 10, and couldn't lock it up, and its supposed to start up 10
> connections per sec, if I read the docs right ...

You probably want to use telnet instead (i.e. two telnet sessions at once). 
It'll service requests, but it's dependent on having the second request come 
in to service the first one.  That was unacceptable to us, and why we disabled 
threading by default.  -- justin

Re: FreeBSD 4.x and Apache2: worker MPM issue

Posted by "Marc G. Fournier" <sc...@hub.org>.
On Sat, 28 Feb 2004, Justin Erenkrantz wrote:

> --On Saturday, February 28, 2004 10:05 PM -0400 "Marc G. Fournier"
> <sc...@hub.org> wrote:
>
> > Someone mentioned to me once that there is an easy/consistent way to
> > trigger the thread bug where you have 2+ workers in operation ...
> >
> > Can someone send me a how to on this?
>
> Just issue two GET requests simultaneously.  On FreeBSD 4.x, responses are
> only processed serially and in a one-off manner.  That is, the first response
> will not be sent until the second request is sent.

'k, how do you manage 'simultaneously?  I tried using http_load with -rate
set to 10, and couldn't lock it up, and its supposed to start up 10
connections per sec, if I read the docs right ...

----
Marc G. Fournier           Hub.Org Networking Services (http://www.hub.org)
Email: scrappy@hub.org           Yahoo!: yscrappy              ICQ: 7615664

Re: FreeBSD 4.x and Apache2: worker MPM issue

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
--On Saturday, February 28, 2004 10:05 PM -0400 "Marc G. Fournier" 
<sc...@hub.org> wrote:

> Someone mentioned to me once that there is an easy/consistent way to
> trigger the thread bug where you have 2+ workers in operation ...
>
> Can someone send me a how to on this?

Just issue two GET requests simultaneously.  On FreeBSD 4.x, responses are 
only processed serially and in a one-off manner.  That is, the first response 
will not be sent until the second request is sent.

Note that this is fixed on FreeBSD 5.2+ with either libkse or libthr.  libc_r, 
the default in 5.2, still doesn't work - you have to use libmap.conf, etc.

HTH.  -- justin