Project

General

Profile

WEBrick hangs

Added by Carl Nygard almost 16 years ago

I've got the redmine hangs problem back again. I had it previously running redmine through mongrel, but when I went back to running under WEBrick, things were ok. For a while. Now it's hanging very often, and I can't seem to figure out why. Attaching gdb to the ruby process yields this snippet:

(gdb) where
#0 0x00a977a2 in dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1 0x00b75a41 in _
_newselect_nocancel () from /lib/tls/libc.so.6
#2 0x00c32ed0 in rb_thread_schedule () from /usr/lib/libruby.so.1.8
#3 0x00c42849 in rb_thread_select () from /usr/lib/libruby.so.1.8
#4 0x00c57428 in rb_gets () from /usr/lib/libruby.so.1.8

with a lot more rb_thread_schedule() lines all the way back to ruby_exec().

My only clue is that when it started hanging coincided with expanding usage to include some IE users. Here's a reference What I don't understand is how the XP side might be hanging ruby when ruby is running on an RHEL4 machine?

Any help?


Replies (12)

RE: WEBrick hangs - Added by Carl Nygard almost 16 years ago

BTW, it's not locked so badly that I can't connect to it, as shown by this before/after pair of output from lsof, after I tried to browse to it directly instead of through apache proxy (oh yeah, forgot to mention I'm using mod_proxy to access redmine from an apache server).

before:
ruby 6191 root 3w REG 253,0 3584545 20335936 /var/www/html/redmine-0.7.2/log/production.log
ruby 6191 root 4u IPv4 14884425 TCP *:afs3-fileserver (LISTEN)
ruby 6191 root 5u IPv4 15194151 TCP localhost.localdomain:7000->localhost.localdomain:53889 (CLOSE_WAIT)
ruby 6191 root 6u sock 0,4 14884625 can't identify protocol
ruby 6191 root 7u IPv4 15199979 TCP localhost.localdomain:7000->localhost.localdomain:53988 (CLOSE_WAIT)

after:ruby 6191 root 3w REG 253,0 3584545 20335936 /var/www/html/redmine-0.7.2/log/production.log
ruby 6191 root 4u IPv4 14884425 TCP *:afs3-fileserver (LISTEN)
ruby 6191 root 5u IPv4 15194151 TCP localhost.localdomain:7000->localhost.localdomain:53889 (CLOSE_WAIT)
ruby 6191 root 6u sock 0,4 14884625 can't identify protocol
ruby 6191 root 7u IPv4 15199979 TCP localhost.localdomain:7000->localhost.localdomain:53988 (CLOSE_WAIT)
ruby 6191 root 8u IPv4 15203482 TCP wcsdev.fortna.net:7000->traveler.fortna.net:36408 (ESTABLISHED)

Meanwhile, showing stacktraces for all threads in gdb gives this:

Thread 2 (Thread -1224049744 (LWP 6201)):
#0 0x00a977a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1 0x00d1ac86 in __nanosleep_nocancel () from /lib/tls/libpthread.so.0
#2 0x00c43332 in rb_thread_group () from /usr/lib/libruby.so.1.8
#3 0x00d15371 in start_thread () from /lib/tls/libpthread.so.0
#4 0x00b7cffe in clone () from /lib/tls/libc.so.6

Thread 1 (Thread -1208932672 (LWP 6191)):
#0 0x00a977a2 in dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1 0x00b75a41 in _
_newselect_nocancel () from /lib/tls/libc.so.6
#2 0x00c32ed0 in rb_thread_schedule () from /usr/lib/libruby.so.1.8
#3 0x00c42849 in rb_thread_select () from /usr/lib/libruby.so.1.8
#4 0x00c57428 in rb_gets () from /usr/lib/libruby.so.1.8
#5 0x00c38683 in rb_thread_schedule () from /usr/lib/libruby.so.1.8
#6 0x00c39169 in rb_thread_schedule () from /usr/lib/libruby.so.1.8

So it obviously can accept connections, just can't process the info through. What gives?

RE: WEBrick hangs - Added by Thomas Lecavelier over 15 years ago

Webrick is not suitable for production purpose. Try this:

$ sudo gem install mongrel
then restart. Mongrel is far more stable than webrick.

RE: WEBrick hangs - Added by Carl Nygard over 15 years ago

I've tried mongrel, but it's no more stable than WEBrick. The stack trace of the ruby process when it's hung is the same as when running under WEBrick.

So what's the issue? Is there some problem with Ruby on RHEL4? Anybody have a clue?

RE: WEBrick hangs - Added by Calvin Cheng over 15 years ago

Hi Carl,

I have given up on Mongrels after repeated incidents where it crashes my Apache Server on a regular basis.
EVERY month, without fail and for no good reason, it will simply crash my Apache Server and as a result, my entire Server is down.

DISCLAIMER: I must admit that I am not familiar with Ruby on Rails in comparison with my familiarity with Python and PHP so I have no idea how to set Mongrels right.

In the end, to cut the long story short, I gave up on Mongrels, installed Passenger (mod_rails) and it has worked beautifully and consistently ever since.
I think my Mongrels may be female... :p given its regular bouts of uncooperativeness on a monthly basis. :)
(It's just a joke, if this message reaches any female developer, I may be shot, so don't take it too seriously.)

Anyway, give mod_rails a shot... :)
It worked beautifully for me.

Good luck,
Calvin

RE: WEBrick hangs - Added by Jean-Philippe Lang over 15 years ago

I also had problems with mongrel. I personally use apache+mod_fcgid.

RE: WEBrick hangs - Added by Derek Montgomery over 15 years ago

Had problems with mongrels and now tried passenger who does the same thing about getting stuck at 100% cpu every few days...
Really annoying.

I'll probably do like JP and go back to mod_fcgid after all...
(kinda looping the whole thing over though)

RE: WEBrick hangs - Added by Thomas Lecavelier over 15 years ago

For mongrel deseptive-guy, just try thin: it works the same, but better and simpler. Far better :)

http://code.macournoyer.com/thin/

RE: WEBrick hangs - Added by Derek Montgomery over 15 years ago

Any way to have it integrated with Apache? I don't really want to run 2 different webservers... Especially since I want all my websites on port 80

RE: WEBrick hangs - Added by Jeff Dombach over 15 years ago

Is any additional information related to this item available? I would also like my Redmine to use the apache server on port 80.

Jeff
"We do the stuff behind the buttons!"
http://www.jldsystems.com

Spam removed - Added by evertytewlith evertytewlith over 14 years ago

Spam kindly removed by Mischa The Evil.

Spam removed - Added by Courdy Courdy over 14 years ago

Spam kindly removed by Mischa The Evil.

Spam removed - Added by Courdy Courdy over 14 years ago

Spam kindly removed by Mischa The Evil.

    (1-12/12)