amazon web services - Dynamic load balancing with reverse SSH tunnels on different ports using AWS -


i working on project more 50 thousand devices need communicate server using reverse ssh tunneling.

these devices generating, , moving heavy traffic across these ports, hence consuming heavy network , cpu on server.

i using aws ec2 stack, , have chosen moderate server start (4 cpu cores , 16 gb ram).

since single server not capable of 50 thousand + connections, must find way load balance traffic somehow.

assuming each ec2 instance can support 500 reverse ssh connections, without choking, require 50000/500 = 100 servers (for 50k devices: let’s assume hard target now).

while going require 100 servers, increase of devices gradual, don't require 100 servers day one.

this count should increase gradually, number of devices increase, communicate server.

the obvious way handle elastic load balancing, or maybe elastic ip (both concepts bit different elb way go).

but elb work on normal communication protocols, such http/https/tcp.

my scenario bit different: each device assigned different port.

for example:

dev 1 port      = 2000 dev 2 port      = 2001 dev 3 port      = 2003 dev 50000 port  = 52000 

i want whole load balancing happen on reverse ssh tunnels' ports, tad different whole elb concept, start with.

i fine dns name such as: ports.my-domain.com.

then dns should hub of elb, , start/stop new ec2 servers whenever required, , port forwarding like:

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) ... 

obviously, servers 1.1.1.1 - 1.1.1.3 etc. started , managed elb.

when dev 1 establishing reverse ssh on port 2000, going assigned same ip: 1.1.1.1, sticky port concept there, although supported clb (aws classic load balancer), not work tcp ports...

i prefer: devices communicate ports.my-domain.com, , request tunneling like:

dev 1       -> ports.my-domain.com: 2000 dev 2       -> ports.my-domain.com: 2001 dev 50000   -> ports.my-domain.com: 52000 

internally, elb start server 1: 1.1.1.1 first 500 connections, 1.1.1.2 next 500 connections, till end, 50000th device registered on (maybe) 1.1.255.200

i want use forward domain name: ports.my-domain.com, , expect aws handle rest.

online aws tutorials gives different concepts implement, like: aws cloud watch, aws elastic bean stalk, aws cloud formation, aws container services (again: docker ports concept there different requirement) etc. these explanations not in direction.

would hear suggestion on technology stack gives best implementation requirement.

appreciate feedback...


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -