This means that you can now be a lot more confident on the memory usage you estimate when you set maxclients.
(On Linux/Apache, MaxClients is one of the main tunables, if you haven't heard of it before, search this forum for earlier discussions covering maxclients and memory usage).
Normally, you look at top, and estimate that your apache/php processes are going to use ~12MB at the most, and then you set your maxclients to roughly $memforapache / 12MB. But if a given page is a memory hog and eats 25 meg, then your apache processes will start overrunning the memory you planned to give apache.
And if there's a traffic spike, apache's memory footprint grows, eventually the working set doesn't fit in RAM, you hit swap, and your're toast.
So... with this setting, after moodle is done serving the page, and just as the PHP engine begins its cleanup, Moodle gets a chance to check if we used too much memory, and tag the child process for reaping. Which means that the memory will be freed up, at a small cost in cpu cycles.
I've given it a default of 10MiB. Should initially help people triggering cron via apache (ouch) and very memory-intensive pages, like grades reports generation.
And now you can be a bit more aggressive with your maxclients, and still safe from apache overrunning the memory you estimated it'd use.
Anyone up for adding this to the tuning strategies page and giving that page a cleanup? I'm a bit sad that no-one's written a good Apache/PHP tuning guide with all the good bits that are lying around this forum
Anyone up for adding this to the tuning strategies page and giving that page a cleanup?
Assuming that "tuning strategies page" refers to the Performance docs. I remember scouring this forum last time I made changes to the page, so I'm happy to do this (again). One question though: in what ways does the page need "cleaning-up"?
I was clearly thinking of the page as it was late last year, which was a bit of a mess. My bad!
Sadly, it appears as it is coded in Moodle at the moment this configuration option will only apply if you are running Moodle in Apache 1.x as it relied on the PHP function apache_child_terminate() which does not exist if you are running php as a module in Apache 2.