[Mongrel] Memory Usage after upgrading to pre-release and removing sendfile

hemant gethemant at gmail.com
Fri Aug 4 23:42:07 EDT 2006


After the upgrade my memory usage is shown like this:

 PID USER       PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 4592 flipl     16   0  197m 150m 2360 S  0.0 14.9   6:17.28 mongrel_rails
 4585 mongrel   16   0  190m 140m 1756 S  0.0 13.9   0:52.86 mongrel_rails
 4579 mongrel   16   0  200m 157m 1752 S  0.0 15.5   0:56.31 mongrel_rails
 4582 mongrel   16   0  189m 139m 1752 S  0.0 13.8   1:05.89 mongrel_rails
 5427 foo       16   0  184m 139m 1732 S  0.0 13.8   3:30.28 mongrel_rails
 5092 blah      16   0  175m 138m 1720 S  0.0 13.7   0:44.70 mongrel_rails
 4365 flipl     15   0  8796 2060 1596 S  0.0  0.2   0:15.71 smbd
 4089 mysql     15   0  126m 5940 1568 S  0.0  0.6   7:26.58 mysqld
 3982 www-data  16   0 20752 2620 1552 S  0.0  0.3   0:01.56 httpd
 5498 www-data  15   0 18332 2208 1464 S  0.0  0.2   0:00.29 httpd
 5335 flipl     16   0 35852  15m 1432 S  0.0  1.6   3:24.55 ruby
 3984 www-data  16   0 16760 2084 1376 S  0.0  0.2   0:01.15 httpd
 5032 root      16   0  8656 1708 1372 S  0.0  0.2   0:00.16 smbd
 3985 www-data  16   0 16784 2056 1352 S  0.0  0.2   0:01.58 httpd
 3981 www-data  16   0 18580 1868 1240 S  0.0  0.2   0:02.12 httpd
 4371 www-data  15   0 16280 1856 1240 S  0.0  0.2   0:00.66 httpd
 3983 www-data  15   0 18184 1852 1232 S  0.0  0.2   0:01.29 httpd
 4376 www-data  16   0 21080 1808 1228 S  0.0  0.2   0:01.13 httpd
 5147 www-data  16   0 15540 1828 1224 S  0.0  0.2   0:00.49 httpd
 5071 www-data  16   0 16496 1804 1216 S  0.0  0.2   0:00.91 httpd
 5115 flipl     15   0  4884 1248 1196 S  0.0  0.1   0:00.11 irb


Where servers running with username mongrel are proxied through
mod_proxy_balancer in Apache2.2 and are running in production mode. Rest of
the mongrel processes , doesn't use apache proxies and being run by
developers from their individual home directories. The one mongrel running
on top is running in development mode and rest all are running in production
mode.

Now, I agree our app is a little complex and we do lot of Ajax and Charting
kind of styff.And truth to be told, it doesn't depend so much of databases.
I am using memcache-client(Eric Hodel,et el), Ubuntu "Linux
2.6.15-23-server #1 SMP i686 GNU/Linux" with 1 GB of memory on AMD64
machine.Mysql version, 5.0.21(from Ubuntu rep).
Apache2.2 and Mongrel 0.3.13.4.

After I removed sendfile and upgraded to pre-release, I admit it has gone a
little high.Previously it was

PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
> 13982 foo     16   0  147m 110m 3956 S  0.0 11.0   0:48.57 mongrel_rails
> 22665 mongrel 16   0 97220  56m 3396 S  0.0  5.6   0:06.66 mongrel_rails
> 22070 rags    16   0 88640  54m 3936 R  0.0  5.4   0:41.97 mongrel_rails
> 22671 mongrel 16   0 86160  49m 3432 S  0.0  4.9   0:04.74 mongrel_rails
> 21260 flipl   16   0 87164  48m 3400 S  0.0  4.8   0:06.09 mongrel_rails
> 22668 mongrel 16   0 75976  45m 3396 S  0.0  4.5   0:04.11 mongrel_rails
> 22284 nobody  15   0 54572  42m 1396 S  0.3  4.2   0:16.64 ruby
> 10327 mysql   16   0  133m  30m 5196 S  0.0  3.0   2:42.69 mysqld
> 13206 flipl   16   0 54280  28m 2156 S  0.0  2.8   1:41.25 ruby
> 22750 blah    16   0 43428  23m 3908 S  0.0  2.3   0: 03.1 mongrel_rails
>  3961 root    16   0 10012 8964  588 S  0.0  0.9   0:03.51 memcached
> 22728 www-data16   0 13536 7536 2620 S  0.0  0.7   0:00.10 httpd
> 22379 flipl   16   0 11980 7208 3060 S  0.0  0.7   0: 01.7 emacs



We are in process of opimizing our code.And we are concentrating on:
1. Removing unnecessary instance variables
2. Removal of Components( We have only one component left in entire
application)
3. Mysql query optimisation, but I am afraid our app, as i said before
doesn't depend so much on databases, if you ignore basic authentication and
other kind of stuff.
4. We use gnuplot( ploticus didn't fit our needs), through pipes and It is a
major performance problem.We are in process of handling this stuff to a
seperate server(which will do just that).But still using gnuplot though
pipes in one thing, I personally don't like.Is there any viable solution?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20060805/68c34ff9/attachment.html 


More information about the Mongrel-users mailing list