Upgrade to Pro — share decks privately, control downloads, hide ads and more …

ActionCable, WebSocket and Scalability

Daniel Lv
October 11, 2015

ActionCable, WebSocket and Scalability

以 Rails 5.0 即将发布的 ActionCable 作为切入点,给大家介绍一下事实 WebSocket 的内部实现,以及在生产环境下如何去正确的水平扩展 WebSocket 服务。

Daniel Lv

October 11, 2015
Tweet

More Decks by Daniel Lv

Other Decks in Technology

Transcript

  1. Real-time Web ԏ᪠ • Polling • Long Polling / Comet

    • Server-Sent Event (SSE) • XMPP҅Flash҅etc…
  2. GET /chat HTTP/1.1 Host: server.example.com Upgrade: websocket Connection: Upgrade HTTP/1.1

    101 Switching Protocols Upgrade: websocket Connection: Upgrade
  3. Ruby and WebSockets • Third-party Service / pusher.com • Stand-alone

    server / Slanger • EventMachine + em-websocket • Faye
  4. Under the hood • Authorization (Signed Cookie) • API •

    Connection • Channel • Broadcast • PubSub
  5. Celluloid • Created at 2011 • Actor Model • Ecosystem

    • Celluloid::IO • Reel::IO • DCell • Sidekiq
  6. Single Server • TCP/IP parameters • Maximum Number Of FD

    • Memory / Network • Concurrent Model