memory consumption of php5+fastcgi - Printable Version +- ispCP - Board - Support (http://www.isp-control.net/forum) +-- Forum: ispCP Omega Development Area (/forum-1.html) +--- Forum: General discussion (/forum-11.html) +--- Thread: memory consumption of php5+fastcgi (/thread-3215.html) |
memory consumption of php5+fastcgi - ispcomm - 05-05-2008 07:31 PM I'm wondering what the memory requirements would be for a real server hosting domains with ispcp. Using fastcgi+php5 (debian etch, default install) each php5 process is using 5900KB of memory (that is... almost 6megabytes). Every site has 3 stand-by processes. Allocating 100 domains (as a minimum requirement per physical server) would mean that 100x3x6 = 1800MB or RAM would be needed just to host the idle processes for all domains. This is on a 32bit machine (64 bit could be double this numbers). If you add a few connections and the other daemons (primarily mysql) you'll end up with a minimum requirement of 4Gbytes that is too much IMHO. My fear is that adding other stuff to php would get this number higher (currently my php5 has only the gd, idn, mcrypt, mhash and mysql extentions). My question is: is there a way to reduce this number, other than reducing the number of idle processes that fastcgi spans ? RE: memory consumption of php5+fastcgi - Cube - 05-05-2008 11:11 PM I go this way to reduce memory usage by FastCGI: http://www.isp-control.net/documentation/howto/miscellaneous/run_ispcp_on_a_low_resources_system#fastcgi This was the default in older ispCP version. The disadvantage is that it may take longer to load a website after the last process has disappeared. RE: memory consumption of php5+fastcgi - ispcomm - 05-06-2008 01:01 AM Cube Wrote:I go this way to reduce memory usage by FastCGI:Thank you for the pointer. I think 1 process per idle website should be enough. I'll look at fastcgi and your pointer. ispcomm. RE: memory consumption of php5+fastcgi - Quemeros - 05-06-2008 05:17 AM In 1st post... the estimation it's correct?... 6mb per site in idle? Nobody have a server running with aprox. 50 sites in a 64bits OS, how ram are consuming? RE: memory consumption of php5+fastcgi - ispcomm - 05-06-2008 07:31 AM Quemeros Wrote:In 1st post... the estimation it's correct?... 6mb per site in idle?The numbers vary slightly (depending on dynamic allocation of php5) however they're correct (reported by top). Current figures (after 24hrs of real standby, which never occurs in real-world are: Code: USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND Good news is that part of the VSZ is shared between threads (text and other static stuff). But RSS is mainly thread-local (variables)... afaik. For reference here's the memory footprint of the apache process on the same server: Code: USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND Multiply RSS by the number of connections you want to handle at the same time (150-500). Add MySQL (384-512MB at least), antivirus (minimum 15 istances), pop3 (100 concurrent connections at least... or 1 account per domain), smtp (another 100 as send/receive is done at the same time) ... hey where did my 4GB go? Consider that these are worse-case figures. You can get by with 50% real memory and 50% swap file, but things slow down (and sum-up) when the server is busy swapping on the disks. ispcomm. RE: memory consumption of php5+fastcgi - ergo - 05-07-2008 04:52 PM i have 30 domains on my vps and memory usage is 350-400 mb - after the fastCGI change that cube mentioned. Its important to note that i have both mysql and postgresql there. and APC running, im not sure if apc stores the cache in memory ? |