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

Location: Portland 252
Average rating: ****.
(4.10, 10 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!

In this talk 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.

Comments on this page are now closed.


Picture of Rabble Evan Henshaw-Plath
Rabble Evan Henshaw-Plath
07/22/2010 7:26am PDT

Great session, well presented with technical meat.

  • Intel
  • Microsoft
  • Google
  • Facebook
  • Rackspace Hosting
  • (mt) Media Temple, Inc.
  • ActiveState
  • CommonPlaces
  • DB Relay
  • FireHost
  • GoDaddy
  • HP
  • HTSQL by Prometheus Research
  • Impetus Technologies Inc.
  • Infobright, Inc
  • JasperSoft
  • Kaltura
  • Marvell
  • Mashery
  • NorthScale, Inc.
  • Open Invention Network
  • OpSource
  • Oracle
  • Parallels
  • PayPal
  • Percona
  • Qualcomm Innovation Center, Inc.
  • Rhomobile
  • Schooner Information Technology
  • Silicon Mechanics
  • SourceGear
  • Symbian
  • VoltDB
  • WSO2
  • Linux Pro Magazine

Sponsorship Opportunities

For information on exhibition and sponsorship opportunities at the conference, contact Sharon Cordesse at

Download the OSCON Sponsor/Exhibitor Prospectus

Media Partner Opportunities

Download the Media & Promotional Partner Brochure (PDF) for information on trade opportunities with O'Reilly conferences or contact mediapartners@

Press and Media

For media-related inquiries, contact Maureen Jennings at

OSCON Newsletter

To stay abreast of conference news and to receive email notification when registration opens, please sign up for the OSCON Newsletter (login required)

OSCON 2.0 Ideas

Have an idea for OSCON to share?

Contact Us

View a complete list of OSCON contacts