jhollinger

code et al
jordan at jordanhollinger dot com
powered by eridu

Threaded Thin is really really slow on Ruby 1.9.2

April 22, 2011 | ruby, thin

So you've been using Thin's threaded mode, and it's been rocking the socks off your shiny config.threadsafe!'d Rails app. Then, like me, you caught wind that The Dark Ages were over, and decided to upgrade from Ruby 1.8.7 to 1.9. But oh no! "What's all this?," you ask. "Why isn't Thin responding anymore?"

Rest assured, dear reader, that it is. It's just taking 30+ seconds; Nginix or Apache aren't that patient. There's a 2 year old lighthouse ticket on this issue, and even some related patches in EventMachine. But apparently to little avail.

So until this is all sorted out, as the lighthouse conversation suggests, you'll have to tell Thin to not use epolling. Supposedly this will slow it down, but it should still be faster than it was in Ruby 1.8.7.

From the command line

thin start --threaded --no-epoll ...

In a config file

...
threaded: true
no-epoll: true
...

Now Thin will be restored to its former, threaded glory. Enjoy!

comments powered by Disqus