Catalogue / moczadlo-2024-http-request-cannon

One engineer built a Go and fasthttp sender on Kubernetes that pushed 500 million raw HTTP/1.1 requests to 2.5 million hosts in a couple of hours

Not named; the author, Dawid Moczadło, describes it as his own project, 2024. Bulk raw HTTP/1.1 request sender for security scanning.

Organisation
Not named; the author, Dawid Moczadło, describes it as his own project
Evidence
Reported from production
System
Bulk raw HTTP/1.1 request sender for security scanning
As of
2024
Source
How I sent 500 million HTTP requests to 2.5 million hosts

moczadlo.com, published 2024-07-04

Architecture

A Go program pipes three worker pools (request generation, sending, response handling) through concurrency-safe queues. It runs as pods on Kubernetes on DigitalOcean, scaled up and down by a small script according to how many targets are queued.

Section: Designing the HTTP/1.1 sending cannon | Section: Scalling the cannon with Kubernetes | Section: Custom autoscroller

Components

ComponentRoleWhere
Request generation poolProduces the hand-crafted HTTP/1.1 requests to send.Section: Designing the HTTP/1.1 sending cannon
Sender poolGoroutines that each take a fasthttp client from a pool, send a raw request to a pre-resolved IP, and return the client.Section: Designing the HTTP/1.1 sending cannon | Near: I created n (number of HTTP Sender | Section: Skipping DNS resolution
Response handler poolProcesses the responses coming back from the sender pool.Section: Designing the HTTP/1.1 sending cannon
massdnsResolves all target DNS records before sending starts, so no request waits on DNS.Near: I just used massdns
Queue serviceReceives regular pings from each sender pod as proof that the pod is still alive.Near: Each HTTP cannon pod was pinging queue
Custom autoscaler scriptA JS script that calls the Kubernetes API to scale the sender Deployment up and down by how many targets are queued.Section: Custom autoscroller

Figures, as the source states them

FigureAs statedNoteWhere
HTTP/1.1 requests sent in the run500,000,000 requestsTotal over the run, which took a couple of hoursNear: Sent 500 million HTTP/1.1 requests to 2.5
Target hosts2,500,000 hostsTotal over the runNear: Sent 500 million HTTP/1.1 requests to 2.5
Upper end of reported per-pod request rate400 requests per secondUpper end of the stated range of 100 to 400 per podNear: Each pod achieved 100-400 requests per second
Pods at peak scale60 podsMaximum the autoscaler reachedNear: It scaled from 0 to 60 pods | Near: Scaled to 60 pods
Hosts per work chunk200 hostsNear: split the work into 200 hosts per
Time before the first request byte on a new connection160 millisecondsApproximate; DNS plus new TLS connection to a fast site, measured from the author's machineNear: my server spent ~160ms before sending a

Records

Decision#d1

Send hand-crafted requests with a forked fasthttp client in Go, skipping request normalisation and DNS lookups

moczadlo-2024-http-request-cannon#d1 at corpus version 26a1b3a7e3dd
Chosen

The sender is written in Go on the fasthttp library, forked to drop its per-request normalisation and to add a method for sending raw, non-RFC-compliant requests. Each request dials an already-resolved IP directly through an overridden Dial function.

Near: I ended up with fasthttp library | Section: Optimizing the library | Section: Skipping DNS resolution

Rejected

Rust. The author tried it but found async tokio types too hard to work with.

Near: Yes, I tried implementing it in Rust

Go's standard net/http client. The author knew it was not the fastest; fasthttp's benchmarks claim its client is up to 10 times faster.

Section: Choosing right HTTP library

What forced it

The requests had to reach many different hosts on different networks, so the author could not rely on reusing connections, and in his laptop tests DNS plus a new TLS connection to a fast site took about 160ms before the first byte; the requests were also hand-crafted, so parsing and normalising them was wasted work.

Near: I can't rely on reusing connections | Near: my server spent ~160ms before sending a | Near: We are crafting HTTP/1.1 requests by hand

Reasoning

The author picked Go for simplicity, concurrency support and speed, and removed whatever steps could be removed from each request, preferring not to build performant DNS resolution himself.

Near: I chose Go because it is simple | Section: How can we optimize it?

Outcome

The author reports that removing the normalisation step saved a lot of CPU cycles.

Near: but it saved a lot of CPU

Decision#d2

Pipe separate worker pools for generating, sending and handling requests through concurrency-safe queues

moczadlo-2024-http-request-cannon#d2 at corpus version 26a1b3a7e3dd
Chosen

Three worker pools (request generation, sender, response handler) are joined by concurrency-safe queues, and objects and memory are reused instead of creating new objects and goroutines per request.

Section: Designing the HTTP/1.1 sending cannon

Reasoning

The author likes simplicity and wanted to reuse as many objects and as much memory as possible.

Section: Designing the HTTP/1.1 sending cannon

Outcome

The author's own verdict is that it worked great: each part was separate and could be scaled on its own, and it was easy to debug and reason about.

Near: It worked great, each component was separated

Decision#d3

Run the sender as pods on DigitalOcean Kubernetes, fed chunks of 200 hosts and scaled from queue length by a small script

moczadlo-2024-http-request-cannon#d3 at corpus version 26a1b3a7e3dd
Chosen

Work is split into chunks of 200 hosts, each run to completion by a single worker before it moves on. Pods run on Kubernetes on DigitalOcean, and a JS script calls the Kubernetes API to scale the Deployment by the number of queued targets.

Section: Splitting the work into chunks | Section: Scalling the cannon with Kubernetes | Section: Custom autoscroller

What forced it

The job had to cover 2.5 million hosts with about 200 requests each without overwhelming any one target server, so the load had to be spread across many servers.

Near: I had 2.5 million hosts and wanted | Near: we do not want to overwhelm any

Reasoning

The author wanted the run done in a couple of hours. Chunks were meant to finish within a couple of minutes yet be big enough not to waste time on new connections; he found 200 optimal and wanted to limit the requests lost when failure-prone pods died. DigitalOcean was chosen for cost, as it gives 2TB+ of bandwidth per droplet and the job sent terabytes.

Near: ideally in a couple of hours | Section: Splitting the work into chunks | Section: Scalling the cannon with Kubernetes

Outcome

The autoscaler took the deployment from 0 to 60 pods in a couple of minutes.

Near: It scaled from 0 to 60 pods

Failure#f1

The sender's own traffic saturated the network, so pod liveness pings were lost and kubelet killed the pods

moczadlo-2024-http-request-cannon#f1 at corpus version 26a1b3a7e3dd
Trigger

The pods generated so much traffic that the author describes it as DDoSing himself; DigitalOcean's network could not cope.

Section: DDoS as a Service

How it failed

Each pod pinged the queue service to show it was alive, but under its own outbound load the pings were not sent at all, and after a couple of minutes kubelet killed the pod.

Near: Each HTTP cannon pod was pinging queue

Impact

Kubelet killed sender pods after a couple of minutes without pings.

Near: after a couple of minutes kubelet would

Fix

The author gives this as another reason to decrease the number of hosts per chunk; the post does not say what size was used before or after.

Near: It was another reason to decrease the

Review

Extracted by
Claude (feed 74)
Human review
Not started. Status recorded on 2026-12-02.