WebSockets with Varnish and Nginx
11–20 of 20 posts
Re: WebSockets with Varnish and Nginx
#12Varnish allocates one thread per connection. Even if it supports websockets, it's not going to scale well across tens of thousands of simultaneous persistent connections. The context switch and memory overhead will be considerable. For now, Java-based servers (using netty) and node.js may be a better idea.
The question is, how could I set up multiple servers on the same port? Or what else do I need to put in front of Varnish to route WebSocket connections elsewhere?
I'm starting to think this use case is not easy to solve under one IP address.
Re: WebSockets with Varnish and Nginx
#13Varnish allocates one thread per connection. Even if it supports websockets, it's not going to scale well across tens of thousands of simultaneous persistent connections. The context switch and memory overhead will be considerable. For now, Java-based servers (using netty) and node.js may be a better idea.
Re: WebSockets with Varnish and Nginx
#14Varnish allocates one thread per connection. Even if it supports websockets, it's not going to scale well across tens of thousands of simultaneous persistent connections. The context switch and memory overhead will be considerable. For now, Java-based servers (using netty) and node.js may be a better idea.
As for the handling of the websockets, setting the pipe_timeout variable in the vcl file would release any persistent, yet silent, connections.
Re: WebSockets with Varnish and Nginx
#15Varnish allocates one thread per connection. Even if it supports websockets, it's not going to scale well across tens of thousands of simultaneous persistent connections. The context switch and memory overhead will be considerable. For now, Java-based servers (using netty) and node.js may be a better idea.
Not only that, but letting all traffic through Varnish is not a good utilization of its resources at all. The question is, how could I set up multiple servers on the same port? Or what else do I need to put in front of Varnish to route WebSocket connections elsewhere? I'm starting to think this use case is not easy to solve under one IP address.
No need for Varnish for proxying your websockets.
Re: WebSockets with Varnish and Nginx
#16Varnish allocates one thread per connection. Even if it supports websockets, it's not going to scale well across tens of thousands of simultaneous persistent connections. The context switch and memory overhead will be considerable. For now, Java-based servers (using netty) and node.js may be a better idea.
Not only that, but letting all traffic through Varnish is not a good utilization of its resources at all. The question is, how could I set up multiple servers on the same port? Or what else do I need to put in front of Varnish to route WebSocket connections elsewhere? I'm starting to think this use case is not easy to solve under one IP address.
https://www.varnish-cache.org/docs/trunk/tutorial/websockets...
Re: WebSockets with Varnish and Nginx
#17Varnish allocates one thread per connection. Even if it supports websockets, it's not going to scale well across tens of thousands of simultaneous persistent connections. The context switch and memory overhead will be considerable. For now, Java-based servers (using netty) and node.js may be a better idea.
Not only that, but letting all traffic through Varnish is not a good utilization of its resources at all. The question is, how could I set up multiple servers on the same port? Or what else do I need to put in front of Varnish to route WebSocket connections elsewhere? I'm starting to think this use case is not easy to solve under one IP address.
There are reasons to do either but I've not come up with a definitive reason to go one way or another.
Re: WebSockets with Varnish and Nginx
#18Earlier quoted context omitted.
Not only that, but letting all traffic through Varnish is not a good utilization of its resources at all. The question is, how could I set up multiple servers on the same port? Or what else do I need to put in front of Varnish to route WebSocket connections elsewhere? I'm starting to think this use case is not easy to solve under one IP address.
Node Http Proxy: https://github.com/nodejitsu/node-http-proxy No need for Varnish for proxying your websockets.
Re: WebSockets with Varnish and Nginx
#19this does not address the problem with ssl-traffic. varnish will delegate it to a reverse proxy _in front_ of itself. i usually deploy nginx. looks like a catch-22 for websockets ;).
So how do you handle the case of SSL in front of web traffic and web socket traffic? I need to handle both SSL and non-SSL. Right now I just use another port, but my users behind a firewall can't access the websocket.
Re: WebSockets with Varnish and Nginx
#20Earlier quoted context omitted.
So how do you handle the case of SSL in front of web traffic and web socket traffic? I need to handle both SSL and non-SSL. Right now I just use another port, but my users behind a firewall can't access the websocket.
usually a different websocket port. not what you wanted to hear i guess :|.