No Callbacks, No Threads: Async & Cooperative Web Servers with Ruby 1.9

Ilya Grigorik (Google), Dan Sinclair (PostRank Inc.)
Location: Room 309- 310 Level: Novice
Average rating: ****.
(4.73, 67 ratings)

Multi-threaded servers compete for the global interpreter lock (GIL) and incur the cost of continuous context switching, potential deadlocks, or plain wasted cycles. Asynchronous servers, on the other hand, create a mess of callbacks and errbacks, complicating the code. But, what if, you could get all the benefits of asynchronous programming, while preserving the synchronous look and feel of the code – no threads, no callbacks?

In this talk we’ll look at how Ruby 1.9 Fibers, combined with EventMachine, can enable us to build a fully asynchronous web-server, while preserving the feeling of synchronous code – the best of both worlds. A cooperative, pure IO-scheduled web server to power your next Rails, or Rack application!

We will dive deep into the architecture, libraries, and internals of Ruby:

  • Limitations of threaded web servers, libraries and the global interpreter lock
  • (Dis)advantages of asynchronous network programming with the EventMachine library
  • Changes to Ruby 1.9 threading, GIL, and introduction of Fibers
  • Cooperative IO scheduling in Ruby 1.9: Pro’s & Cons
  • Fibers + Callbacks: next generation Ruby web-server
Photo of Ilya Grigorik

Ilya Grigorik


Ilya Grigorik is a web performance engineer at Google, cochair of the W3C Web Performance Working Group, and author of High Performance Browser Networking (O’Reilly). In short, he’s an Internet plumber.

Photo of Dan Sinclair

Dan Sinclair

PostRank Inc.

Dan Sinclair spends his days at PostRank Inc. wandering around Rails and over EventMachine. Dan can be
found online at and on Twitter @dj2sincl.

Comments on this page are now closed.


Picture of Gabe Varela
Gabe Varela
06/10/2010 3:11pm EDT

Excellent talk as always Ilya.

Luke Melia
06/10/2010 11:08am EDT

Best presentation of the conference.

John Tajima
06/10/2010 11:01am EDT

Fantastic talk. Really enjoyed and learned a lot from this one.

Diego Caliri
06/09/2010 11:11am EDT

great talk, the best I’ve seen so far

Ryan Orr
06/08/2010 6:13pm EDT

Best presentation I have seen thus far.

Picture of Joseph Jaramillo
Joseph Jaramillo
06/08/2010 2:57pm EDT

Ilya did a great job as usual. Excellent stuff.

William Gayton
06/08/2010 11:59am EDT

Exactly what I was expecting, needing, wanting to hear. My expectations were exceeded.

Picture of Danny Frade
Danny Frade
06/08/2010 11:36am EDT

Star of the show so far. The only thing would have made it better would have been an appearance of Dan Sinclair

Chris Johnson
06/08/2010 11:34am EDT

Best presentation so far. Technical, exciting, and valuable.

Matt Kern
06/08/2010 11:34am EDT

Really fantastic talk. Worth the price of admission to RailsConf just for this talk. Thanks Ilya!

Robby Colvin
06/08/2010 11:34am EDT

Big problems. Real solutions. Best talk so far.

Picture of Christian Sage
Christian Sage
06/08/2010 11:33am EDT

Awesome! This was the type of talk we come here for. Intensely interesting and extremely valuable.

co-presented by Ruby Central, Inc. O'Reilly
  • Engine Yard
  • Heroku
  • 8th Light
  • Blue Box Group
  • InfoEther
  • JetBrains
  • New Relic
  • Open Hosting
  • Rhomobile
  • WyeWorks
  • Linux Pro Magazine
  • Chargify

Sponsorship Opportunities

For information on exhibition and sponsorship opportunities at RailsConf, contact Yvonne Romaine at

Download the RailsConf Sponsor/Exhibitor Prospectus

Media Partner Opportunities

For information on trade opportunities with O'Reilly conferences or contact mediapartners@

Program Ideas

Send us your suggestions for speakers, topics, and activities to

Press and Media

For media-related inquiries, contact Maureen Jennings at

RailsConf Newsletter

To stay abreast of conference news please sign up for the RailsConf newsletter (login required)

Contact Us

View a complete list of RailsConf 2010 contacts.