I am working on a project in which more than 50 thousand devices should interact with my server using reverse SSH tunneling.
These devices will also generate and move heavy traffic through these ports, therefore consuming a heavy network and processor on the server.
I use the AWS EC2 stack and chose a moderate server to run (4 processor cores and 16 GB of RAM).
Since one server is not capable of 50 thousand + connections, I have to find a way to somehow balance the traffic.
Assuming each EC2 instance can support up to 500 reverse SSH connections without strangulation, I will need 50,000 / 500 = 100 servers (for 50k devices: let's say that this is a tough target at the moment).
While I will eventually need 100 servers, this increase in devices will be gradual, so I do not require 100 servers from day one.
This account should increase gradually, as the number of devices that communicate with the server increases.
The obvious way to handle this is by balancing the elastic load or maybe the elastic IP (both concepts are slightly different, but ELB is obviously the way to go).
But ELB will work with conventional communication protocols such as HTTP / HTTPS / TCP.
My scenario is bit-bit: each device is assigned a different port.
For instance:
Dev 1 port = 2000
Dev 2 port = 2001
Dev 3 port = 2003
Dev 50000 port = 52000
, SSH, ELB, .
DNS-, : ports.my-domain.com.
DNS ELB / EC2, , , :
ports.my-domain.com
|
|- 1.1.1.1 (port range: 2000-2500)
|- 1.1.1.2 (port range: 2501-3000)
|- 1.1.1.3 (port range: 3001-3500)
...
, 1.1.1.1 - 1.1.1.3 .. ELB.
dev 1 SSH 2000, IP: 1.1.1.1, , , CLB ( AWS), TCP...
: ports.my-domain.com , :
Dev 1 -> ports.my-domain.com: 2000
Dev 2 -> ports.my-domain.com: 2001
Dev 50000 -> ports.my-domain.com: 52000
, ELB 1:1.1.1.1 500 , 1.1.1.2 500 , , 50000- () 1.1.255.200
: ports.my-domain.com , AWS .
- AWS , : AWS Cloud Watch, AWS Elastic Bean stalk, AWS Cloud Formation, AWS Container services ( : - ) .. .
, .
...