Skip to content

Instantly share code, notes, and snippets.

@DanKnox
Created March 26, 2012 08:15
Show Gist options
  • Save DanKnox/2203866 to your computer and use it in GitHub Desktop.
Save DanKnox/2203866 to your computer and use it in GitHub Desktop.
Async Rails Config
bechmark with apache bench:
ab -c 10 -n 20 http://127.0.0.1:8090/chat
install async active record mysql adapater
git clone git://github.com/igrigorik/em-mysqlplus.git
git checkout activerecord
rake install
# database.yml
development:
adapter: em_mysqlplus
database: widgets
pool: 5
timeout: 5000
# environment.rb
require 'em-activerecord'
require 'rack/fiber_pool'
# Run each request in a Fiber
config.middleware.use Rack::FiberPool
config.threadsafe!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment