Bug 59656 - PATCH: mod_fcgid: Immediate HTTP error 503 if the max total process count is reached
Summary: PATCH: mod_fcgid: Immediate HTTP error 503 if the max total process count is ...
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_fcgid (show other bugs)
Version: 2.4.20
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL: https://github.com/famzah/mod_fcgid/c...
Keywords: PatchAvailable
Depends on:
Reported: 2016-06-02 08:53 UTC by Ivan Zahariev (famzah)
Modified: 2016-09-19 08:31 UTC (History)
1 user (show)


Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Zahariev (famzah) 2016-06-02 08:53:35 UTC
Hi all,

I'd like to propose a new configuration setting for "mod_fcgid". The source code changes to review follow:
- The whole patch compared to version 2.3.9: https://github.com/famzah/mod_fcgid/compare/2.3.9...maxnowait?diff=split&name=maxnowait
- The whole patch as a single file: https://github.com/famzah/mod_fcgid/compare/2.3.9...maxnowait.patch?diff=unified&name=maxnowait
- Every single commit compared to version 2.3.9: https://github.com/famzah/mod_fcgid/commits/maxnowait
- There should be no merge conflicts with the current "trunk" version 2.3.10.

The motivation is that the current behavior to queue up new pending requests differs from the RLimitNPROC directive behavior. When there is a spike in the web hits, lots of Apache children get busy just waiting for up to 30+ seconds to get an idle FastCGI process. Thus we "waste" Apache children doing nothing while they could serve static content. This also puts unneeded memory pressure. Additionally, users today won't wait for a page to load, if it takes more than a few seconds, and we'd rather notify them that we are currently overloaded by sending them a 503 HTTP response immediately.

Here is the documentation for the new directive: http://www.famzah.net/temp/FcgidMaxProcessesUsedNoWait.docs.txt

Let me know what you think.

Best regards.
Comment 1 Ivan Zahariev (famzah) 2016-09-19 08:31:01 UTC
It's been four months since I originally proposed this new feature in "mod_fcgid". During this time I've tested and deployed it on hundreds of busy production servers. It works as expected. If enabled, web visitors get an immediate response when FastCGI is overloaded, and no RAM is over-utilized.