gnet-io / gnet-examples

Examples of gnet
MIT License
245 stars 77 forks source link

Questions on low latency websocket server with 10K concurrent clients? #14

Open indexk09 opened 2 years ago

indexk09 commented 2 years ago

Hi, @panjf2000 I have few questions on the websocket server

  1. Isn't this https://github.com/gnet-io/gnet-examples/blob/v2/websocket/server/websocket.go#L70 a blocking call?

  2. I am trying to build a websocket push based server that broadcasts a stream of notifications coming from a message bus to all the connected websocket clients . The requirement I have is super low latency, meaning the server should be able to broadcast messages to atleast 10K clients connected concurrently under 5ms. so the Question I have here is do I need to shard the 10K clients, and then manage state for active and disconnected clients and then process clients by shard myself or gnet does sll of this for me? Do you have any other suggestion on how best to accomplish this?