* Several performance optimizations for small IO.
1. Drain TCP receives until EAGAIN (i.e. EWOULDBLOCK) rather
than continuously polling. Limit the number of consecutive
receives for some rudimentary fairness across connections.
2. Don't acquire a mutex in the IO loop (is_light_turned_on())
and instead simply examine the boolean variable.
3. Use connected UDP sockets for sends (similar to Windows NTTTcp.)
4. Use send/recv rather than read/write.
A couple minor fixes to the project itself.
1. 'make clean' makes a best effort without root access.
2. Add a .gitignore.
* Revert some code shifting.
* Do not zero out receive buffer in IO loop.
* Simplify else if to else.
When redirecting the output to a file, the real-time throughput information
will be printed with escape sequences to clear the current line. This will
make it difficult to look at the results later and see if the throughput
changed during testing.
Print the escape sequence only if the terminal isn't a TTY, or if the $TERM
environment variable isn't set to "dumb".
Fix the error if PREFIX location does not have a bin/ folder:
azureuser@LinuxBox:~/ntttcp-for-linux/src$ make install PREFIX=/home/azureuser
cp ntttcp /home/azureuser/bin/
cp: cannot create regular file '/home/azureuser/bin/': Not a directory
make: *** [Makefile:48: install] Error 1
1. Add test warm-up and cool-down parameters to the XML log.
2. Add sync info in the XML log.
3. Avoid trying to sync with the receiver in the case of No-Sync.
When running this tool in test automation, users tend to write the output to a file.
In such cases, the real-time throughput is very annoying.
Added a new flag ('-Q', which means 'quiet') to disable the real-time throughput reporting.
Change below short options to long options for a better usability:
1. '-R' -> '--show-tcp-retrans'
2. '-K' -> '--show-nic-packets'
3. '-I' -> '--show-dev-interrupts'
1. Receiver has a delegated thread for sync (if this is not explicitly disabled). This sync thread is the last element of the thread array in receiver side code.
2. Sender does not have a delegated thread for sync; sender will use the main thread for sync.
Now implement the bandwidth limit by hold-on/pause the traffic in ntttcp application.
If the bandwidth is higher than the limit, then hold on senders to send traffic.
This bandwidth limit works for both TCP and UDP tests.
Future work: maybe we can increase the accuracy of the limit by:
a) more frequent throughput check;
b) or, set a range (high_water and low_water) to pause/resume the traffic.
* Use epoll() for sync connection. This is for the consideration of multiple node testing. Many connections have been established but a new sender node now wants to join (by sync first)
* Start to run throughput after all required connections created.
* Fix the error 115 issue of tcp connection
* Ignore the EINPROGRESS error when connecting to server
* Ignore the EINPROGRESS error and try to create new connection
* Wait 1 second before sending data