Rails server: Mongrel hung – single threaded

In development mode, by default, the mongrel server run in single threaded mode, i.e, processes one request at a time. This is done for a reason, rails apps are assumed to be not thread safe by default.

You will see server timeout errors if there are multiple AJAX calls into the same rails server.

You can add config.threadsafe! in development.rb or production.rb (when using production mode) to make it run in multi-threaded mode.

 

More on this topic:

http://m.onkey.org/thread-safety-for-your-rails

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s