3 ms·
You can hold a TCP connection open through an ELB basically as long as you want. The default idle timeout is 60s but can be increased to 1hr, this is a non-fact
by jpgvm 11y ago
You can hold a TCP connection open through an ELB basically as long as you want. The default idle timeout is 60s but can be increased to 1hr, this is a non-factor if you are sending any sort of data though.
When the "routing rug" is pulled out from under you all you need to do is re-resolve and re-establish the TCP connection which will likely live on for days (in most cases weeks) without disconnecting again.
This is fine for most use cases I am aware of.
As for Websockets, you will need to run the ELB in TCP mode to do that and probably run a real HTTP proxy behind it that supports Websockets/UPGRADE and uses constant source-ip hashing and supports the TCP PROXY protocol. i.e HAProxy.
You can run HAProxy or other any other proxy that matches the above in an ELB to get good highly available Websockets proxy layer.
- Tenzer 11y agoYou can also use Nginx for the PROXY protocol, that was added in version 1.5.12. You should just add "proxy_protocol" to your "listen" directive: http://nginx.org/en/docs/http/ngx_http_core_module.html#listen http://nginx.org/en/docs/http/ngx_http_core_module.html#list....
- jpgvm 11y agoCool, does it allow you to control the balancing to enforce source-ip -> backend mapping? This is required due to the nature of Websockets UPGRADE and most semi-stateful Websockets servers.
- Tenzer 11y agoSure, that's not really related to the protocol used. It's instead handled by the upstream module and the "ip_hash" flag: http://nginx.org/en/docs/http/ngx_http_upstream_module.html#ip_hash http://nginx.org/en/docs/http/ngx_http_upstream_module.html#....