Re: mod_fcgid ignoring both scores and process count

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

 



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 :) )

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):

[Sun Nov 21 10:17:53 2010] [info] Server built: Nov 11 2010 13:37:51
[Sun Nov 21 10:17:53 2010] [debug] prefork.c(1018): AcceptMutex:
sysvsem (default: sysvsem)
[Sun Nov 21 10:18:03 2010] [info] mod_fcgid: server
127.0.1.1:/home/trawick/myhg/apache/fcgid/apps/info.pl(10258) started
[Sun Nov 21 10:18:04 2010] [info] mod_fcgid: server
127.0.1.1:/home/trawick/myhg/apache/fcgid/apps/info.pl(10260) started
[Sun Nov 21 10:18:04 2010] [info] mod_fcgid: server
127.0.1.1:/home/trawick/myhg/apache/fcgid/apps/info.pl(10261) started
[Sun Nov 21 10:18:04 2010] [info] mod_fcgid:
/home/trawick/myhg/apache/fcgid/apps/info.pl spawn score 29 >= 25,
skip the spawn request
[Sun Nov 21 10:18:06 2010] [info] mod_fcgid:
/home/trawick/myhg/apache/fcgid/apps/info.pl spawn score 27 >= 25,
skip the spawn request
[Sun Nov 21 10:18:06 2010] [info] mod_fcgid:
/home/trawick/myhg/apache/fcgid/apps/info.pl spawn score 27 >= 25,
skip the spawn request
[Sun Nov 21 10:18:06 2010] [info] mod_fcgid:
/home/trawick/myhg/apache/fcgid/apps/info.pl spawn score 27 >= 25,
skip the spawn request
[Sun Nov 21 10:18:07 2010] [info] mod_fcgid:
/home/trawick/myhg/apache/fcgid/apps/info.pl spawn score 26 >= 25,
skip the spawn request
[Sun Nov 21 10:18:07 2010] [info] mod_fcgid:
/home/trawick/myhg/apache/fcgid/apps/info.pl spawn score 26 >= 25,
skip the spawn request
[Sun Nov 21 10:18:07 2010] [info] mod_fcgid:
/home/trawick/myhg/apache/fcgid/apps/info.pl spawn score 26 >= 25,
skip the spawn request
[Sun Nov 21 10:18:07 2010] [info] mod_fcgid:
/home/trawick/myhg/apache/fcgid/apps/info.pl spawn score 26 >= 25,
skip the spawn request
[Sun Nov 21 10:18:07 2010] [info] mod_fcgid:
/home/trawick/myhg/apache/fcgid/apps/info.pl spawn score 26 >= 25,
skip the spawn request
[Sun Nov 21 10:18:08 2010] [info] mod_fcgid:
/home/trawick/myhg/apache/fcgid/apps/info.pl spawn score 25 >= 25,
skip the spawn request
[Sun Nov 21 10:18:08 2010] [info] mod_fcgid:
/home/trawick/myhg/apache/fcgid/apps/info.pl spawn score 25 >= 25,
skip the spawn request
[Sun Nov 21 10:18:08 2010] [info] mod_fcgid:
/home/trawick/myhg/apache/fcgid/apps/info.pl spawn score 25 >= 25,
skip the spawn request
[Sun Nov 21 10:18:08 2010] [info] mod_fcgid:
/home/trawick/myhg/apache/fcgid/apps/info.pl spawn score 25 >= 25,
skip the spawn request
[Sun Nov 21 10:18:09 2010] [info] mod_fcgid: server
127.0.1.1:/home/trawick/myhg/apache/fcgid/apps/info.pl(10356) started
[Sun Nov 21 10:18:09 2010] [info] mod_fcgid:
/home/trawick/myhg/apache/fcgid/apps/info.pl spawn score 34 >= 25,
skip the spawn request

That looks good to me.

> 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.

---------------------------------------------------------------------
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