Following is the output of top command at my server and i find the high usage very much alarming. We are basically a team of three developers working on same machine(remotely), so we run mongrel_rails servers from out ~/public/app directories. We also run a cluster of mongrel servers using apache2.2. Is this much memory use normal? PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 13982 prashant 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 hemant 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 hemant 16 0 54280 28m 2156 S 0.0 2.8 1:41.25 ruby 22750 kiran 16 0 43428 23m 3908 S 0.0 2.3 0:03.15 mongrel_rails 3961 root 16 0 10012 8964 588 S 0.0 0.9 0:03.51 memcached 22728 www-data 16 0 13536 7536 2620 S 0.0 0.7 0:00.10 httpd 22379 hemant 16 0 11980 7208 3060 S 0.0 0.7 0:01.73 emacs -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20060727/6d191339/attachment.html
11% of what, though? (how much memory on the box)? Here''s one from a server we''ve had in production for a while: top - 09:50:01 up 26 days, 21:29, 1 user, load average: 0.00, 0.01, 0.00 Tasks: 79 total, 1 running, 78 sleeping, 0 stopped, 0 zombie Cpu(s): 0.0% us, 0.2% sy, 0.0% ni, 99.7% id, 0.0% wa, 0.2% hi, 0.0% si Mem: 2070040k total, 1774248k used, 295792k free, 198304k buffers Swap: 2031608k total, 0k used, 2031608k free, 1005236k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 20960 highgroo 16 0 99.0m 91m 3364 S 0.0 4.5 95:56.97 mongrel_rails 20957 highgroo 16 0 97136 87m 3368 S 0.0 4.3 101:51.13 mongrel_rails 20954 highgroo 16 0 78076 68m 3296 S 0.0 3.4 97:52.91 mongrel_rails 2020 mysql 16 0 125m 28m 4780 S 0.0 1.4 423:45.18 mysqld 20943 highgroo 16 0 24916 21m 2508 S 0.0 1.0 0:16.49 ruby 1927 ntp 16 0 4044 4044 3044 S 0.0 0.2 0:00.52 ntpd 5502 daemon 16 0 7560 3504 1412 S 0.0 0.2 0:01.20 httpd ... This box has 2 GB of memory though -- linux (in general) is pretty good about using all your memory (versus swap) if you''ve got it -- less important is the memory footprint and perhaps the performance? It looks fine by me.... On 7/27/06, hemant <gethemant at gmail.com> wrote:> Following is the output of top command at my server and i find the high > usage very much alarming. > > We are basically a team of three developers working on same > machine(remotely), so we run mongrel_rails servers from out ~/public/app > directories. > We also run a cluster of mongrel servers using apache2.2. > > Is this much memory use normal? > > > PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND > 13982 prashant 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 hemant 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 hemant 16 0 54280 28m 2156 S 0.0 2.8 1:41.25 ruby > 22750 kiran 16 0 43428 23m 3908 S 0.0 2.3 0: 03.15 mongrel_rails > 3961 root 16 0 10012 8964 588 S 0.0 0.9 0:03.51 memcached > 22728 www-data 16 0 13536 7536 2620 S 0.0 0.7 0:00.10 httpd > 22379 hemant 16 0 11980 7208 3060 S 0.0 0.7 0: 01.73 emacs > > > > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > >-- Charles Brian Quinn www.seebq.com
On 7/27/06, Charles Brian Quinn <me at seebq.com> wrote:> 11% of what, though? (how much memory on the box)? > > Here''s one from a server we''ve had in production for a while: > > top - 09:50:01 up 26 days, 21:29, 1 user, load average: 0.00, 0.01, 0.00 > Tasks: 79 total, 1 running, 78 sleeping, 0 stopped, 0 zombie > Cpu(s): 0.0% us, 0.2% sy, 0.0% ni, 99.7% id, 0.0% wa, 0.2% hi, 0.0% si > Mem: 2070040k total, 1774248k used, 295792k free, 198304k buffers > Swap: 2031608k total, 0k used, 2031608k free, 1005236k cached > > PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND > 20960 highgroo 16 0 99.0m 91m 3364 S 0.0 4.5 95:56.97 > mongrel_railsMy guess is that he is asking about the 147m virt and 110m resident RAM usage. That does seem appallingly high to me unless his application is doing something that is itself very RAM intensive. I don''t have enough experience with substantial Rails apps, though, to know whether to lay that at the feet of Rails or not. Kirk Haines
On Thu, 2006-07-27 at 18:30 +0530, hemant wrote:> Following is the output of top command at my server and i find the > high usage very much alarming. > > We are basically a team of three developers working on same > machine(remotely), so we run mongrel_rails servers from out > ~/public/app directories. > We also run a cluster of mongrel servers using apache2.2. > > Is this much memory use normal? >It''s funny, but just the other day I setup a tomcat server to run a small 10 JSP app and Sun''s JDK used up 358M of ram while IBM''s JDK used 150M. What you might be experiencing though is the common development mode memory leaks that come up once in a while. If these are developers then I wouldn''t worry about it. It''s when you''re in production that you''ve got problems if you see this kind of memory activity. I''ve got a quick hack I''ve been handing to people who have memory problems which has helped them track down leaks. ***ONLY USE THIS IN PRODUCTION MODE***. Don''t bother with this in dev mode. http://pastie.caboo.se/6218 Take that, put it in a file called mongrel.conf, and then start mongrel with: mongrel_rails start -e production -S mongrel.conf It''ll start writing a file called objects.log and after you''ve thrashed the app a bit you can go look at how memory is being used for the different objects. When you thrash the app, don''t do concurrenct hits, just run a bunch in a series. -- Zed A. Shaw http://www.zedshaw.com/ http://mongrel.rubyforge.org/ http://www.railsmachine.com/ -- Need Mongrel support?
On Thu, 2006-07-27 at 09:55 -0400, Charles Brian Quinn wrote:> PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND > 20960 highgroo 16 0 99.0m 91m 3364 S 0.0 4.5 95:56.97 > mongrel_rails> > PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND > > 13982 prashant 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 > > 21260 hemant 16 0 87164 48m 3400 S 0.0 4.8 0:06.09 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 hemant 16 0 54280 28m 2156 S 0.0 2.8 1:41.25 ruby > > 22750 kiran 16 0 43428 23m 3908 S 0.0 2.3 0: 03.15 mongrel_rails > > 22728 www-data 16 0 13536 7536 2620 S 0.0 0.7 0:00.10 httpdWow, look at all those wonderful usernames I can use to hack that box. Now if I can just find the right server I could be in there like swimwear. :-) -- Zed A. Shaw http://www.zedshaw.com/ http://mongrel.rubyforge.org/ http://www.railsmachine.com/ -- Need Mongrel support?
On 7/27/06, Zed Shaw <zedshaw at zedshaw.com> wrote:> <snip> > > Wow, look at all those wonderful usernames I can use to hack that box. > Now if I can just find the right server I could be in there like > swimwear.Especially since those pesky capistrano config/deploy.rb have all the passwords in there for you. And, with .ssh_keys on most of our boxes, it would only take one to get ''em all! Our servers are constantly polled by programs searching for random username/password combinations (the message log is filled with attempts for common usernames), and just the other day we had some program polling our app for FrontPage (gasp! who still uses those) extension dlls and crazy large posting of \x000 \x000 characters to one of our forms for buffer exploits. mongrel handled ''em fine. Maybe it''s time to move ssh up to a different port? It''s a wild world out there y''all. ;-) p.s. the username on our box got cut off, it''s highgroove_deploy for all the hackers out there... -- Charles Brian Quinn www.seebq.com
Hey this machine is not online.... I doubt you can hack into this box, since we just run the stuff only in our LAN.But yeah, next time i would be careful. Anyway, this is still a development box, only difference is, mongrel_rails script run by users other than mongrel are probably running on development mode, while mongrel_cluster spawns the remaining three processes in production mode and so when second process takes 56MB of RES memory, it worries me.I have 1GB of RAM/AMD64 and on Ubuntu. On 7/27/06, Zed Shaw <zedshaw at zedshaw.com> wrote:> > On Thu, 2006-07-27 at 09:55 -0400, Charles Brian Quinn wrote: > > PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND > > 20960 highgroo 16 0 99.0m 91m 3364 S 0.0 4.5 95:56.97 > > mongrel_rails > > > > PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND > > > 13982 prashant 16 0 147m 110m 3956 S 0.0 11.0 0:48.57mongrel_rails > > > 22665 mongrel 16 0 97220 56m 3396 S 0.0 5.6 0:06.66mongrel_rails > > > 22070 rags 16 0 88640 54m 3936 R 0.0 5.4 0:41.97mongrel_rails > > > 21260 hemant 16 0 87164 48m 3400 S 0.0 4.8 0:06.09mongrel_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 hemant 16 0 54280 28m 2156 S 0.0 2.8 1:41.25 ruby > > > 22750 kiran 16 0 43428 23m 3908 S 0.0 2.3 0: 03.15mongrel_rails > > > 22728 www-data 16 0 13536 7536 2620 S 0.0 0.7 0:00.10 httpd > > Wow, look at all those wonderful usernames I can use to hack that box. > Now if I can just find the right server I could be in there like > swimwear. > > :-) > > > -- > Zed A. Shaw > http://www.zedshaw.com/ > http://mongrel.rubyforge.org/ > http://www.railsmachine.com/ -- Need Mongrel support? > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users >-- nothing much to talk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20060727/6e2dd836/attachment.html
A little self promotion? Shameful cbq shameful..:) josh @ besquared Charles Brian Quinn wrote:> On 7/27/06, Zed Shaw <zedshaw at zedshaw.com> wrote: > >> <snip> >> >> Wow, look at all those wonderful usernames I can use to hack that box. >> Now if I can just find the right server I could be in there like >> swimwear. >> > > Especially since those pesky capistrano config/deploy.rb have all the > passwords in there for you. And, with .ssh_keys on most of our boxes, > it would only take one to get ''em all! > > Our servers are constantly polled by programs searching for random > username/password combinations (the message log is filled with > attempts for common usernames), and just the other day we had some > program polling our app for FrontPage (gasp! who still uses those) > extension dlls and crazy large posting of \x000 \x000 characters to > one of our forms for buffer exploits. mongrel handled ''em fine. > Maybe it''s time to move ssh up to a different port? > > It''s a wild world out there y''all. ;-) > > p.s. the username on our box got cut off, it''s highgroove_deploy for > all the hackers out there... >