Re: [Spice-devel] [master PATCH 1/2] server: netstat: modify network bandwidth calculation

2011-10-19 Thread Uri Lublin

On 10/18/2011 11:53 PM, Yaniv Kaul wrote:

On 18/10/2011 19:20, Uri Lublin wrote:

Currently spice-server network bandwidth estimation is:
send an empty ping packet to the client (and ignore it) (warmup)


Useless. 'warmup' of what exactly? The TCP MSS and everything else is already
set by the TCP handshake and the RED initial connection packets.


I think this packet purpose is to wake up the client if it's idle, so the client 
overhead of PONGing back would be smaller.



send an empty ping packet and calculate time till pong is received (latency)


And now this can be dropped as well, if it's now used, right?


It doesn't take much to send an empty spice ping packet, a few bytes.
I guess both 'warmup' and 'latency' can be dropped, in the future. We need to 
rethink the way we measure bandwidth, and do more testing to see how those 
changes affect network statistic results in different network/load configurations.


___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [master PATCH 1/2] server: netstat: modify network bandwidth calculation

2011-10-18 Thread Uri Lublin
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) * 100
-/ (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


Re: [Spice-devel] [master PATCH 1/2] server: netstat: modify network bandwidth calculation

2011-10-18 Thread Alon Levy
On Tue, Oct 18, 2011 at 07:20:14PM +0200, Uri Lublin wrote:
 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)
 

ACK.

 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) * 
 100
 -/ (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
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [master PATCH 1/2] server: netstat: modify network bandwidth calculation

2011-10-18 Thread Yaniv Kaul

On 18/10/2011 19:20, Uri Lublin wrote:

Currently spice-server network bandwidth estimation is:
   send an empty ping packet to the client (and ignore it) (warmup)


Useless. 'warmup' of what exactly? The TCP MSS and everything else is 
already set by the TCP handshake and the RED initial connection packets.

   send an empty ping packet and calculate time till pong is received 
(latency)


And now this can be dropped as well, if it's now used, right?
Y.


   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é Lureaumarcandre.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) * 
100
-/ (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,


___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel