For the archives.

go version go1.10rc2 linux/amd64

The tool uses the same loop code for both sending and receiving data.
Calling runtime.Gosched() in the top of the loop improved the behavior:

2018/02/07 21:26:40 report clientReader rate:   8277 Mbps  51741 calls/s
2018/02/07 21:26:40 report clientWriter rate:   7895 Mbps  49345 calls/s
2018/02/07 21:26:42 report clientReader rate:   8210 Mbps  51322 calls/s
2018/02/07 21:26:42 report clientWriter rate:   7800 Mbps  48753 calls/s
2018/02/07 21:26:44 report clientReader rate:   8347 Mbps  52177 calls/s
2018/02/07 21:26:44 report clientWriter rate:   7734 Mbps  48339 calls/s
2018/02/07 21:26:46 report clientReader rate:   7195 Mbps  44969 calls/s
2018/02/07 21:26:46 report clientWriter rate:   7451 Mbps  46574 calls/s

One can check the workLoop 
here: https://github.com/udhos/goben/blob/master/goben/client.go

Everton


Em quarta-feira, 7 de fevereiro de 2018 17:21:39 UTC-2, Everton Marques 
escreveu:
>
> 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