irvingpop/pfsense — pull request #1 by irvingpop (2012-05-10 18:07:59+00:00)
Title: max_procs adjustments for small memory systems, attempt 2

Per Jim P's feedback, move max_procs completely out of
system_webgui_start() and move all of the memory/procs decision logic
to system_generate_lighty_config().

Adjust the captive portal max_procs to reflect the low memory
conditions like ALIX which tends to run out of memory quickly due to
piggy PHP processes.

In real life testing, each PHP process (with APC) can consume up to
64MB RAM.

128MB ALIX systems show an available RAM of 107 MB.
256MB ALIX systems show an available RAM of 228 MB.

The logic here is that <128MB systems should never be running more than
1 PHP process, and <256MB systems should run 1 by default, or 2 if
captive portal is running.

Also give the top-end captive portal 1 more PHP process (6 now)
although I think very busy captive portals will probably need more.