Go websocket packages testing

I took the time to write a websocket library over the weekend, but I didn’t expect it to perform well.

ENV

RPS Benchmark


// 1000 connections, 500 messages/second, 1000 Byte Payload

tcpkali -c 1000 --connect-rate 500 -r 500 -T 30s -f assets/1K.txt --ws 127.0.0.1:${port}/connect

  • gws

Destination: [127.0.0.1]:8000

Interface lo address [127.0.0.1]:0

Using interface lo to connect to [127.0.0.1]:8000

Ramped up to 1000 connections.

Total data sent: 12919.8 MiB (13547411965 bytes)

Total data received: 12854.5 MiB (13478908970 bytes)

Bandwidth per channel: 7.178⇅ Mbps (897.2 kBps)

Aggregate bandwidth: 3594.175↓, 3612.441↑ Mbps

Packet rate estimate: 316194.9↓, 581166.7↑ (3↓, 2↑ TCP MSS/op)

Test duration: 30.0017 s.

  • gorilla

Destination: [127.0.0.1]:8001

Interface lo address [127.0.0.1]:0

Using interface lo to connect to [127.0.0.1]:8001

Ramped up to 1000 connections.

Total data sent: 7077.0 MiB (7420776528 bytes)

Total data received: 7089.8 MiB (7434174595 bytes)

Bandwidth per channel: 3.961⇅ Mbps (495.1 kBps)

Aggregate bandwidth: 1982.319↓, 1978.746↑ Mbps

Packet rate estimate: 272613.9↓, 173441.2↑ (2↓, 12↑ TCP MSS/op)

Test duration: 30.0019 s.

  • nhooyr

Destination: [127.0.0.1]:8002

Interface lo address [127.0.0.1]:0

Using interface lo to connect to [127.0.0.1]:8002

Ramped up to 1000 connections.

Total data sent: 5103.5 MiB (5351431830 bytes)

Total data received: 5140.6 MiB (5390317539 bytes)

Bandwidth per channel: 2.856⇅ Mbps (357.0 kBps)

Aggregate bandwidth: 1437.359↓, 1426.990↑ Mbps

Packet rate estimate: 135048.1↓, 124004.1↑ (1↓, 14↑ TCP MSS/op)

Test duration: 30.0012 s.

  • gobwas

Destination: [127.0.0.1]:8003

Interface lo address [127.0.0.1]:0

Using interface lo to connect to [127.0.0.1]:8003

Ramped up to 1000 connections.

Total data sent: 3364.6 MiB (3528061499 bytes)

Total data received: 3440.3 MiB (3607388324 bytes)

Bandwidth per channel: 1.893⇅ Mbps (236.7 kBps)

Aggregate bandwidth: 961.961↓, 940.808↑ Mbps

Packet rate estimate: 89305.6↓, 84530.8↑ (1↓, 18↑ TCP MSS/op)

Test duration: 30.0003 s.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.