Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: mod_fcgid doesn't honor IdleTimeout, MaxRequestsPerProcess |
|
Author |
|
project10
Joined: 04 Jul 2008 Posts: 2
|
Posted: Fri 04 Jul '08 23:25 Post subject: mod_fcgid doesn't honor IdleTimeout, MaxRequestsPerProcess |
|
|
I am using the following versions of Apache and mod_fgid:
- Apache 2.2.4, apachelounge version
- mod_fcgid 2.2, the version "2.2a" currently available on the download page
The problem I am having is that, though my FastCGI configuration seems to work properly otherwise, the following mod_fcgid directives never have any effect:
- IdleTimeout
- MaxRequestsPerProcess
- ProcessLifeTime
The FastCGI'd processes (php, in this case) continue to live until they are killed or segfault. Excess processes are never culled by mod_fcgid, nor can I control the IdleTimeout (which is my ultimate goal).
Does anyone have any idea what might be the cause of this? I have tried moving the directives to various places in my configuration file, using FCGIWrapper, etc, but nothing I do impacts when my fastcgi'd processes are killed.
Here are the relevant bits from my httpd.conf:
Code: |
LoadModule fcgid_module modules/mod_fcgid.so
NameVirtualHost *
<VirtualHost *>
ServerName name
Alias /dir/ "C:/path/to/htdocs/"
<Directory "C:/path/to/cgi-bin/">
AllowOverride All
Options ExecCGI FollowSymLinks
Order allow,deny
Allow from all
SetHandler fcgid-script
</Directory>
<Directory "C:/path/to/htdocs">
DirectoryIndex index.php
AllowOverride All
Options Indexes FollowSymLinks Multiviews ExecCGI
Order allow,deny
Allow from all
</Directory>
<IfModule mod_fcgid.c>
IPCCommTimeout 40
IPCConnectTimeout 10
OutputBufferSize 64
# These directives seem to have no effect
ProcessLifeTime 30
MaxRequestsPerProcess 5
IdleTimeout 5
IdleScanInterval 1
BusyTimeout 60
BusyScanInterval 1
PHP_Fix_Pathinfo_Enable 1
DefaultInitEnv PATH "C:/path/to/cgi-bin;C:/path/to/php/ext;C:\WINDOWS/system32;C:\WINDOWS;C:\WINDOWS/System32/Wbem;"
DefaultInitEnv SystemRoot "C:\WINDOWS"
DefaultInitEnv SystemDrive "C:"
DefaultInitEnv TEMP "C:\WINDOWS\Temp"
DefaultInitEnv PHPRC "c:/path/to/cgi-bin"
</IfModule>
</VirtualHost>
|
|
|
Back to top |
|
project10
Joined: 04 Jul 2008 Posts: 2
|
Posted: Wed 09 Jul '08 18:12 Post subject: |
|
|
I found my problem: I needed to set DefaultMinClassProcessCount to 0, to allow mod_fcgid to kill all processes if they were idle, which is what I wanted. |
|
Back to top |
|
PipoDeClown
Joined: 20 Dec 2005 Posts: 77
|
Posted: Thu 10 Jul '08 8:49 Post subject: |
|
|
thank you for this solution, bookmarked |
|
Back to top |
|
Kanashii
Joined: 17 Jul 2006 Posts: 155 Location: Porando
|
Posted: Tue 07 Sep '10 18:30 Post subject: |
|
|
How to fix MaxRequestsPerProcess , FcgidMaxRequestsPerProcess 500 limit
its easy
FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 100000
Then process will be kill when reach to 100000
[ab.exe - ab.exe -n 1000000 -c 550 http://127.0.0.3/ ]
Concurrency Level: 550
Time taken for tests: 1965.168 seconds
Complete requests: 1000000
Failed requests: 0
Write errors: 0
Total transferred: 11345000000 bytes
HTML transferred: 11073000000 bytes
Requests per second: 508.86 [#/sec] (mean)
Time per request: 1080.842 [ms] (mean)
Time per request: 1.965 [ms] (mean, across all concurrent requests)
Transfer rate: 5637.74 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 1.6 0 47
Processing: 0 1080 2046.9 62 55021
Waiting: 0 1077 2046.8 62 55021
Total: 0 1080 2046.9 62 55021
Percentage of the requests served within a certain time (ms)
50% 62
66% 1061
75% 1076
80% 2059
90% 3104
95% 5101
98% 7207
99% 9360
100% 55021 (longest request)
[PHP Wincache]
Opcode Cache Overview
Cache scope global
Cache uptime 35 minutes 17 seconds
Cached files 15
Hits 5541518
Misses 20
Total memory 15 MB
Available memory 14.3 MB
Memory overhead 14.03 kB
Number of functions 22
Number of classes 1
[Server status]
Server Version: Apache/2.2.16 (Win32) mod_fcgid/2.3.5
Server Built: Jul 25 2010 13:06:46
Current Time: Tuesday, 07-Sep-2010 18:19:52 Œrodkowoeuropejski czas letni
Restart Time: Tuesday, 07-Sep-2010 17:46:50 Œrodkowoeuropejski czas letni
Parent Server Generation: 0
Server uptime: 33 minutes 2 seconds
Total accesses: 1000017 - Total Traffic: 10.3 GB
505 requests/sec - 5.3 MB/second - 10.8 kB/request
1 requests currently being processed, 1699 idle workers
mod_fcgid status:
Total FastCGI processes: 15
Process name: php-cgi.exe
Pid Active Idle Accesses State
11720 1974 9 60968 Ready
7824 1973 9 64397 Ready
7780 1974 9 65211 Ready
7808 1974 9 65609 Ready
9752 1973 9 70923 Ready
14804 1975 9 71478 Ready
9276 1975 9 60785 Ready
14460 1974 9 61916 Ready
772 1975 9 67274 Ready
5392 1973 9 68303 Ready
7940 1973 10 61904 Ready
6784 1974 10 68417 Ready
1688 1974 10 72174 Ready
1668 1973 10 68166 Ready
2424 1973 10 72486 Ready |
|
Back to top |
|
|
|
|
|
|