microsoft / ntttcp-for-linux

A Linux network throughput multiple-thread benchmark tool.
https://github.com/Microsoft/ntttcp-for-linux
MIT License
389 stars 92 forks source link

Add some changes to support 500K connections #58

Closed lubaihua33 closed 3 years ago

lubaihua33 commented 3 years ago
  1. Extend the connections established timeout time. When the connections are more than 50K, the connections established time is longer than 10s. When the connections are more than 300K, the established time may be longer than 1000s. Set the CONNS_ESTAB_TIMEOUT to 1200 to make sure all the connections can be established.
  2. Changed the SOCKET_TIMEOUT_SEC to 30, which will be more stable when creating huge connections.​
  3. If the user doesn't pin the client source port, don‘t bind on the client-side.
lubaihua33 commented 3 years ago

When we add '-f' and '-V' option, we can see the source port.

# ntttcp -s10.0.0.4 -P 5 -n 1 -t 5 -W 1 -C 1 -b 64k  --show-tcp-retrans -V -f 5001
……
01:34:18 DBG : New connection: local:5005 [socket:4] --> 10.0.0.4:5005
01:34:18 DBG : New connection: local:5002 [socket:6] --> 10.0.0.4:5002
01:34:18 DBG : New connection: local:5001 [socket:5] --> 10.0.0.4:5001
01:34:18 DBG : New connection: local:5004 [socket:7] --> 10.0.0.4:5004
01:34:18 DBG : New connection: local:5003 [socket:8] --> 10.0.0.4:5003

When we didn't add '-f', the local port is assigned by the kernel.

# ntttcp -s10.0.0.4 -P 5 -n 1 -t 5 -W 1 -C 1 -b 64k  --show-tcp-retrans -V
……
01:36:23 DBG : New connection: local:53792 [socket:5] --> 10.0.0.4:5002
01:36:23 DBG : New connection: local:11454 [socket:8] --> 10.0.0.4:5005
01:36:23 DBG : New connection: local:51360 [socket:6] --> 10.0.0.4:5003
01:36:23 DBG : New connection: local:29156 [socket:4] --> 10.0.0.4:5001
01:36:23 DBG : New connection: local:29354 [socket:7] --> 10.0.0.4:5004