So i’ve just set up my slice on slicehost.com. It’s a 256mb slice so i’ve started to keep an eye on how much memory i’m using. Seems i had like 10 fcgi processes running with PHP, one that pulled 15% of memory, one that pulled like 7% and the rest pulling about 2% each. So this was a huge leak i thought. I only have 2 sites running on PHP so it seemed useless to have that many processes available for the sites. To limit this and reduce memory usage i changed this in my lighttpd config.

` "max-procs" => 1, "bin-environment" => ( "PHP_FCGI_CHILDREN" => "3", ) `

This helped alot! It seems that lighttpd starts one process for each max-proc and 3 childrenprocesses for each max-proc. So this code results in 4 fcgi processes wich is more reasonable. I checked my sites to see if they slowed down but honestly, it just felt like they were faster. At the very least there was no difference. Once I surfed around the sites a bit the processes started pulling memory and came up to about 15% usage on one and 7% usage on the other again, but now i didn’t have 6 others pulling 2% each. This freed up around 10MB.

I now have a total of around 100-110MB free, that is, free incl. the cached memory. Which should be well and good and stand against most kinds of traffic i believe. My other 2 memory gobblers are mongrel_cluster which is pulling around 20% and MySQL which is pulling 14%. Postfix and Lighttpd are pulling just above 1% together so they are clearly not much more optimizable. I am a bit worried that mongrel is pulling 20% though. Of course most of the memory these processes use is cached, but it’s still pretty much. Anyone that can give me tips on how to further lower memory usage?


tetris