Skip to content

Rails thread safety

by Topper on January 27th, 2010

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.

  • Oh – and that’s in rails 2.2.2 at least