Tim Kretschmer
Tim Kretschmer

Reputation: 2280

gem "websocket-rails" and its scalability

we are currently developing a chat (like facebook, with stored messages). at the moment, theres a minimum of 500 online users (its a dating website) and at the peak there is a max of 3000 users simultanously online.

switching to websockets is "the thing" for us, but while using the gem "websocket-rails" we fear a little the performance.reading articles like https://www.igvita.com/2008/11/13/concurrency-is-a-myth-in-ruby/ is causing some doubts.

so our question is:

does websocket-rails is killing our application or not? the other choice would be running a jsnode server and switch to faye which shouldnt be a problem in our scalabitliy. does somebody is having any expereince with the scalability of websocket-rails?

Upvotes: -2

Views: 428

Answers (1)

tomsoft
tomsoft

Reputation: 4567

The GIL is still here, but should not be the main issue. The main problem is that the Rails approach does not fit well in a massive chat approach.

My suggestion is to switch to event machine for this specific part, and still use websocket (or others push mechanism, like pusher), and use this kind of WebSocket EventMachine Client.

You will be then event driven, with a single ruby thread and you still can use all the others rails existing libraries (that's the node.js model)

Upvotes: 0

Related Questions