0

Question: copied from the below link

During a designing of a client/server architecture, is there any advantage to multiplexing multiple WEBSOCKET connections from the same process to the server (i.e. sharing one connection) vs opening one WEBSOCKET connection per thread/session in the client (as is typically done when connecting to memcached or database servers.)

I'm aware about the overhead associated with each connection (e.g. RAM ...). But expect to have less than 1K-10K at the most in each client side.

According to Design/Architecture: web-socket one connection vs multiple connections, the good consensus (given by the answer) seems to be a compromise between the two approaches, in having a limited number of threads/sessions per websocket connection and multiplex between them, such as 3 threads/sessions per websocket connection. This seems to be a good medium between 1 thread/session per websocket connection and (total # threads/sessions) per websocket connection.

Is there a way or rule of thumb in choosing this number so that we still enjoy benefits of OS packet joining from the only one connection approach, higher general throughput from the full connection approach, etc? For example, (total # threads/sessions) / 3?

Jonathan Lee
  • 153
  • 7

0 Answers0