Is it possible to use Amazon ELB in TCP mode to distribute web connection connections across multiple Tomcat-based web server servers?

I saw 3 different messages about using ELB with websockets, but they all seem to use javascript clients or have another variable that is not relevant to our situation.

We have several websocket servers that run on Tomcat. We want ELBs in front of them and all websocket clients (i.e. 100s out of 1000s) connect to the ELB, which should:

  • forward the update / connection request to 1 of our web server servers.
  • then make this connection sticky so that all bidirectional traffic passes between the same client and server for the lifetime of the connection.

Is this possible with ELB today? If possible, is there any special configuration / setting that needs to be done? What limitations exist on the number of concurrent connections supported by Amazon ELB in TCP mode?

We tried to verify this in TCP mode, but for a few 100 connections, the connection starts to fail. However, if we connect directly to one websocket server, we can establish connections at 80 Kbps (or more).

Thanks Bob

+6
source share
1 answer

In general, when connecting via ELB, pay attention to the following:

  • If you expect a large number of connections, send a support request to EC2 asking you to preheat your ELB. To do this, fill out a form that provides them with a time window, the number of connections, request / response sizes, msg frequency and some other parameters. Under the hood, ELB selects machines that can distribute the planned load to the configured backend instances.
  • If you are persistent connections (as we require with websockets, for example), it is important to know that the ELB has a default timeout of 1 minute. After this time, if no traffic is visible, the connection is closed. You can ask to increase the time to 15 minutes. NOTE. That is why it is important to use the ping / heartbeat mechanism if the connections must remain open longer than the ELB allows.
+4
source

Source: https://habr.com/ru/post/957227/


All Articles