I had a quick look at the internals. The most difficult problem is maintaining a counter between apache threads that can survive a graceful restart.
I did not find an immediate solution for storing a counter, perhaps Apache API provides some way, I am not sure. Counting /proc is, as mentioned, not very smart. Aki Tuomi On Mon, Oct 28, 2013 at 12:13:38PM +0100, Celelibi wrote: > Well, the number of hard links for /proc is the number of directory it > contains, +1. Then it is proportional to the number of process in the > system. > > I don't think it's the total number of process he wants to limit, but > the number of php processes. For a suPHP process that would make more > sens. > > This can be counted by suphp itself as it fork() and wait(). Unless > it's apache that fork()? I don't really know how php and apache > interacts. > > Moreover, I would suggest to add a timeout before returning an error. > Because most of the time, a page need less than 0.1 second to run. So, > waiting a few seconds may be more than enough for another process to > finish. > > 2013/10/28, Webmaster@askapache <[email protected]>: > > I did recently find out a super cheap method of getting the currently > > running # of procs by doing a stat on the /proc directory.. The hard links > > is the # of procs. > > > >> On Oct 27, 2013, at 8:03 PM, "Webmaster@askapache" > >> <[email protected]> wrote: > >> > >> Well I for one would love that feature. > >> > >>> On Oct 27, 2013, at 6:57 PM, Lance <[email protected]> wrote: > >>> > >>> I hope someone can help me with this. I've been trying to add two new > >>> options to mod_suphp, basically suPHP_NProc and suPHP_NProc_Error I'm > >>> just not good enough with C to get it all working correctly. > >>> > >>> I was wanting suPHP_NProc to set the maximum number of permitted PHP > >>> processes. (I know Apache has RLimitNProc, but I was just looking to add > >>> something that is suPHP specific.) > >>> > >>> The other option suPHP_NProc_Error I was wanting to add to let you > >>> override the error code that is returned when the process limit is > >>> reached instead of returning a generic 500 error code (Internal Server > >>> Error). > >>> > >>> Any help with this would be appreciated. > >>> _______________________________________________ > >>> suPHP mailing list > >>> [email protected] > >>> https://lists.marsching.com/mailman/listinfo/suphp > > > > _______________________________________________ > > suPHP mailing list > > [email protected] > > https://lists.marsching.com/mailman/listinfo/suphp > > > > _______________________________________________ > suPHP mailing list > [email protected] > https://lists.marsching.com/mailman/listinfo/suphp >
signature.asc
Description: Digital signature
_______________________________________________ suPHP mailing list [email protected] https://lists.marsching.com/mailman/listinfo/suphp
