Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #10803 (closed defect: incomplete)

Opened 6 months ago

Last modified 5 months ago

[PATCH] Rails concurrency fixes

Reported by: wesley.moxam Assigned to: core
Priority: normal Milestone: 2.x
Component: ActionPack Version: edge
Severity: normal Keywords:
Cc: chuyeow

Description

This patches some of the deficiencies in actionpack which allows Rails to be run with concurrent threads.

I've been doing some testing by applying heavy load on a single mongrel that has been patched to obey ActionController::Base.allow_concurrency. It is not production ready as I have seen Route recognition get confused under heavy load, especially if your routes contain the 'default route' (map.connect ':controller/:action/:id'). At the very least this is a good starting point for anyone who wants to see multithreaded rails at some point in the near future.

To enable, add the following to config/environments/production.rb ActionController::Base.allow_concurrency = true ActiveRecord::Base.allow_concurrency = true

This does NOT work in development mode (nor does it make sense for it to work in any environment where config.cache_classes = false).

Attachments

rails-threading.patch (17.3 kB) - added by wesley.moxam on 01/14/08 20:54:30.

Change History

01/14/08 20:54:30 changed by wesley.moxam

  • attachment rails-threading.patch added.

01/15/08 02:06:11 changed by chuyeow

  • cc set to chuyeow.

02/04/08 21:12:25 changed by wesley.moxam

  • status changed from new to closed.
  • resolution set to incomplete.

A lot of code has been refactored since this was written, so it's probably useless in its current form.

Meh.