You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by William Taylor <wi...@corp.sonic.net> on 2012/03/12 20:39:42 UTC

[users@httpd] apache 2.2 can't keep up with apache 1.3

Previously posted to dev and bugs. Posting here also in hopes of
capturing a greater audience that might have come
across this issue before.

We have written a modules for apache that for certain reasons requires
one hit per child.
On apache 1.3 this worked fine with a minor tweak to
SCOREBOARD_MAINTENANCE_INTERVAL
setting it to 10000 from 1000000.

Note that this behavior can be tested without our module by setting
"MaxRequestsPerChild 1"

We have been running apache 1.3.41 with:
MinSpareServers 500
MaxSpareServers 600
StartServers 550

Using JMeter to send some requests if we request a single page using 3
threads, apache has no problem keeping up and
doesn't dip below 485 idle servers. With debug logging on you see it
jumping from spawning 8 to 16 to 32 children. We didn't
need to increase the MAX_SPAWN_RATE from the default of 32 for apache to
keep up just fine.

Output from apachectl status
   197 requests/sec - 28.6 kB/second - 148 B/request
   5 requests currently being processed, 492 idle servers
________________________________________________________________
__________________________.___._________________________________
________________________________._____________________________..
__.___._.W_WW..WW_______________________________________________
__________..__________________._..______________________________
________________________________________________________________
________________________________________________________________
____________________________________....._..._.___________..__..
........._________.____.........................................


Recently we decided we should update our module for apache 2.2 . However
we found the performance of apache 2.2 was falling short
compared to apache 1.3.

Running apache 2.2.22 with the same number of servers falls down pretty
quickly with the same load from JMeter.
Within a few seconds it drops down to 0 idle connections. In the
error_log you see apache constantly saying it's spawning
32 children but the number of children are really low.  Example log
entry "spawning 32 children, there are 2 idle, and 9 total children"
Occasionally it will start catching up but quickly drop back down.
Example log entry "spawning 32 children, there are 169 idle, and 180
total child"

apachectl status:
   27.8 requests/sec - 7.0 kB/second - 256 B/request
   13 requests currently being processed, 0 idle workers
 CCCWCWRSSS............................CCCCCC....................
 ................................................................


apachectl status when it starts catching back up:
  161 requests/sec - 11.4 kB/second - 72 B/request
   4 requests currently being processed, 477 idle workers
 ___________C____WR____________________._________________________
 ________________________________________________________________
 ________.______.._......_...C___________________________________


I have tried upping the MAX_SPAWN_RATE to 512 and starting off the
idle_spawn_rate at 128 and never letting
it fall below that. It seemed like things got marginally better but not
by much. I realize most people would think
we are crazy for running one hit per child but it's just something we
need to do. This has all been tested on the
same hardware also. I tried stracing and running gprof but nothing
seemed obvious. My best guess at this point
is apache is taking to long to close connections or there is some other
sleeps or something that I'm not seeing.

Any thoughts on what could be the issue would be most appreciated.




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] apache 2.2 can't keep up with apache 1.3

Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
On 3/13/2012 12:25 PM, Tom Evans wrote:
> On Tue, Mar 13, 2012 at 5:19 PM, William Taylor <wi...@corp.sonic.net> wrote:
>> I wouldn't say it's silly, but definitely not the norm and obviously a
>> low priority
>> for everyone else.
> 
> I would say that forking an entire new process to handle a single
> request and then exiting could possibly be the most silly way to serve
> http.

It was.  This was 'well' supported in httpd 1.3 and prior.  Now httpd really
only supports operating as a process/daemon, not in inetd mode which is
effectively what's described.  What is most important if you want to emulate
foolish 1.3 patterns is to compile-in all the modules you need (and no more
than you need) as well as run strictly in prefork mode.  Worker model is
entirely orthogonal to single process per request invocation.  Or put another
way, you want to know why the new set of tires isn't propelling the boat
any faster.  There are some choices you have control over but you are going
to end up spending your time tuning for such a case.

