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

Ilya Grigorik (igvita.com)
Ruby
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

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.

Comments on this page are now closed.

Comments

Picture of Rabble Evan Henshaw-Plath
Rabble Evan Henshaw-Plath
07/22/2010 2:26pm 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 scordesse@oreilly.com

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@ oreilly.com

Press and Media

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

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? oscon-idea@oreilly.com

Contact Us

View a complete list of OSCON contacts