Archives

Tags

Constant outages with Passenger 2.2.11

After pushing a large Rails app live recently, I was constantly struggling to keep Passenger live. Roughly, every 24 hours passenger would simply hang and stop handling requests. The machine (VPS running CentOS 5, 2gb RAM, 4 CPUs) had sufficient free resources and memory. Restarting Apache would instantly fix the issue and flush a bunch of "Broken pipe" errors to the error logs.

I found that killing the passenger process with a SIGABRT signal (6) would cause the process to write a stacktrace to Apaches error log. This was mildly useful.

As it turns out, I was able to solve the problem by finding and killing a couple of mysteriously dormant Ruby processes that passenger had left running. Why these were still running I am not sure. The Passenger team claim that the issue will be fixed in Passenger 3, but in the mean time, keeping an eye on Ruby processes may be beneficial. My (moderately heavy traffic) app has been online for about 7 days without a hitch now. Hopefully it will stay up indefinately now.

It's also worthwhile to make sure Apaches MaxClients setting is at an appropriate level (max_clients * average_process_size). My Passenger seemed to hang up as soon as this was hit. Be careful, though, as it turns out that Apache will keep spawning new clients even if you are out of memory -- I found this out the hard way.

Here are some useful discussions: http://code.google.com/p/phusion-passenger/issues/detail?id=318 and http://code.google.com/p/phusion-passenger/issues/detail?id=199.