Large-scale HTTP and websocket routing with Hipache
blog.dotcloud.com
blog.dotcloud.com
I'm in a situation where I want to use secure websockets to lots of backend VMs. In fact, I want each user to get a fresh VM running a websockets server.
Can I reverse-proxy the secure websocket, terminating the SSL, and dynamically forward it along to various backends (VMs)? I would like to multiplex the secure websockets without putting the SSL cert inside each VM.
That sounds great if it is true. Do you know how well it scales?
It also addresses your question on scaling: "It currently serves production traffic for tens of thousands of applications hosted on dotCloud. Hipache is based on the node-http-proxy library."
Side-note/rant: I am always surprised that HAProxy doesn't get more attention on hackernews, because it is an incredibly powerful tool. IMO, it is definitely one of the biggest technical unsung heroes I'm presently aware of.
We are very much aware of HAProxy, love it, and would have been very happy to use it. For the majority of use cases we would probably recommend it over Hipache, simply because it's more proven.
However, our particular use case involves a) a very large number of vhosts, and b) a highly dynamic topology where backends are added and removed very frequently. In this setup, instrumenting a cluster of HAProxy (or nginx) boxes basically means re-generating and reloading multi-megabyte configuration files across dozens of machines, several times per second. It's what we did before Hipache, and it was painful. Compared to that, implementing active health checks was a small price to pay.
We don't deploy per-app instances for all our applications because at our scale - dotCloud has deployed hundreds of thousands of vhosts - the overhead would be huge compared to a single large cluster, and having to deploy and instrument so many nginx instances would make our system much more complex.
The majority of web apps are actually better off using a shared cluster: they get better reliability, better support, better peak performance and a cheaper price, in exchange for less customization and less guarantees of worst-case performance.