Hi,

I wrote a simple utility https://github.com/udhos/goben to test TCP 
throughput between two hosts.
At each endpoint, the tool spawns two goroutines: one for reading from 
net.TCPConn as fast as possible, other for writing into it as fast as 
possible.
However I'm consistently obtaining uneven rates like these:

2018/02/06 23:13:47 report clientReader rate:  20089 Mbps 125557 calls/s
2018/02/06 23:13:47 report clientWriter rate:    417 Mbps   2606 calls/s
2018/02/06 23:13:49 report clientReader rate:  18245 Mbps 114039 calls/s
2018/02/06 23:13:50 report clientWriter rate:   1295 Mbps   8097 calls/s
2018/02/06 23:13:51 report clientReader rate:  19722 Mbps 123263 calls/s
2018/02/06 23:13:52 report clientWriter rate:   2179 Mbps  13620 calls/s
2018/02/06 23:13:53 report clientReader rate:  15851 Mbps  99077 calls/s
2018/02/06 23:13:54 report clientWriter rate:   4274 Mbps  26718 calls/s

Notice the input rate (reader) is way higher than output rate (writer).

For comparison, this is the result from a single-threaded tool written in C 
(https://github.com/udhos/nepim):

                 kbps_in   kbps_out    rcv/s    snd/s
  3 cur     8 8873837.00 8950252.00 47920.50 34142.50
  3 cur     6 8655077.00 8654946.00 47166.50 33016.00
  3 cur     4 8773173.00 8772125.00 47800.50 33463.00
  3 cur     2 8700428.00 8700690.00 47408.50 33190.50
  3 avg     0 8730680.00 8745727.00 47481.90 33362.30
  3 min     0 8655077.00 8654946.00 47166.50 33016.00
  3 max     0 8873837.00 8950252.00 47920.50 34142.50

I guess I'm hitting some goroutine scheduling issue?

How can I improve scheduling fairness (?) in order to get similar loads on 
both directions?

Thanks,
Everton

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to