Currently spice-server network bandwidth estimation is: send an empty ping packet to the client (and ignore it) ("warmup") send an empty ping packet and calculate time till pong is received ("latency") send a ping packet with data (256KB) and calculate time till pong ("roundtrip") bandwidth = datasize / (roundtip - latency)
Many times (e.g. fast LAN), "(roundtrip - latency)" is very small. This results with a falsely very high bandwidth. This patch makes the bandwidth calculation be bandwidth = datasize / roundtrip Suggested by Marc-André Lureau <marcandre.lur...@redhat.com> --- server/main_channel.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/server/main_channel.c b/server/main_channel.c index 43c0f3f..a4db724 100644 --- a/server/main_channel.c +++ b/server/main_channel.c @@ -812,7 +812,7 @@ static int main_channel_handle_parsed(RedChannelClient *rcc, uint32_t size, uint break; } mcc->bitrate_per_sec = (uint64_t)(NET_TEST_BYTES * 8) * 1000000 - / (roundtrip - mcc->latency); + / roundtrip; red_printf("net test: latency %f ms, bitrate %lu bps (%f Mbps)%s", (double)mcc->latency / 1000, mcc->bitrate_per_sec, -- 1.7.6.4 _______________________________________________ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel