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

Ilya Grigorik (igvita.com), Dan Sinclair (PostRank Inc.)
General
Location: Room 309- 310
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

igvita.com

Ilya Grigorik is the founder and CTO of PostRank, a real-time social engagement monitoring and analytics platform. He is an avid Ruby and web architecture blogger (www.igvita.com, Twitter: @igrigorik), speaker, and a community evangelist.

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 www.everburning.com and on Twitter @dj2sincl.

Comments on this page are now closed.

Comments

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

Excellent talk as always Ilya.

Luke Melia
06/10/2010 3:08pm EDT

Best presentation of the conference.

John Tajima
06/10/2010 3:01pm EDT

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

Diego Caliri
06/09/2010 3:11pm EDT

great talk, the best I’ve seen so far

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

Best presentation I have seen thus far.

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

Ilya did a great job as usual. Excellent stuff.

William Gayton
06/08/2010 3:59pm EDT

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

Picture of Danny Frade
Danny Frade
06/08/2010 3:36pm 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 3:34pm EDT

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

Matt Kern
06/08/2010 3:34pm EDT

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

Robby Colvin
06/08/2010 3:34pm EDT

Big problems. Real solutions. Best talk so far.

Picture of Christian Sage
Christian Sage
06/08/2010 3:33pm 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 yromaine@oreilly.com.

Download the RailsConf Sponsor/Exhibitor Prospectus

Media Partner Opportunities

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

Program Ideas

Send us your suggestions for speakers, topics, and activities to rails-idea@oreilly.com.

Press and Media

For media-related inquiries, contact Maureen Jennings at maureen@oreilly.com.

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.