Current time: 11-25-2024, 03:41 PM Hello There, Guest! (LoginRegister)


Post Reply 
memory consumption of php5+fastcgi
Author Message
ispcomm Offline
Junior Member
*

Posts: 93
Joined: Apr 2008
Reputation: 3
Post: #5
RE: memory consumption of php5+fastcgi
Quemeros Wrote: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?
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
vu2000    5717  0.0  2.2  19440  5956 ?        Ss   May04   0:00 /usr/bin/php5-cgi
vu2000    5778  0.0  2.3  19676  6180 ?        S    May04   0:15 /usr/bin/php5-cgi
vu2000    5779  0.0  2.3  19640  6052 ?        S    May04   0:14 /usr/bin/php5-cgi
vu2001   28731  0.0  2.2  19436  5948 ?        Ss   07:57   0:00 /usr/bin/php5-cgi
vu2001   28732  0.0  1.3  19436  3428 ?        S    07:57   0:00 /usr/bin/php5-cgi
vu2001   28733  0.0  0.8  19436  2252 ?        S    07:57   0:00 /usr/bin/php5-cgi
root     19599  0.0  0.1   1652   508 ttyp0    R+   21:10   0:00 grep php5
VSZ=virtual size in KB, RSS=physical non-swapped size in memory, in KB. That is 3x19MB per site virtual size of which 6-19MB in memory (not swapped to disk) in this particular case. There's a hit from the odd robot/spammer on the site every few minutes, so a site is never really "idle".

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
root     24296  0.0  1.3  10372  3572 ?        Ss   May04   0:00 /usr/sbin/apache2 -k start
www-data  5715  0.0  0.8  10372  2276 ?        S    May04   0:00 /usr/sbin/apache2 -k start
www-data  5718  0.0  1.7 232372  4508 ?        Sl   May04   0:00 /usr/sbin/apache2 -k start
www-data  5720  0.0  1.7 232384  4512 ?        Sl   May04   0:00 /usr/sbin/apache2 -k start
root     19615  0.0  0.1   1656   508 ttyp0    R+   21:14   0:00 grep apache

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.
(This post was last modified: 05-06-2008 07:33 AM by ispcomm.)
05-06-2008 07:31 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
RE: memory consumption of php5+fastcgi - ispcomm - 05-06-2008 07:31 AM

Forum Jump:


User(s) browsing this thread: 2 Guest(s)