If this were a comparison between 2.0 / 2.2 / 2.4 and there were measurable
differences in performance (within the same MPM) then that would raise
some eyebrows.  But your use case is so odd I'm sure nobody really zeroed
in on solving it for you.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] apache 2.2 can't keep up with apache 1.3

Posted by Jim Jagielski <ji...@jaguNET.com>.
On Mar 13, 2012, at 1:40 PM, William Taylor wrote:
> It's unfortunate that it has to work this way but forks are pretty cheap
> these days.
> 
> No it doesn't generate content. It can't run as a CGI.

Cheap != free no matter how cheap ;)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] apache 2.2 can't keep up with apache 1.3

Posted by William Taylor <wi...@corp.sonic.net>.
On Tuesday, March 13, 2012 10:25:54 AM, Tom Evans wrote:
>
> On Tue, Mar 13, 2012 at 5:19 PM, William Taylor
> <wi...@corp.sonic.net> wrote:
>>
>> I wouldn't say it's silly, but definitely not the norm and obviously a
>> low priority
>> for everyone else.
>
>
> I would say that forking an entire new process to handle a single
> request and then exiting could possibly be the most silly way to serve
> http.
>
> I also understand that sometimes we have to do things that are silly.
>
> Is your module mainly a content generator? Could your module run as a CGI?
>
It's unfortunate that it has to work this way but forks are pretty cheap
these days.

No it doesn't generate content. It can't run as a CGI.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] apache 2.2 can't keep up with apache 1.3

Posted by Jim Jagielski <ji...@jaguNET.com>.
On Mar 13, 2012, at 1:25 PM, Tom Evans wrote:

> On Tue, Mar 13, 2012 at 5:19 PM, William Taylor <wi...@corp.sonic.net> wrote:
>> I wouldn't say it's silly, but definitely not the norm and obviously a
>> low priority
>> for everyone else.
> 
> I would say that forking an entire new process to handle a single
> request and then exiting could possibly be the most silly way to serve
> http.
> 

Ahhhh... ServerType inetd

memories :)


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] apache 2.2 can't keep up with apache 1.3

Posted by Tom Evans <te...@googlemail.com>.
On Tue, Mar 13, 2012 at 5:19 PM, William Taylor <wi...@corp.sonic.net> wrote:
> I wouldn't say it's silly, but definitely not the norm and obviously a
> low priority
> for everyone else.

I would say that forking an entire new process to handle a single
request and then exiting could possibly be the most silly way to serve
http.

I also understand that sometimes we have to do things that are silly.

Is your module mainly a content generator? Could your module run as a CGI?

Cheers

Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] apache 2.2 can't keep up with apache 1.3

Posted by William Taylor <wi...@corp.sonic.net>.
On Tuesday, March 13, 2012 10:11:17 AM, Tom Evans wrote:
>
> On Tue, Mar 13, 2012 at 4:58 PM, William Taylor
> <wi...@corp.sonic.net> wrote:
>>
>> On Tuesday, March 13, 2012 2:42:35 AM, Tom Evans wrote:
>>>
>>>
>>> On Mon, Mar 12, 2012 at 7:39 PM, William Taylor
>>> <wi...@corp.sonic.net> wrote:
>>>>
>>>>
>>>> Previously posted to dev and bugs. Posting here also in hopes of
>>>> capturing a greater audience that might have come
>>>> across this issue before.
>>>>
>>>> We have written a modules for apache that for certain reasons requires
>>>> one hit per child.
>>>> On apache 1.3 this worked fine with a minor tweak to
>>>> SCOREBOARD_MAINTENANCE_INTERVAL
>>>> setting it to 10000 from 1000000.
>>>>
>>>> Note that this behavior can be tested without our module by setting
>>>> "MaxRequestsPerChild 1"
>>>>
>>>
>>>
>>>
>>> This will get you pathologically bad performance. You may have very
>>> important reasons for doing this, but it goes completely against how
>>> Apache wants to work.
>>>
>>> Nevertheless, if you can identify the regression, that would also be
>>> good!
>>>
>>
>>
>> I'm not questioning the decrease in performance. I'm well aware of that
>> fact. :)
>> But I think apache 2.2.x should be able to perform as well as apache
>> 1.3.x in the
>> same scenario.
>>
>
>
> Indeed. But for the project, running in a silly way and saying "it's
> slow" isn't going to make this a particularly high priority for
> someone *who isn't you* to investigate. The old joke:

I wouldn't say it's silly, but definitely not the norm and obviously a
low priority
for everyone else.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] apache 2.2 can't keep up with apache 1.3

Posted by Tom Evans <te...@googlemail.com>.
On Tue, Mar 13, 2012 at 4:58 PM, William Taylor <wi...@corp.sonic.net> wrote:
> On Tuesday, March 13, 2012 2:42:35 AM, Tom Evans wrote:
>>
>> On Mon, Mar 12, 2012 at 7:39 PM, William Taylor
>> <wi...@corp.sonic.net> wrote:
>>>
>>> Previously posted to dev and bugs. Posting here also in hopes of
>>> capturing a greater audience that might have come
>>> across this issue before.
>>>
>>> We have written a modules for apache that for certain reasons requires
>>> one hit per child.
>>> On apache 1.3 this worked fine with a minor tweak to
>>> SCOREBOARD_MAINTENANCE_INTERVAL
>>> setting it to 10000 from 1000000.
>>>
>>> Note that this behavior can be tested without our module by setting
>>> "MaxRequestsPerChild 1"
>>>
>>
>>
>> This will get you pathologically bad performance. You may have very
>> important reasons for doing this, but it goes completely against how
>> Apache wants to work.
>>
>> Nevertheless, if you can identify the regression, that would also be good!
>>
>
> I'm not questioning the decrease in performance. I'm well aware of that
> fact. :)
> But I think apache 2.2.x should be able to perform as well as apache
> 1.3.x in the
> same scenario.
>

Indeed. But for the project, running in a silly way and saying "it's
slow" isn't going to make this a particularly high priority for
someone *who isn't you* to investigate. The old joke:

"Doctor, doctor, it hurts when I shake my arm up and down at a funny angle"
"Well then, don't do that!"

Cheers

Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] apache 2.2 can't keep up with apache 1.3

Posted by William Taylor <wi...@corp.sonic.net>.
On Tuesday, March 13, 2012 2:42:35 AM, Tom Evans wrote:
>
> On Mon, Mar 12, 2012 at 7:39 PM, William Taylor
> <wi...@corp.sonic.net> wrote:
>>
>> Previously posted to dev and bugs. Posting here also in hopes of
>> capturing a greater audience that might have come
>> across this issue before.
>>
>> We have written a modules for apache that for certain reasons requires
>> one hit per child.
>> On apache 1.3 this worked fine with a minor tweak to
>> SCOREBOARD_MAINTENANCE_INTERVAL
>> setting it to 10000 from 1000000.
>>
>> Note that this behavior can be tested without our module by setting
>> "MaxRequestsPerChild 1"
>>
>
>
> This will get you pathologically bad performance. You may have very
> important reasons for doing this, but it goes completely against how
> Apache wants to work.
>
> Nevertheless, if you can identify the regression, that would also be good!
>

I'm not questioning the decrease in performance. I'm well aware of that
fact. :)
But I think apache 2.2.x should be able to perform as well as apache
1.3.x in the
same scenario.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] apache 2.2 can't keep up with apache 1.3

Posted by Tom Evans <te...@googlemail.com>.
On Mon, Mar 12, 2012 at 7:39 PM, William Taylor <wi...@corp.sonic.net> wrote:
> Previously posted to dev and bugs. Posting here also in hopes of
> capturing a greater audience that might have come
> across this issue before.
>
> We have written a modules for apache that for certain reasons requires
> one hit per child.
> On apache 1.3 this worked fine with a minor tweak to
> SCOREBOARD_MAINTENANCE_INTERVAL
> setting it to 10000 from 1000000.
>
> Note that this behavior can be tested without our module by setting
> "MaxRequestsPerChild 1"
>

This will get you pathologically bad performance. You may have very
important reasons for doing this, but it goes completely against how
Apache wants to work.

Nevertheless, if you can identify the regression, that would also be good!

Cheers

Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org