Hi, I''m doing development with Mongrel 1.0.1 on Ruby 1.8.4 / OS X 10.4.10, and I''ve found that often when I shut down my server with ^C, it hangs for a while, gobbling up all CPU. Sometimes it stops after a few seconds, sometimes it''s run for several minutes at least. This happens across all the apps I develop on, but it seems to hang longer after they''ve been heavily used for many hours / days. It''s not a very big deal -- I just kill -9 it... but has anyone else seen this? And suggestions as to how I can avoid it? Thanks! -Nate
On 9/12/07, Nathan Vack <njvack at wisc.edu> wrote:> Hi, > > I''m doing development with Mongrel 1.0.1 on Ruby 1.8.4 / OS X > 10.4.10, and I''ve found that often when I shut down my server with > ^C, it hangs for a while, gobbling up all CPU. Sometimes it stops > after a few seconds, sometimes it''s run for several minutes at least. > This happens across all the apps I develop on, but it seems to hang > longer after they''ve been heavily used for many hours / days. > > It''s not a very big deal -- I just kill -9 it... but has anyone else > seen this? And suggestions as to how I can avoid it? >What db engine/adapter are you using? Maybe mongrel is trying to close pending connections left in the limbo (from HTTP serving or db connections). -- Luis Lavena Multimedia systems - Leaders are made, they are not born. They are made by hard effort, which is the price which all of us must pay to achieve any goal that is worthwhile. Vince Lombardi
Pete DeLaurentis
2007-Sep-12 22:04 UTC
[Mongrel] Mongrel hangs, consumes all CPU on shutdown
We see this on all of our Mac''s here as well. We''ve tried it with different versions of Ruby (1.8.4, 1.8.5, and 18.6), and the problem happens with all of them. If we don''t forget to turn off mongrel before walking away from the computer for a few minutes... it''ll consume all system resources and we''ll need to restart the machine. Our production servers are Ubuntu and run fine, but it''s pretty annoying for development, and odd since Mac''s are some popular for Ruby development. To answer Luis Lavena''s question: we''re using MySQL over HTTP. -Pete On Sep 12, 2007, at 2:47 PM, Nathan Vack wrote:> Hi, > > I''m doing development with Mongrel 1.0.1 on Ruby 1.8.4 / OS X > 10.4.10, and I''ve found that often when I shut down my server with > ^C, it hangs for a while, gobbling up all CPU. Sometimes it stops > after a few seconds, sometimes it''s run for several minutes at least. > This happens across all the apps I develop on, but it seems to hang > longer after they''ve been heavily used for many hours / days. > > It''s not a very big deal -- I just kill -9 it... but has anyone else > seen this? And suggestions as to how I can avoid it? > > Thanks! > -Nate > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users
On 9/12/07, Pete DeLaurentis <pete at nextengine.com> wrote:> We see this on all of our Mac''s here as well. We''ve tried it with > different versions of Ruby (1.8.4, 1.8.5, and 18.6), and the problem > happens with all of them. >That maybe mean that is not ruby fault :-P> If we don''t forget to turn off mongrel before walking away from the > computer for a few minutes... it''ll consume all system resources and > we''ll need to restart the machine. Our production servers are Ubuntu > and run fine, but it''s pretty annoying for development, and odd since > Mac''s are some popular for Ruby development. > > To answer Luis Lavena''s question: we''re using MySQL over HTTP. >You''re using the compiled mysql adapter or the one bundled with Rails? the connection to the mysql server could not be the issue, but maybe the adapter. -- Luis Lavena Multimedia systems - Leaders are made, they are not born. They are made by hard effort, which is the price which all of us must pay to achieve any goal that is worthwhile. Vince Lombardi
Pete DeLaurentis
2007-Sep-12 22:19 UTC
[Mongrel] Mongrel hangs, consumes all CPU on shutdown
Hi Luis, About this compiled MySQL adapter... I haven''t found much info on it, but from what I have read, it looks like it is useful if the database is residing locally on the same machine. However, if you connect to the database via HTTP (which is what we''re doing), it''s not used. Is this correct? Thanks, Pete On Sep 12, 2007, at 3:06 PM, Luis Lavena wrote:> On 9/12/07, Pete DeLaurentis <pete at nextengine.com> wrote: >> We see this on all of our Mac''s here as well. We''ve tried it with >> different versions of Ruby (1.8.4, 1.8.5, and 18.6), and the problem >> happens with all of them. >> > > That maybe mean that is not ruby fault :-P > >> If we don''t forget to turn off mongrel before walking away from the >> computer for a few minutes... it''ll consume all system resources and >> we''ll need to restart the machine. Our production servers are Ubuntu >> and run fine, but it''s pretty annoying for development, and odd since >> Mac''s are some popular for Ruby development. >> >> To answer Luis Lavena''s question: we''re using MySQL over HTTP. >> > > You''re using the compiled mysql adapter or the one bundled with Rails? > the connection to the mysql server could not be the issue, but maybe > the adapter. > > -- > Luis Lavena > Multimedia systems > - > Leaders are made, they are not born. They are made by hard effort, > which is the price which all of us must pay to achieve any goal that > is worthwhile. > Vince Lombardi > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users
On 9/12/07, Pete DeLaurentis <pete at nextengine.com> wrote:> Hi Luis, > > About this compiled MySQL adapter... > > I haven''t found much info on it, but from what I have read, it looks > like it is useful if the database is residing locally on the same > machine. However, if you connect to the database via HTTP (which is > what we''re doing), it''s not used. >> Is this correct?Not exactly. Native bindings (the compiled ones) offer besides better performance (since they are a ruby extension in C), a bit of memory-wise use. Maybe someone could provide better insight information, but AFAIK, it is the recommended method of running rails+mysql. Since I don''t have a mac, couldn''t point you the right tutorial on getting mysql extension built on OSX, but try searching google for "mysql rails bindings osx" (also "gem install mysql osx" as keywords will raise some good results). -- Luis Lavena Multimedia systems - Leaders are made, they are not born. They are made by hard effort, which is the price which all of us must pay to achieve any goal that is worthwhile. Vince Lombardi
On Sep 12, 2007, at 4:57 PM, Luis Lavena wrote:> What db engine/adapter are you using? Maybe mongrel is trying to close > pending connections left in the limbo (from HTTP serving or db > connections).I''m using the compiled mysql gem 2.7, connecting to localhost over TCP. Web-side, I''m using mod_proxy and mod_rewrite -- yeah, I''m proxying on my development box. I don''t think it''s waiting to close HTTP connections, as the service never becomes unresponsive, and I''m only running one mongrel. Perhaps the database disconnect call sometimes thrashes? FWIW, I''m on an Intel (Core 2 Duo) mac. It only eats CPU on one core. Mysql version is 5.0.21 -- the precompiled one from mysql.org. And... I doubt *anyone* is connecting to a mysql server over http ;-) -Nate
On 9/12/07, Nathan Vack <njvack at wisc.edu> wrote:> On Sep 12, 2007, at 4:57 PM, Luis Lavena wrote: > > > What db engine/adapter are you using? Maybe mongrel is trying to close > > pending connections left in the limbo (from HTTP serving or db > > connections). > > I''m using the compiled mysql gem 2.7, connecting to localhost over > TCP. Web-side, I''m using mod_proxy and mod_rewrite -- yeah, I''m > proxying on my development box. > > I don''t think it''s waiting to close HTTP connections, as the service > never becomes unresponsive, and I''m only running one mongrel. Perhaps > the database disconnect call sometimes thrashes? >Just to be sure, starting mongrel, waiting a few seconds and then hitting ^C produces the same result? Changing database.yml to something like sqlite3 produces the same behavior?> FWIW, I''m on an Intel (Core 2 Duo) mac. It only eats CPU on one core. > Mysql version is 5.0.21 -- the precompiled one from mysql.org. >Oh, too common with Intel Core technology (and single-threaded ruby VM) ;-)> And... I doubt *anyone* is connecting to a mysql server over http ;-) >hehehe, hope not! -- Luis Lavena Multimedia systems - Leaders are made, they are not born. They are made by hard effort, which is the price which all of us must pay to achieve any goal that is worthwhile. Vince Lombardi
On Sep 12, 2007, at 5:34 PM, Luis Lavena wrote:> Just to be sure, starting mongrel, waiting a few seconds and then > hitting ^C produces the same result?Yup. It''s still responsive enough to print its "** INT signal received." messages, interestingly.> Changing database.yml to something like sqlite3 produces the same > behavior?I''ll test this... good idea. Thanks! -Nate
Pete DeLaurentis
2007-Sep-12 22:45 UTC
[Mongrel] Mongrel hangs, consumes all CPU on shutdown
So, here''s the article on installing the Mysql gem on OS/X. I had to monkey patch mysql.c, and then it worked after that. http://blog.maxdunn.com/articles/2006/12/12/installing-mysql-gem-on- mac-os-x-10-4 Thanks for the tip Luis. We''ll see if this improves the resource drain I''ve been seeing. Yeah, that part where I said HTTP, I meant TCP/IP. With my latest project it''s all been HTTP, so they''re starting to seem a little interchangeable. Shame on me :-) Thanks, Pete On Sep 12, 2007, at 3:30 PM, Nathan Vack wrote:> On Sep 12, 2007, at 4:57 PM, Luis Lavena wrote: > >> What db engine/adapter are you using? Maybe mongrel is trying to >> close >> pending connections left in the limbo (from HTTP serving or db >> connections). > > I''m using the compiled mysql gem 2.7, connecting to localhost over > TCP. Web-side, I''m using mod_proxy and mod_rewrite -- yeah, I''m > proxying on my development box. > > I don''t think it''s waiting to close HTTP connections, as the service > never becomes unresponsive, and I''m only running one mongrel. Perhaps > the database disconnect call sometimes thrashes? > > FWIW, I''m on an Intel (Core 2 Duo) mac. It only eats CPU on one core. > Mysql version is 5.0.21 -- the precompiled one from mysql.org. > > And... I doubt *anyone* is connecting to a mysql server over http ;-) > > -Nate > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20070912/365237dc/attachment.html
On Wed, 12 Sep 2007 16:47:07 -0500 Nathan Vack <njvack at wisc.edu> wrote:> Hi, > > I''m doing development with Mongrel 1.0.1 on Ruby 1.8.4 / OS X > 10.4.10, and I''ve found that often when I shut down my server with > ^C, it hangs for a while, gobbling up all CPU. Sometimes it stops > after a few seconds, sometimes it''s run for several minutes at least. > This happens across all the apps I develop on, but it seems to hang > longer after they''ve been heavily used for many hours / days.Your ruby is too old so you probably have a cgi.rb that''s vulnerable. Not even sure if the cgi_multipart_eof_fix works for that Ruby. Do an upgrade and see if it goes away. -- Zed A. Shaw - Hate: http://savingtheinternetwithhate.com/ - Good: http://www.zedshaw.com/ - Evil: http://yearofevil.com/
On Wed, 12 Sep 2007 15:04:11 -0700 Pete DeLaurentis <pete at nextengine.com> wrote:> We see this on all of our Mac''s here as well. We''ve tried it with > different versions of Ruby (1.8.4, 1.8.5, and 18.6), and the problem > happens with all of them. > > If we don''t forget to turn off mongrel before walking away from the > computer for a few minutes... it''ll consume all system resources and > we''ll need to restart the machine. Our production servers are Ubuntu > and run fine, but it''s pretty annoying for development, and odd since > Mac''s are some popular for Ruby development.Hmm, when I saw it was with 1.8.4 I immediately thought it was to do with the cgi.rb file upload problem. Here''s the description so you can see if it''s related (and can google for it): When you do a file upload the cgi.rb code does this nasty regex backtracking looking for mime boundaries. In some cases it screws this up--especially with firefox--so that when it gets to the end it needs the EOF to make it stop. But, when you use a StringIO you don''t get an EOF so the cgi.rb code will go into an infinite loop. Does any of that give you some clues? -- Zed A. Shaw - Hate: http://savingtheinternetwithhate.com/ - Good: http://www.zedshaw.com/ - Evil: http://yearofevil.com/
Multipart_fix should work fine with 1.8.4; if it doesn''t, there''s a bug I need to look at. Evan On 9/12/07, Zed A. Shaw <zedshaw at zedshaw.com> wrote:> On Wed, 12 Sep 2007 15:04:11 -0700 > Pete DeLaurentis <pete at nextengine.com> wrote: > > > We see this on all of our Mac''s here as well. We''ve tried it with > > different versions of Ruby (1.8.4, 1.8.5, and 18.6), and the problem > > happens with all of them. > > > > If we don''t forget to turn off mongrel before walking away from the > > computer for a few minutes... it''ll consume all system resources and > > we''ll need to restart the machine. Our production servers are Ubuntu > > and run fine, but it''s pretty annoying for development, and odd since > > Mac''s are some popular for Ruby development. > > Hmm, when I saw it was with 1.8.4 I immediately thought it was to do with the cgi.rb file upload problem. > > Here''s the description so you can see if it''s related (and can google for it): > > When you do a file upload the cgi.rb code does this nasty regex backtracking looking for mime boundaries. > > In some cases it screws this up--especially with firefox--so that when it gets to the end it needs the EOF to make it stop. > > But, when you use a StringIO you don''t get an EOF so the cgi.rb code will go into an infinite loop. > > Does any of that give you some clues? > > -- > Zed A. Shaw > - Hate: http://savingtheinternetwithhate.com/ > - Good: http://www.zedshaw.com/ > - Evil: http://yearofevil.com/ > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users >-- Evan Weaver Cloudburst, LLC
On Thu, 13 Sep 2007 05:40:33 -0400 "Evan Weaver" <evan at cloudbur.st> wrote:> Multipart_fix should work fine with 1.8.4; if it doesn''t, there''s a > bug I need to look at.Yeah, I realized that after I shot off the first response without reading the thread. This actually might be another place where, on OSX, we get a similar hang though. -- Zed A. Shaw - Hate: http://savingtheinternetwithhate.com/ - Good: http://www.zedshaw.com/ - Evil: http://yearofevil.com/
Hi, I have exactly the same problem. I''m using OS X 10.4.10, ruby 1.8.5, mongrel 1.0. This has been getting *much* worse recently, it used to be occasional, now it seems to be pretty much every time. Maybe co- incident with the 10.4.10 update, maybe after. It does not happen with Merb. It does not happen with Rails in production mode, only development mode. It takes a while before it happens, I don''t know how long, but we''re talking about minutes not hours. I do not use a DB at all, if Rails tries to do something with a DB, and it might, it''ll be with sqllite. I have no other information beyond that. Cheers, Bob ---- Bob Hutchison -- tumblelog at http:// www.recursive.ca/so/ Recursive Design Inc. -- weblog at http://www.recursive.ca/ hutch http://www.recursive.ca/ -- works on http://www.raconteur.info/ cms-for-static-content/home/
Next time it hangs, you should invade the process using Mauricio''s live inspection scripts and raise an exception. Then you''ll get a traceback and can see where it is stuck. http://eigenclass.org/hiki.rb?ruby+live+process+introspection The scripts are for 1.8.6 but you can still manage to write a traceback to a file on 1.8.5 with some blind eval-ing, if I remember correctly. Evan On 9/13/07, Bob Hutchison <hutch at recursive.ca> wrote:> Hi, > > I have exactly the same problem. I''m using OS X 10.4.10, ruby 1.8.5, > mongrel 1.0. > > This has been getting *much* worse recently, it used to be > occasional, now it seems to be pretty much every time. Maybe co- > incident with the 10.4.10 update, maybe after. > > It does not happen with Merb. > > It does not happen with Rails in production mode, only development mode. > > It takes a while before it happens, I don''t know how long, but we''re > talking about minutes not hours. > > I do not use a DB at all, if Rails tries to do something with a DB, > and it might, it''ll be with sqllite. > > I have no other information beyond that. > > Cheers, > Bob > > ---- > Bob Hutchison -- tumblelog at http:// > www.recursive.ca/so/ > Recursive Design Inc. -- weblog at http://www.recursive.ca/ > hutch > http://www.recursive.ca/ -- works on http://www.raconteur.info/ > cms-for-static-content/home/ > > > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users >-- Evan Weaver Cloudburst, LLC
Hi, Here is something else that might be related: <http://giles.tumblr.com/post/11479326> Cheers, Bob On 13-Sep-07, at 8:32 AM, Bob Hutchison wrote:> Hi, > > I have exactly the same problem. I''m using OS X 10.4.10, ruby > 1.8.5, mongrel 1.0. > > This has been getting *much* worse recently, it used to be > occasional, now it seems to be pretty much every time. Maybe co- > incident with the 10.4.10 update, maybe after. > > It does not happen with Merb. > > It does not happen with Rails in production mode, only development > mode. > > It takes a while before it happens, I don''t know how long, but > we''re talking about minutes not hours. > > I do not use a DB at all, if Rails tries to do something with a DB, > and it might, it''ll be with sqllite. > > I have no other information beyond that. > > Cheers, > Bob > > ---- > Bob Hutchison -- tumblelog at http:// > www.recursive.ca/so/ > Recursive Design Inc. -- weblog at http://www.recursive.ca/ > hutch > http://www.recursive.ca/ -- works on http:// > www.raconteur.info/cms-for-static-content/home/ > > >---- Bob Hutchison -- tumblelog at http:// www.recursive.ca/so/ Recursive Design Inc. -- weblog at http://www.recursive.ca/ hutch http://www.recursive.ca/ -- works on http://www.raconteur.info/ cms-for-static-content/home/
Hi, On 13-Sep-07, at 4:18 PM, Jason Frankovitz wrote:> Just out of curiosity, these Mac OS systems with the mongrel > problems - are these production systems? Or is everyone just having > these issues on their development machines (I use a MacBook Pro and > it''s great)For me it is only when the Rails environment is ''development''.> > I''d be surprised if a lot of folks are using Xserves and Mac Pros > for RoR, but stranger things have happened. I certainly wouldn''t > mind an Xserve, myself...I would too :-) Cheers, Bob> > Wondering, > -Jason > > > On Sep 13, 2007, at 12:40 PM, Bob Hutchison wrote: > >> Hi, >> >> Here is something else that might be related: >> >> <http://giles.tumblr.com/post/11479326> >> >> Cheers, >> Bob >> >> On 13-Sep-07, at 8:32 AM, Bob Hutchison wrote: >> >>> Hi, >>> >>> I have exactly the same problem. I''m using OS X 10.4.10, ruby >>> 1.8.5, mongrel 1.0. >>> >>> This has been getting *much* worse recently, it used to be >>> occasional, now it seems to be pretty much every time. Maybe co- >>> incident with the 10.4.10 update, maybe after. >>> >>> It does not happen with Merb. >>> >>> It does not happen with Rails in production mode, only development >>> mode. >>> >>> It takes a while before it happens, I don''t know how long, but >>> we''re talking about minutes not hours. >>> >>> I do not use a DB at all, if Rails tries to do something with a DB, >>> and it might, it''ll be with sqllite. >>> >>> I have no other information beyond that. >>> >>> Cheers, >>> Bob >>> >>> ---- >>> Bob Hutchison -- tumblelog at http:// >>> www.recursive.ca/so/ >>> Recursive Design Inc. -- weblog at http://www.recursive.ca/ >>> hutch >>> http://www.recursive.ca/ -- works on http:// >>> www.raconteur.info/cms-for-static-content/home/ >>> >>> >>> >> >> ---- >> Bob Hutchison -- tumblelog at http:// >> www.recursive.ca/so/ >> Recursive Design Inc. -- weblog at http://www.recursive.ca/ >> hutch >> http://www.recursive.ca/ -- works on http://www.raconteur.info/ >> cms-for-static-content/home/ >> >> >> >> _______________________________________________ >> Mongrel-users mailing list >> Mongrel-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/mongrel-users >---- Bob Hutchison -- tumblelog at http:// www.recursive.ca/so/ Recursive Design Inc. -- weblog at http://www.recursive.ca/ hutch http://www.recursive.ca/ -- works on http://www.raconteur.info/ cms-for-static-content/home/
Hi again, On 13-Sep-07, at 8:32 AM, Bob Hutchison wrote:> Hi, > > I have exactly the same problem. I''m using OS X 10.4.10, ruby 1.8.5, > mongrel 1.0. >FYI, for me, this problem seems to have completely disappeared in OS X 10.5.1 (in development mode there is a second or two delay then it terminates, apparently instantaneously in production mode). A new annoyance, 10.5 comes with Apache 2.x. I use apache''s ProxyPass/ ProxyPassReverse to connect to the mongrel server(s) I''m running. After cycling the mongrel server, apache often does not recognise it and I have to restart apache. Some servers (like Commonlisp''s TBNL/ Hunchentoot) have always shown this behaviour. For whatever reason Mongrel didn''t in 10.4 or earlier but now does. This isn''t likely a Mongrel issue, but perhaps others have seen this and have figured something out. If anyone has any suggestions I''d appreciate hearing them. Cheers, Bob> This has been getting *much* worse recently, it used to be > occasional, now it seems to be pretty much every time. Maybe co- > incident with the 10.4.10 update, maybe after. > > It does not happen with Merb. > > It does not happen with Rails in production mode, only development > mode. > > It takes a while before it happens, I don''t know how long, but we''re > talking about minutes not hours. > > I do not use a DB at all, if Rails tries to do something with a DB, > and it might, it''ll be with sqllite. > > I have no other information beyond that. > > Cheers, > Bob > > ---- > Bob Hutchison -- tumblelog at http://www.recursive.ca/so/ > Recursive Design Inc. -- weblog at http://www.recursive.ca/hutch > http://www.recursive.ca/ -- works on http://www.raconteur.info/cms-for-static-content/home/ > > >---- Bob Hutchison -- tumblelog at http://www.recursive.ca/so/ Recursive Design Inc. -- weblog at http://www.recursive.ca/hutch http://www.recursive.ca/ -- works on http://www.raconteur.info/cms-for-static-content/home/
Nathan Vack
2007-Dec-06 17:34 UTC
[Mongrel] Solved: Mongrel hangs, consumes all CPU on shutdown
OK, it''s kind of a weenie solution, but Rails 2.0RC2 seems to totally fix this. So, if you''re hanging in OS X, there''s one more reason to look at upgrading :) -Nate On Sep 12, 2007, at 4:47 PM, Nathan Vack wrote:> Hi, > > I''m doing development with Mongrel 1.0.1 on Ruby 1.8.4 / OS X > 10.4.10, and I''ve found that often when I shut down my server with > ^C, it hangs for a while, gobbling up all CPU. Sometimes it stops > after a few seconds, sometimes it''s run for several minutes at least. > This happens across all the apps I develop on, but it seems to hang > longer after they''ve been heavily used for many hours / days. > > It''s not a very big deal -- I just kill -9 it... but has anyone else > seen this? And suggestions as to how I can avoid it? > > Thanks! > -Nate > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users >