Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replaced the pipes for communcation with a socketpair instead
I was not aware of socketpair existing until a few days ago. This basically functions exactly the same as the pipe implementation. Except that I only have 1 file descriptor for both sides, that are both read and write. Making book-keeping for it easier. However just like with the pipe implementation default performance is not great. That's why we're using the unix.SOCK_SEQPACKET setting. Which seems very similar to the O_DIRECT with the pipe2 call. Below is a iperf output with and without this setting. Without unix.SOCK_SEQPACKET: Accepted connection from 192.168.100.123, port 49020 [ 5] local 192.168.100.123 port 5201 connected to 192.168.100.123 port 49024 [ ID] Interval Transfer Bitrate [ 5] 0.00-1.00 sec 12.4 MBytes 104 Mbits/sec [ 5] 1.00-2.00 sec 9.26 MBytes 77.7 Mbits/sec [ 5] 2.00-3.00 sec 5.47 MBytes 45.9 Mbits/sec [ 5] 3.00-4.00 sec 8.44 MBytes 70.8 Mbits/sec [ 5] 4.00-5.00 sec 2.99 MBytes 25.1 Mbits/sec [ 5] 5.00-6.00 sec 12.6 MBytes 106 Mbits/sec [ 5] 6.00-7.00 sec 5.61 MBytes 47.0 Mbits/sec [ 5] 7.00-8.00 sec 5.39 MBytes 45.2 Mbits/sec [ 5] 8.00-9.00 sec 5.99 MBytes 50.3 Mbits/sec [ 5] 9.00-10.00 sec 4.88 MBytes 41.0 Mbits/sec - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate [ 5] 0.00-10.00 sec 73.1 MBytes 61.3 Mbits/sec receiver With unix.SOCK_SEQPACKET ccepted connection from 192.168.100.123, port 49678 [ 5] local 192.168.100.123 port 5201 connected to 192.168.100.123 port 49682 [ ID] Interval Transfer Bitrate [ 5] 0.00-1.00 sec 208 MBytes 1.75 Gbits/sec [ 5] 1.00-2.00 sec 213 MBytes 1.78 Gbits/sec [ 5] 2.00-3.00 sec 203 MBytes 1.70 Gbits/sec [ 5] 3.00-4.00 sec 207 MBytes 1.73 Gbits/sec [ 5] 4.00-5.00 sec 204 MBytes 1.71 Gbits/sec [ 5] 5.00-6.00 sec 205 MBytes 1.72 Gbits/sec [ 5] 6.00-7.00 sec 206 MBytes 1.73 Gbits/sec [ 5] 7.00-8.00 sec 212 MBytes 1.78 Gbits/sec [ 5] 8.00-9.00 sec 208 MBytes 1.74 Gbits/sec [ 5] 9.00-10.00 sec 213 MBytes 1.78 Gbits/sec [ 5] 10.00-10.00 sec 64.0 KBytes 300 Mbits/sec - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate [ 5] 0.00-10.00 sec 2.03 GBytes 1.74 Gbits/sec receiver
- Loading branch information