Simple test for testing end-to-end latency for established TCP connection. As a result, application outputs HDR histograms of either write latency and network connectivity latency.
- It establishes TCP connection over specified port and host (conterparty server is here as well)
- Sends 16-byte message
- Counterparty reads it and sends back
- We receives data and measure two timings:
- How much time did we write to socket on our side (time for 'write' syscall)
- How much time did we wait before data returned (time from 'write' syscall to end of 'read' syscall)
Therefore, we get two numbers. The first one is how much time did we send data to TCP stack. The second number is true TCP connection latency.
$ make download-modules
$ make all
In one shell:
$ HOST=CONNECTION_HOST make start-mirror
Here we copy 'mirror' executable to remove server and start it (on 12346 port)
Next, in another shell:
$ ./net_test CONNECTION_HOST 12346
Here we start 'net_test' itself. It will will connect to mirror server over TCP and make measurements.
As a result, you will get HDR histograms for write and transmition latency.
- CentOS 7.3
- Arch Linux