e-r-a-n
Re:Handling 1M websocket connections in Go
on Thursday February 14, 2019 @03:54PM (#19165914)
How?
Re:Handling 1M websocket connections in Go
on Wednesday February 13, 2019 @05:10PM (#19157600)
The idea behind going all the way down to epoll is to reduce the memory footprint by around 30%
otherwise, with every goroutine stack consuming 4-8KB, it's not feasible to go with 1goroutine-1websocket approach
Re:Handling 1M websocket connections in Go
on Wednesday February 13, 2019 @05:05PM (#19157556)
They are not idling. Look at the code.
Re:Handling 1M websocket connections in Go
on Wednesday February 13, 2019 @04:50PM (#19157419)
If you look at the server implementation, the client messages are also read and parsed, but are not printed to stdout for demonstration purposes (otherwise it hard to keep track)
You can uncomment that printf instruction and see that it still performs nearly the same way
Re:Handling 1M websocket connections in Go
on Wednesday February 13, 2019 @04:46PM (#19157384)
And most linux distros limits the ephemeral range even further to about 30K ports
If you take a deeper look, the solution uses Docker to connect clients from different network namespaces to mitigate this