Re: mod_fcgid ignoring both scores and process count

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 21.11.2010 16:57, Jeff Trawick wrote::
> 2010/11/21 Honza Lefty Škoda <lefty@xxxxxxxxxxxx>:
>> I am running performance benchmarks with ab2 on my server and I
>> discovered that fcgid creates much more than FcgidMaxProcessesPerClass.
>> And if I make 15 concurrent requests fcgi starts 15 php processes at the
>> same time without worrying about FcgidSpawnScoreUpLimit!
>>
>> I use mod_fcgid with suexec for php execution (via php-wrapper bash
>> script, which does a lot of magic including execs, chroot and setuid).
>>
>> The configuration (for fcgid 2.3.6 on apache 2.2.15):
>>
>> /etc/apache2/modules.d/20_mod_fcgid.conf:
>> 25: FcgidMinProcessesPerClass 0
>> 26: FcgidMaxProcessesPerClass 10
>>
>> 33: FcgidSpawnScore 10
>> 34: FcgidTerminationScore 20
>> 35: FcgidTimeScore 1
>> 36: FcgidSpawnScoreUpLimit 25
> 
> I did find/fix one related issue this a.m.:  the first process created
> didn't adjust the score, so you could in effect create one more
> process than desired during ramp-up.  I didn't see your exact issue
> though.
> 
> Two things:
> 
> Does your "magic" wrapper logic preserve the pid created by mod_fcgid
> (i.e., use exec instead of fork)?  If not, the fcgid PM will be
> confused and you're probably getting requests successfully processed
> between the time fcgid forks a child and when it exits.  (That
> probably isn't a workable explanation since an exiting child would add
> a huge number -- 20 -- to the score.  But please confirm anyway :) )
Yes, PID of php-cgi process matches the one in server-status worker list.

> 
> If you are preserving the pid (i.e., fcgid PM can track what it has
> created), turn on LogLevel info and see if you can get more insight
> into what is happening with spawn score manipulation/checking.  Here's
> what I get using the directives you posted and hammering on one script
> with ab (>100 current clients):

Good idea!
I tried to run the tests again with surprising results. Some
VirtualHosts break rules:

Sun Nov 21 16:57:33 2010] [info] mod_fcgid: server
*:/opt/hostik/webbin/php-wrapper.fcgi(11473) started
[Sun Nov 21 16:57:33 2010] [info] mod_fcgid: server
*:/opt/hostik/webbin/php-wrapper.fcgi(11474) started
[Sun Nov 21 16:57:33 2010] [info] mod_fcgid: server
*:/opt/hostik/webbin/php-wrapper.fcgi(11475) started
[Sun Nov 21 16:57:33 2010] [info] mod_fcgid: server
*:/opt/hostik/webbin/php-wrapper.fcgi(11476) started
[Sun Nov 21 16:57:33 2010] [info] mod_fcgid: server
*:/opt/hostik/webbin/php-wrapper.fcgi(11477) started
[Sun Nov 21 16:57:33 2010] [info] mod_fcgid: server
*:/opt/hostik/webbin/php-wrapper.fcgi(11479) started
[Sun Nov 21 16:57:33 2010] [info] mod_fcgid: server
*:/opt/hostik/webbin/php-wrapper.fcgi(11481) started
[Sun Nov 21 16:57:33 2010] [info] mod_fcgid: server
*:/opt/hostik/webbin/php-wrapper.fcgi(11482) started

and some does not:

[Sun Nov 21 17:08:10 2010] [info] mod_fcgid: server
*:/opt/hostik/webbin/php-wrapper.fcgi(15109) started
[Sun Nov 21 17:08:11 2010] [info] mod_fcgid:
/opt/hostik/webbin/php-wrapper.fcgi spawn score 39 >= 25, skip the spawn
request
[Sun Nov 21 17:08:12 2010] [info] mod_fcgid:
/opt/hostik/webbin/php-wrapper.fcgi spawn score 38 >= 25, skip the spawn
request

After several benchmarks I found out that it's caused by the
FcgidMinProcessesPerClass which is set to 1 for some vhosts. When I set
this, scores are completely ignored!

>> By the way - according to documentation, FcgidMinProcessesPerClass in
>> VirtualHost section shouldn't work. For me, it does (and I'm happy with
>> it :)).
> 
> Is this where you are looking?
> http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html#fcgidminprocessesperclass
> 
> If so, can you explain further what you mean, as I don't see any
> indication that it shouldn't work.
Sorry, I have probably read some older version. Now it makes sense :)
> 
> ---------------------------------------------------------------------
> 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@xxxxxxxxxxxxxxxx
>    "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
> 

---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux