Whilst monitoring my host I noticed that there were three mongrel_rails processes running for a single (non mongrel_clustered) application. Is this normal? Do the processes share the memory top indicates they''re each using? Cheers, -- Dave Murphy (Schwuk) http://schwuk.com
On Thu, 2006-08-03 at 08:26 +0100, Dave Murphy wrote:> Whilst monitoring my host I noticed that there were three > mongrel_rails processes running for a single (non mongrel_clustered) > application. Is this normal? Do the processes share the memory top > indicates they''re each using?If it''s linux then go ask the linux kernel guys why they show processes that way. :-) Otherwise, double check that you really are running just one. Use lsof -i -P | grep ruby to get a better picture. -- Zed A. Shaw http://www.zedshaw.com/ http://mongrel.rubyforge.org/ http://www.railsmachine.com/ -- Need Mongrel support?
> Otherwise, double check that you really are running just one. Use lsof > -i -P | grep ruby to get a better picture.Running: $ sudo lsof -i -P | grep ruby ...gave me nothing. With a slight twist: $ sudo lsof -i -P | grep mongrel mongrel_r 7657 root 3u IPv4 9018835 TCP *:3000 (LISTEN) mongrel_r 7658 root 3u IPv4 9018835 TCP *:3000 (LISTEN) mongrel_r 7659 root 3u IPv4 9018835 TCP *:3000 (LISTEN) And finally: $ sudo ps ax | grep mongrel Warning: bad syntax, perhaps a bogus ''-''? See http://procps.sf.net/faq.html 7657 ? S 490:07 /usr/bin/ruby1.8 /usr/bin/mongrel_rails start -c /home/schwuk/typo -e production -p 3000 -d 7658 ? S 0:00 /usr/bin/ruby1.8 /usr/bin/mongrel_rails start -c /home/schwuk/typo -e production -p 3000 -d 7659 ? S 0:01 /usr/bin/ruby1.8 /usr/bin/mongrel_rails start -c /home/schwuk/typo -e production -p 3000 -d 28223 pts/0 S+ 0:00 grep mongrel Cheers, -- Dave Murphy (Schwuk) http://schwuk.com
On Thu, Aug 03, 2006 at 10:12:42AM +0100, Dave Murphy wrote: [..]> And finally: > > $ sudo ps ax | grep mongrel > Warning: bad syntax, perhaps a bogus ''-''? See http://procps.sf.net/faq.html > 7657 ? S 490:07 /usr/bin/ruby1.8 /usr/bin/mongrel_rails > start -c /home/schwuk/typo -e production -p 3000 -d > 7658 ? S 0:00 /usr/bin/ruby1.8 /usr/bin/mongrel_rails > start -c /home/schwuk/typo -e production -p 3000 -d > 7659 ? S 0:01 /usr/bin/ruby1.8 /usr/bin/mongrel_rails > start -c /home/schwuk/typo -e production -p 3000 -d > 28223 pts/0 S+ 0:00 grep mongrelSeems to depend on the exact kernel you use - or on the Mongrel version. On a 2.6.16-2-xen-686 kernel running 0.3.13.2 I get similar output like the above - 3 processes per Mongrel instance. On a 2.6.8-3-k7 kernel running 0.3.13.4 it''s only one entry per Mongrel instance. I don''t think there''s any difference in terms of memory consumption, imho it''s just a difference in how ps shows processes / threads. I remember that back in my old Java days on some systems (2.4 kernels) ps showed each single Java thread, that behaviour disappeared with 2.6 kernels - then ps showed only one process per running application, regardless of any threads it has spawned. Jens -- webit! Gesellschaft f?r neue Medien mbH www.webit.de Dipl.-Wirtschaftsingenieur Jens Kr?mer kraemer at webit.de Schnorrstra?e 76 Tel +49 351 46766 0 D-01069 Dresden Fax +49 351 46766 66
On 03/08/06, Jens Kraemer <kraemer at webit.de> wrote:> I don''t think there''s any difference in terms of memory consumption, > imho it''s just a difference in how ps shows processes / threads. I > remember that back in my old Java days on some systems (2.4 kernels) ps > showed each single Java thread, that behaviour disappeared with 2.6 > kernels - then ps showed only one process per running application, > regardless of any threads it has spawned.I suspected it was threads rather than processes, but I wanted to confirm it. Cheers, -- Dave Murphy (Schwuk) http://schwuk.com