Zed Shaw
2006-Apr-06 13:17 UTC
[Rails] Mongrel Web Server 0.3.12.3 -- Thread Tracking and Debugging
Hello Everyone, Mongrel is getting closer and closer to being a rock solid release. My goal is to release 0.4 as "production ready" by Canada on Rails. Please report any problems or suggestions you have. There won''t be any major features or improvements just fixes and code reviews to repair any found bugs or security concerns. People interested in Mongrel should look at http://mongrel.rubyforge.org/ and remember, you can report bugs by clicking on the two yellow beetles. You don''t have to join the mailing list as I actively check that bug posting system. You can get Mongrel using: gem install mongrel CONTENT_TYPE FIX If you had garbage file uploads than this release is for you. This release has a small fix for a big problem where people uploading files or using multipart forms would not receive the CONTENT_TYPE and get garbage in their request parameters. Turned out to be a four character fix. I hate that. THREAD DEBUGGING This release also adds a few things to help people debug their use of threads within their Ruby on Rails applications. When you run mongrel_rails with the -B (debugging) option Mongrel will report all active threads between each request to log/mongrel_debug/thread.log. If you see reports of Mongrel being overloaded, threads getting killed, or having to wait for Mongrel to shutdown then turn on debugging (-B) and look in this log. You most likely are doing something that keeps the thread from exiting. Mongrel also deals with dead threads much better. First the graceful shutdown will wait 10 seconds for a request to finish before aborting it during the shutdown process. Second it will find processing threads which have taken longer than 60+timeout seconds and kill them. Finally, you can put a value into your own Thread.current and when you use the thread.log you can figure out which controllers and actions are creating the bad threads. For example, lets say you see a thread leak. Many times this is caused by trying to make a connection to a remote resource that isn''t there, but you''re not sure. What you do is put this into the suspected controller''s action: Thread.current[:bad_controller_action] = true Or some of other tag to differentiate it with the other threads. Then run Mongrel with -B and if you see this in the KEYS list then you know that this is the controller. MYSQL DROPPED CONNECTIONS? ANYONE? Finally, there seems to be a bug in Rails where it is constantly dropping the connection to MySQL. I''ve found this error on nearly everything and it''s worse when you run WEBrick. It seems to get a little better when you set *ActionController::Base.allow_concurrency* in your config/environments the problem is lessened especially if you run Mongrel, which I don''t understand at all. I''m still trying to determine the cause of this, but if you see this problem please report it to me with what system you are running and how often you see it. **Remember, this is a Rails problem not a Mongrel problem since I see it with WEBrick, FastCGI, SCGI, and on Win32, FreeBSD, OSX, and Linux.** Zed A. Shaw http://www.zedshaw.com/ http://mongrel.rubyforge.org/
Morten
2006-Apr-06 18:47 UTC
[Mongrel] Mongrel Web Server 0.3.12.3 -- Thread Tracking and Debugging
> > MYSQL DROPPED CONNECTIONS? ANYONE? >Aye.. I had that with SCGI running a vanilla Typo 2.6.0. It seemed to happen over night, and my guess was an 8 hour time out or similar from MySQL. I didn''t dig for the root cause, I set up a cron job to call my app every 10 minute and it hasn''t happened since. I was going to do a similar setup with Mongrel, but when I try to install it on the server I get: ... 28. mongrel 0.2.1 (ruby) 29. mongrel 0.2.0 (ruby) 30. Cancel installation > 1 Install required dependency daemons? [Yn] Y ERROR: While executing gem ... (ArgumentError) parse error on line 0, col 31: `!ruby/object:Gem::Specification '' Anyone know what this may be? Thanks. Morten
Jonathan Weiss
2006-Apr-06 19:08 UTC
[Rails] Re: [Mongrel] Mongrel Web Server 0.3.12.3 -- Thread Tracking and Debugging
> > MYSQL DROPPED CONNECTIONS? ANYONE?+ 1 I have many of "Mysql::Error: Lost connection to MySQL server during query" exceptions in my logs... Jonathan -- Jonathan Weiss http://blog.innerewut.de
Jeff Casimir
2006-Apr-06 19:25 UTC
[Mongrel] Mongrel Web Server 0.3.12.3 -- Thread Tracking and Debugging
Morten, I got the same error. It took me awhile to figure out that I was running Ruby 1.8.2 and needed to upgrade to 1.8.4. There is a "Release Candidate 1" on RubyForge that works great (assuming you''re also on Windows). -Jeff Morten wrote:>>MYSQL DROPPED CONNECTIONS? ANYONE? >> >> >> > >Aye.. I had that with SCGI running a vanilla Typo 2.6.0. It seemed to >happen over night, and my guess was an 8 hour time out or similar from >MySQL. I didn''t dig for the root cause, I set up a cron job to call my >app every 10 minute and it hasn''t happened since. > >I was going to do a similar setup with Mongrel, but when I try to >install it on the server I get: > >... > 28. mongrel 0.2.1 (ruby) > 29. mongrel 0.2.0 (ruby) > 30. Cancel installation > > 1 >Install required dependency daemons? [Yn] Y >ERROR: While executing gem ... (ArgumentError) > parse error on line 0, col 31: `!ruby/object:Gem::Specification '' > >Anyone know what this may be? > >Thanks. > >Morten > > > > > >_______________________________________________ >Mongrel-users mailing list >Mongrel-users at rubyforge.org >http://rubyforge.org/mailman/listinfo/mongrel-users > >
Morten
2006-Apr-06 19:59 UTC
[Mongrel] Mongrel Web Server 0.3.12.3 -- Thread Tracking and Debugging
Jeff Casimir wrote:> Morten, > > I got the same error. It took me awhile to figure out that I was > running Ruby 1.8.2 and needed to upgrade to 1.8.4. There is a "Release > Candidate 1" on RubyForge that works great (assuming you''re also on > Windows).I''m on Linux, but it was indeed the Ruby version. Upgraded and works nicely! Thanks Jeff :-)