3000 TcpClientsで1ポートをリッスンすることと、30TcpClientsで100ポートをリッスンすることの間に違いはありますか。
2 に答える
1
そうですね、TCPサーバーでは、100個に対して1個のリスニングソケットを開くことになります。100個のリスニングポートを管理するのは困難です。
各シナリオで接続数が同じであるため、TCPトラフィックの量は同じになりますが、非常に多くの異なるソケットを管理することで、より多くのオーバーヘッドが発生します。
サーバーの負荷を分散することが目標である場合、追加のリスニングポートを作成することは実際には解決策ではありません。
于 2013-03-22T18:02:35.360 に答える
0
Thats a bit Correct ,managing so many ports are difficult. but opening single port for so many for eg 1 serversocket for 3000 clients will surely degrade the performance and make lot of delay.
Now if two clients send data simultaneously, server can only process them sequentially. So second client won't get processed until server is done processing with first.
于 2013-03-22T18:11:56.867 に答える