Skip to content

zemamba/http_web_performance_server_go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go HTTP Performance Server

High-throughput HTTP server for load testing. It responds with a tiny JSON body and is optimized for maximum requests per second (RPS) under heavy pipelining.

Response format

  • HTTP/1.1 200 OK
  • Body: {"r":<0..9999>} with a random value per request

This server uses a minimal HTTP parser to count \r\n\r\n boundaries, which is intentionally fast and sufficient for benchmarking.

Features

  • Extremely fast response path using precomputed HTTP responses
  • Keeps connections alive and supports aggressive pipelining
  • Lightweight per-second RPS logging
  • Simple, dependency-free Go codebase

Requirements

  • Go 1.25+
  • macOS or Linux

Build and Run

go build -o server .
./server

The server listens on :8007.

Logging

The server prints a startup line and then logs RPS once per second:

2026/02/03 13:02:10 rps=7571783 total=76440064

If running in the background, a common pattern is:

./server >/tmp/fast-metrics.log 2>&1 &
tail -f /tmp/fast-metrics.log

Load Testing (wrk)

pipeline.lua is included and uses an aggressive pipeline size.

wrk --latency -t12 -c 1000 -d 10s -s pipeline.lua http://127.0.0.1:8007/metrics

To push higher RPS, run multiple wrk processes in parallel:

for i in 1 2 3 4; do
  wrk -t12 -c 1000 -d 10s -s pipeline.lua http://127.0.0.1:8007/metrics &
done
wait

Tests

If your system restricts access to the default Go build cache, run:

GOCACHE=/tmp/go-build go test ./...

Notes

  • This server is designed for performance testing, not full HTTP compliance.
  • The response payload is intentionally minimal to maximize throughput.

About

High-throughput HTTP server for load testing on Go

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors