How to effectively have less php-cgi processes running?
- by João Pinto Jerónimo
My server is a Linode 512, and on it I run a Wordpress MU with 3 websites (they don't get a lot of visitors) and a couple of NodeJS apps.
I need to switch to Lighttpd because Apache 2 was using about 59% of the server's RAM, and now I have the php-cgi processes taking up about 43.6% of the server's RAM:
most often 2 processes use 16.5% of the RAM each, 
4 processes use 1.8% of the RAM each, and 
4 more processes use 0,8% of the RAM, each
How can I have less of these processes ? I'm almost sure they're not all needed for the trafic this server gets...
I tried only allowing 2 children, but I still have those 10... This is my fastcgi.server section in lighttpd.conf.
fastcgi.server = ( ".php" =>
                    ( "localhost" =>
                      (
                        "socket" => "/var/run/lighttpd/php-fastcgi.socket",
                        "bin-path" => "/usr/bin/php-cgi",
                        "bin-environment" => (
                          "PHP_FCGI_CHILDREN" => "2",
                          "PHP_FCGI_MAX_REQUESTS" => "4000"
                         )
                      )
                    )
                  )
What else can I do to tune lighttpd to use less RAM ?