Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

websocket scalability

I have looked around a bit on websockets, and I have a pretty concrete question: Can websockets actually be scaled over different servers, or are they always limited to one single server?

It seems that this is an issue I've repeatedly bumped into in the docs I have found, but maybe they were incomplete or things evolved. It seems for example as heroku even doesn't support websockets at all(?)

like image 479
transient_loop Avatar asked Feb 05 '13 19:02

transient_loop


People also ask

Are WebSocket scalable?

But why are WebSockets hard to scale? The main challenge is that connections to your WebSocket server need to be persistent. And even once you've scaled out your server nodes both vertically and horizontally, you also need to provide a solution for sharing data between the nodes.

How do I scale a WebSocket connection?

Scaling WebSockets isn't as simple as just increasing the number of instances. It needs to be configured with some other tools in order to build a fully scalable architecture. Using a Publish/Subscribe or pub/sub broker is an effective method of horizontally scaling WebSockets.

Are WebSockets vulnerable?

Some WebSockets security vulnerabilities arise when an attacker makes a cross-domain WebSocket connection from a web site that the attacker controls. This is known as a cross-site WebSocket hijacking attack, and it involves exploiting a cross-site request forgery (CSRF) vulnerability on a WebSocket handshake.


1 Answers

It depends on your application, but in general, there is no reason you can't load balance websocket connections to multiple machines in the same way as any other TCP connection.

like image 133
zaphoyd Avatar answered Oct 03 '22 15:10

zaphoyd