Stas Bekman wrote: >Stas Bekman wrote: > > >>Steve Hay wrote: >> >> >> >>>Bill Stoddard wrote: >>> >>> >>> >>> >>>>Just committed a fix (please test) to Apache HTTPD 2.1. Patch is here >>>>(it should apply to 2.0): >>>> >>>>http://cvs.apache.org/viewcvs.cgi/httpd-2.0/server/mpm/winnt/child.c?r1=1.32&r2=1.33 >>>> >>>> >>>> >>>> >>>> >>>> >>>Brilliant! That's fixed it straight away -- the mp2 1.99_13 test >>>suite with all 21 Listen's but only 20 ThreadsPerChild now runs >>>perfectly. >>> >>>(Actually, it works fine with only 1 ThreadsPerChild now!!!) >>> >>>It still says it only started 20 threads, though (in error_log). Is >>>that correct? I thought the plan was to bump ThreadsPerChild up, so I >>>was expecting to see an extra thread started. Or is it that >>>ThreadsPerChild threads are still created initially, and up to >>>num_listeners extra threads can now be created later if required. >>> >>>Perhaps a documentation change would be in order too, to mention the >>>effect that the number of listeners now has on ThreadsPerChild? >>> >>> >>Can this entry appear at the end of httpd.conf? >> >><IfModule mpm_winnt.c> >> ThreadsPerChild 20 >> MaxRequestsPerChild 0 >></IfModule> >> >>if so, this patch should do the right thing. If not, a big rewrite will >>be required as at the moment we don't know the number of listeners when >>the top of httpd.conf is written. >> >> > >Steve, Randy, you haven't confirmed whether you want this patch to be in or >not. Take your time to respond, of course. > Sorry, Stas - in the excitement over Bill's patch to fix Apache I completely forgot about your fix for mp2 running on unfixed Apache's.
I've tried it out now using 2.0.48 (under which 1.99_13's test suite would normally "hang" for me) and it successfully bumped up the ThreadsPerChild setting to 22 and the test suite all ran OK. Is there any way to inspect what version of Apache we're using and only increment max_clients by vhost_listeners for version < 2.0.50? It doesn't hurt to always do the increment, of course, but it might be useful from the point of view of testing Apache too if it wasn't done when it didn't need to be. - Steve > > > >>Index: lib/Apache/TestConfig.pm >>=================================================================== >>RCS file: >>/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm,v >>retrieving revision 1.213 >>diff -u -r1.213 TestConfig.pm >>--- lib/Apache/TestConfig.pm 4 Mar 2004 05:51:31 -0000 1.213 >>+++ lib/Apache/TestConfig.pm 10 Mar 2004 18:57:07 -0000 >>@@ -973,6 +973,13 @@ >> $self->server->version_of(\%servername_config)->(@_); >> } >> >>+my $vhost_listeners = 0; >>+sub vhost_listeners { >>+ my($self, $increment) = @_; >>+ $vhost_listeners++ if $increment; >>+ $vhost_listeners; >>+} >>+ >> sub parse_vhost { >> my($self, $line) = @_; >> >>@@ -1019,6 +1026,8 @@ >> #extra config that should go *outside* the <VirtualHost ...> >> @out_config = ([Listen => $vars->{servername} . ':' . $port]); >> >>+ $self->vhost_listeners(1); >>+ >> if ($self->{vhosts}->{$module}->{namebased}) { >> push @out_config => [NameVirtualHost => "*:$port"]; >> } >>@@ -1395,6 +1404,20 @@ >> >> $self->postamble_run($out); >> >>+ # Apache2 (< 2.0.50) winnt mpm requires at least as many threads >>+ # as the number of listeners, which we don't know until all config >>+ # hooks were called, so only at this point we can write >>ThreadsPerChild >>+ if ($self->server->{rev} == 2 && $self->{mpm} eq 'winnt') { >>+ my $threads = $self->{vars}->{maxclients} + >>$self->vhost_listeners(); >>+ print $out <<EOI; >>+<IfModule mpm_winnt.c> >>+ ThreadsPerChild $threads >>+ MaxRequestsPerChild 0 >>+</IfModule> >>+ >>+EOI >>+ } >>+ >> print $out join "\n", @very_last_postamble; >> >> close $in; >>@@ -1840,10 +1863,7 @@ >> MaxRequestsPerChild 0 >> </IfDefine> >> >>-<IfModule mpm_winnt.c> >>- ThreadsPerChild 20 >>- MaxRequestsPerChild 0 >>-</IfModule> >>+ >> >> <Location /server-info> >> SetHandler server-info >>Index: lib/Apache/TestConfigPerl.pm >>=================================================================== >>RCS file: >>/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfigPerl.pm,v >> >>retrieving revision 1.84 >>diff -u -r1.84 TestConfigPerl.pm >>--- lib/Apache/TestConfigPerl.pm 4 Mar 2004 05:51:31 -0000 1.84 >>+++ lib/Apache/TestConfigPerl.pm 10 Mar 2004 18:57:07 -0000 >>@@ -222,6 +222,7 @@ >> my($self, $module, $args) = @_; >> my $port = $self->new_vhost($module); >> my $vars = $self->{vars}; >>+ $self->vhost_listeners(1); >> $self->postamble(Listen => $vars->{servername} . ':' . $port); >> } >> ------------------------------------------------ Radan Computational Ltd. The information contained in this message and any files transmitted with it are confidential and intended for the addressee(s) only. If you have received this message in error or there are any problems, please notify the sender immediately. The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden. Note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Radan Computational Ltd. The recipient(s) of this message should check it and any attached files for viruses: Radan Computational will accept no liability for any damage caused by any virus transmitted by this email. -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html