Subject: [hybi] Server bandwidth test with and without masking

From: Andy Green <[email-masked]>
Date: Sun, 30 Jan 2011 21:38:41 +0000

Hi -

This describes an 04 pingflood test against an 04 server on the same 
machine, both with 04 masking enabled compliant to the standard, and the 
same test done with all the per-frame masking computation and XOR action 
disabled both on the pingflood client and the server.

I repeated each test twice, and on two machines.

2.6.38-rc2 Core i7 laptop:   Masked: 2346KiB/s, 2270KiB/s
                            Unmasked: 4427KiB/s, 4244KiB/s

2.6.18     Athlon 64 box :   Masked: 1020KiB/s, 1021KiB/s
                            Unmasked: 1321KiB/s, 1251KiB/s

These bandwidth numbers are formed from 64 byte PING payloads only (ie, 
no framing or TCP/IP overhead is counted), and they are KiBs (1024 
bytes).  It's using the libwebsockets built-in sha-1.

To reproduce:

libwebsockets 990d5062d007dcd11f51b
git clone git://git.warmcat.com/libwebsockets

For the masking ON test, just run

  $ libwebsockets-test-server

and

  $ libwebsockets-test-ping localhost -r1 -f -i0

For masking OFF test, just run

  $ libwebsockets-test-server -k

and

  $ libwebsockets-test-ping localhost -r1 -f -i0 -k

Actual results -->

Core i7 x86_64 laptop MASKING ON  two runs

$ libwebsockets-test-ping localhost -r1 -f -i0
handshake OK for protocol lws-mirror-protocol
Websocket PING localhost.localdomain (127.0.0.1) 64 bytes of data.
. 

--- localhost.localdomain websocket ping statistics using 1 connections ---
847595 packets transmitted, 847595 received, 0% packet loss, time 22576ms
rtt min/avg/max = 0.040/0.092/40.121 ms
payload bandwidth average 2346.447 KiBytes/sec

$ libwebsockets-test-ping localhost -r1 -f -i0
handshake OK for protocol lws-mirror-protocol
Websocket PING localhost.localdomain (127.0.0.1) 64 bytes of data.
. 

--- localhost.localdomain websocket ping statistics using 1 connections ---
852018 packets transmitted, 851798 received, 0% packet loss, time 23451ms
rtt min/avg/max = 0.040/0.087/40.050 ms
payload bandwidth average 2270.140 KiBytes/sec

Commodity rented x86_64 Athlon 64 server MASKING ON two runs

# libwebsockets-test-ping localhost -r1 -i0 -f
handshake OK for protocol lws-mirror-protocol
Websocket PING localhost.localdomain (127.0.0.1) 64 bytes of data.

--- localhost.localdomain websocket ping statistics using 1 connections ---
467501 packets transmitted, 467501 received, 0% packet loss, time 28625ms
rtt min/avg/max = 0.070/0.140/40.202 ms
payload bandwidth average 1020.715 KiBytes/sec

# libwebsockets-test-ping localhost -r1 -i0 -f
handshake OK for protocol lws-mirror-protocol
Websocket PING localhost.localdomain (127.0.0.1) 64 bytes of data.

--- localhost.localdomain websocket ping statistics using 1 connections ---
528528 packets transmitted, 528528 received, 0% packet loss, time 32332ms
rtt min/avg/max = 0.055/0.136/39.605 ms
payload bandwidth average 1021.665 KiBytes/sec

Core i7 laptop Masking OFF two runs

$ libwebsockets-test-ping localhost -r1 -f -i0 -k
handshake OK for protocol lws-mirror-protocol
Websocket PING localhost.localdomain (127.0.0.1) 64 bytes of data.
. 

--- localhost.localdomain websocket ping statistics using 1 connections ---
1505933 packets transmitted, 1489349 received, 1% packet loss, time 21025ms
rtt min/avg/max = 0.027/0.151/39.993 ms
payload bandwidth average 4427.229 KiBytes/sec

$ libwebsockets-test-ping localhost -r1 -f -i0 -k
handshake OK for protocol lws-mirror-protocol
Websocket PING localhost.localdomain (127.0.0.1) 64 bytes of data.
. 

--- localhost.localdomain websocket ping statistics using 1 connections ---
1180166 packets transmitted, 1172265 received, 0% packet loss, time 17263ms
rtt min/avg/max = 0.026/0.131/40.494 ms
payload bandwidth average 4244.110 KiBytes/sec

Commodity rented x86_64 Athlon 64 server Masking OFF two run

# libwebsockets-test-ping localhost -r1 -i0 -f -k
handshake OK for protocol lws-mirror-protocol
Websocket PING localhost.localdomain (127.0.0.1) 64 bytes of data.

--- localhost.localdomain websocket ping statistics using 1 connections ---
654099 packets transmitted, 651687 received, 0% packet loss, time 30814ms
rtt min/avg/max = 0.055/0.114/39.316 ms
payload bandwidth average 1321.801 KiBytes/sec

# libwebsockets-test-ping localhost -r1 -i0 -f -k
handshake OK for protocol lws-mirror-protocol
Websocket PING localhost.localdomain (127.0.0.1) 64 bytes of data.

--- localhost.localdomain websocket ping statistics using 1 connections ---
586050 packets transmitted, 585806 received, 0% packet loss, time 29260ms
rtt min/avg/max = 0.038/0.161/1218.389 ms
payload bandwidth average 1251.272 KiBytes/sec

-Andy

---

From: Greg Wilkins <[email-masked]>
Date: Mon, 31 Jan 2011 10:29:16 +1100

Andy,

Great!

To make it easier to grok the results, I've put them in a google spreadsheet:

https://spreadsheets.google.com/ccc?key=0ApsJ-Kl6lVTkdHl2RnFiYmhWQ0p6T0hkNzkzMEJXd0E&hl=en_GB&authkey=CL7OiLYK

Chart image also attached.

cheers