Rails thread safety

Calling Rails.configuration.threadsafe! at the end of your environment.rb does *not* turn on multi-threading. Adding config.threadsafe! to your individual environments (like production.rb) *does* turn on multi-threading.

You can also check that your multi-threading is active by seeing if ActionController::Base.allow_concurrency is true.

We add ::RAILS_DEFAULT_LOGGER.fatal { “Mulithreading is active? #{ActionController::Base.allow_concurrency}” }
to the end of our environment.rb to let us know that it worked.

The Conversation {1 comments}

  1. Topper {Wednesday January 27, 2010 @ 6:38 pm}

    Oh - and that’s in rails 2.2.2 at least

Speak Your Peace

  • Comment Policy:Could go here if there's a nagging need Login Instructions: Would go here if there's a desire.