Better HN
topnewbestaskshowjobs
Log inSign up

e-r-a-n

16 karma · joined Feb 13, 2019 (7y ago) · 5 submissions

Submissions

comment 7y ago · link · parent

How?

comment 7y ago · link · parent

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

comment 7y ago · link · parent

They are not idling. Look at the code.

comment 7y ago · link · parent

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

comment 7y ago · link · parent

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