[Mongrel] Mongrel using way more memory on production than staging. Any ideas why?

Chris T ctmailinglists at googlemail.com
Tue Oct 2 05:08:42 EDT 2007

I've been trying to track down the culprit of erratic behaviour and 
crashes on my production server (which is split into a number of Xen 
instances), so set up a staging server so that I could really try to get 
to the bottom of it.

The staging server (also split with Xen) is set up pretty much 
identically as far as the mongrel_cluster server is concerned (the 
production box has two servers/instances for mongrel_cluster each with 4 
mongrels per cluster vs one server on the staging box with 2 mongrels 
per cluster -- otherwise they are the same: both Debian Etch, same gems, 
same Ruby - 1.8.5, same mongrel versions - 1.0.1, same mongrel_cluster - 
1.0.2). Oh, and the data on the staging one is a clone of the production 

On the production box, pretty much immediately (and I'm talking about 
within one or two requests), the mongrels climb up to about 150-160MB. 
One the staging server, even when I'm hammering it with a benchmarking 
suite (have tried with httperf, and bench and crawl) the mongrels sit 
comfortably at about 60MB each.

Here's some stats from top:

Production server:

top - 08:38:43 up 22 days, 13:21,  1 user,  load average: 0.24, 0.23, 0.15
Tasks:  33 total,   3 running,  30 sleeping,   0 stopped,   0 zombie
Cpu(s): 16.6%us, 24.5%sy,  0.0%ni, 51.0%id,  0.0%wa,  0.0%hi,  3.6%si,  
Mem:    524288k total,   384528k used,   139760k free,     1576k buffers
Swap:   262136k total,     1352k used,   260784k free,    19644k cached

and from ps aux

USER       PID     %CPU %MEM        VSZ           RSS     TTY    STAT 
mongrel       20387  2.6         18.5         148780     97228      
?           Sl       08:36       0:11     /usr/bin/ruby1.8 
mongrel       20390  2.8         19.4         153396     101940    
?           Sl       08:36       0:13     /usr/bin/ruby1.8 
mongrel       20393  4.1         19.6         154356     102936    
?           Sl       08:36       0:18     /usr/bin/ruby1.8 
mongrel       20396  4.7         18.8         150124     98576      
?           Rl       08:36       0:21     /usr/bin/ruby1.8 

And here's the corresponding staging server ones:

top - 10:00:55 up 15:22,  1 user,  load average: 0.00, 0.01, 0.15
Tasks:  29 total,   2 running,  27 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.0%us,  0.0%sy,  0.0%ni, 99.0%id,  0.0%wa,  0.0%hi,  0.0%si,  
Mem:    262336k total,   203064k used,    59272k free,     1156k buffers
Swap:   262136k total,        4k used,   262132k free,    58636k cached

USER           PID     %CPU %MEM    VSZ           RSS     TTY    STAT 
mongrel        3617      7.2     16.8          58808         44296     
?        Sl       09:28       2:28 /usr/bin/ruby1.8 /usr/bin/mongrel_rail
mongrel        3620      7.1     16.7          58424         43912     
?        Sl       09:28       2:26 /usr/bin/ruby1.8 /usr/bin/mongrel_rail

Anybody got any suggestions, or at least thoughts on tracking down the 


Autopendium :: Stuff about old cars 

More information about the Mongrel-users mailing list