ruby + websocket + haproxy
Upcoming SlideShare
Loading in...5
×
 

ruby + websocket + haproxy

on

  • 1,143 views

OnePlaylist prod use case on using websocket, ruby-eventmachine via a HA-Proxy loadbalancer

OnePlaylist prod use case on using websocket, ruby-eventmachine via a HA-Proxy loadbalancer

Statistics

Views

Total Views
1,143
Views on SlideShare
892
Embed Views
251

Actions

Likes
0
Downloads
2
Comments
0

1 Embed 251

http://www.mathieu-elie.net 251

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    ruby + websocket + haproxy ruby + websocket + haproxy Presentation Transcript

    • websocket on ruby oneplaylist.fm beta use case
    • The Stack • ruby on rails • redis • ruby-eventmachine • HA-Proxy
    • Other on Stack • Resque: background processing in rails • mongodb • coffeescript js heavy • elasticsearch (tire ruby gem)
    • HA-Proxy • tcp level load balancer • handle http level too • super fast, and so on..... • high availaibility made easy
    • HA-Proxy stack • HA-Proxy -> 3 ruby on rails front • HA-Proxy -> 3 elasticsearch instance (direct from coffee) • HA-Proxy -> event-machine tcp level websocket
    • HA-Proxy websocket • http://oneplaylist.fm -> app • http://oneplaylist.fm/websocket -> tcp event machine !! • same ip, same domain, sub path !!!!
    • Redis and websocket ? • handle stateless auth -> pass a token each request pass from front • redis is a central point of communication: super fast and performant • PUB SUB ! -> push to websocket
    • Redis and websocket • each token -> a user id • after authenticate, the eventmachine tcp session register to redis pub pipe with key user id • all message to user from rails -> pub redis key -> eventmachine redis -> websocket / browser in real time of course
    • Rails -> redis • Rails app write data in redis key before pushing • when user reconnect -> eventmachine make a get on key and push back to browser • some part of app are render only with webscoket data -> better consistency
    • more infos • http://oneplaylist.fm • https://twitter.com/mathieuel • http://www.mathieu-elie.net