Echo (WebSocket)
Measures WebSocket echo throughput. Each connection upgrades via HTTP/1.1, then sends text messages and receives echoes. Each echo counts as one completed response.
Connections: 512, 4,096, 16,384 Pipeline: 16 (messages in flight per connection)
Workload
- Open TCP connection to port 8080
- Send HTTP/1.1 upgrade request to
/ws - After receiving
101 Switching Protocols, switch to WebSocket framing - Send text frames containing
"hello", receive echo frames - Measure messages per second
What it measures
- WebSocket upgrade handshake performance
- WebSocket frame parsing and construction efficiency
- Echo round-trip latency under load
- Connection scalability for real-time workloads
Expected upgrade request/response
GET /ws HTTP/1.1
Host: localhost:8080
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==
Sec-WebSocket-Version: 13HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=Parameters
| Parameter | Value |
|---|---|
| Endpoint | /ws (WebSocket upgrade) |
| Connections | 512, 4,096, 16,384 |
| Pipeline | 16 (messages in flight) |
| Message | "hello" (5 bytes, text frame) |
| Duration | 5s |
| Runs | 3 (best taken) |
| Load generator | gcannon --ws |