Insights

Thinking DDoS Only Floods Bandwidth? Application-Layer Slowloris Starves Connections Instead

November 15, 2026
0:00
Most server operators picture DDoS as a firehose: gigabits of junk traffic saturating the network link until nothing legitimate gets through. That mental model is accurate for volumetric attacks like UDP floods or DNS amplification, but it completely misses a different class of attack that barely registers on a bandwidth graph. Slowloris and its relatives work by holding open as many TCP connections as possible, sending just enough data to keep each one alive, until the web server has no connection slots left for real visitors. Your monitoring dashboard shows normal bandwidth. Your server is unreachable anyway.
To understand why Slowloris works, you need to know what happens between a client connecting and a response being sent. When a browser opens a TCP connection to your server, the kernel completes the three-way handshake (SYN, SYN-ACK, ACK) and places the new socket into the listen backlog queue. The web server daemon — Apache, Nginx, LiteSpeed, whatever you run — then calls accept() to pull that socket out of the kernel queue and assign it to a worker. What "worker" means depends on the server architecture:
  • Apache prefork MPM spawns a separate process per connection. Each process handles one request at a time. The MaxRequestWorkers directive (historically MaxClients) caps how many simultaneous connections Apache will serve. A common default is 256.
  • Apache worker/event MPM uses threads instead of full processes, so the ceiling is higher, but there is still a finite MaxRequestWorkers limit.
  • Nginx uses an event-driven loop. A single worker process can handle thousands of connections concurrently because it never blocks on a single socket. But even Nginx has a worker_connections limit per worker process.
  • LiteSpeed uses an event-driven architecture similar to Nginx, with its own connection pool limits.
The key point: every web server has a maximum number of simultaneous connections it will handle. Once that number is reached, new connections either queue in the kernel backlog (which is also finite, controlled by net.core.somaxconn and the listen backlog parameter) or get refused outright.
A volumetric flood tries to fill your pipe. Slowloris tries to fill your connection table. The mechanics are simple and that is what makes it effective.
  1. The attacker opens a TCP connection and sends the beginning of an HTTP request — typically just the request line and a few headers.
  2. Crucially, the attacker never sends the final blank line (\\r\ \\r\ ) that signals the end of the HTTP headers. The request stays incomplete.
  3. The web server has accepted the connection and allocated a worker to it. That worker is now waiting for the rest of the headers. It cannot serve anyone else while it waits.
  4. Periodically — every few seconds — the attacker sends another partial header line (like X-Whatever: keep-alive\\r\ ). This resets any read timeout the server might have, keeping the connection alive without completing the request.
  5. The attacker repeats this across hundreds or thousands of connections simultaneously.
From the server's perspective, each connection looks like a slow client that has not finished sending its request yet. Legitimate slow clients exist (mobile users on bad networks, for example), so the server patiently waits. Meanwhile, every worker slot occupied by a Slowloris connection is one fewer slot available for real traffic. With Apache prefork, an attacker holding 256 connections means zero workers left. The server is fully occupied doing nothing. Bandwidth usage during all of this is negligible — a few kilobytes per second total across all attack connections.
This is the core misconception. If your alerting only watches inbound Mbps or packet rate, a Slowloris attack looks like background noise. The traffic volume is tiny. There is no spike. The packets are valid TCP, valid HTTP fragments, nothing malformed. What does spike is the count of established connections and the count of connections in a waiting-for-request state. If you are not monitoring those metrics, you will not see the attack until users report that the site is down or connections are timing out. A quick way to check the current state on a Linux server:
BASH
# Count connections per state
ss -s

# Count established connections to port 80 or 443 grouped by source IP
ss -tn state established '( dport = :80 or dport = :443 )' | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -rn | head -20
Sample output format:
TEXT
    847 203.0.113.45
    612 198.51.100.12
      3 192.0.2.77
      2 192.0.2.50
      1 192.0.2.33
If one or a handful of IPs hold hundreds of connections each while your site is unresponsive, that pattern strongly suggests a connection-exhaustion attack. Legitimate traffic typically shows many IPs with a small number of connections each.
Connection counts give you the big picture. For confirmation, look at what those connections are doing. Apache's server-status page (if enabled) shows each worker's state. During a Slowloris attack, you will see a large number of workers stuck in the "R" (reading request) state for abnormally long durations. Normally, reading a request header takes milliseconds. If workers have been in "R" state for 30, 60, 120 seconds, something is wrong. For Nginx, the stub_status module exposes Active connections, Reading, Writing, and Waiting counts. A sudden jump in Reading with flat Writing is the same signal. Another angle: check your access log. Slowloris connections that never complete a request never generate an access log entry. If your connection count is high but your request rate in the access log is flat or dropping, incomplete requests are consuming your workers.
Upstream scrubbing services and network-level rate limiting help with volumetric floods but often pass Slowloris traffic right through, because each connection looks like a normal, low-bandwidth HTTP client. Defense needs to happen at the web server configuration. Set aggressive header read timeouts. The single most effective mitigation is limiting how long the server waits for a client to finish sending request headers. Apache has mod_reqtimeout (included by default in builds since around Apache 2.2.15). A reasonable configuration:
APACHE
# Require the full header within 20 seconds,
# granting 500ms extra per 500 bytes received.
# Require the full body within 30 seconds,
# granting 1 second extra per 1000 bytes received.
RequestReadTimeout header=20-40,MinRate=500 body=30-60,MinRate=1000
This means a client that sends headers too slowly — like a Slowloris attacker trickling one header every few seconds — gets disconnected after the timeout expires. Legitimate clients on slow connections still get through because the MinRate parameter extends the deadline proportionally to data actually received. Nginx handles this differently because of its event-driven model. Nginx is inherently more resistant to Slowloris since a slow connection does not block a worker process. However, it still consumes a connection slot and kernel memory. Relevant directives:
  • client_header_timeout — how long Nginx waits for the complete request header. Default is typically 60 seconds; lowering it to 10-20 seconds is reasonable.
  • client_body_timeout — same concept for the request body.
  • limit_conn module — caps how many simultaneous connections a single IP can hold.
LiteSpeed is event-driven like Nginx and similarly resilient by architecture, but still benefits from connection-per-IP limits and header timeouts. Limit connections per source IP. Even with timeouts, an attacker can keep opening new connections as old ones expire. Capping connections per IP addresses this. In Nginx, limit_conn_zone and limit_conn handle it. In Apache, mod_limitipconn or firewall rules (iptables/nftables connlimit match) achieve the same thing. A limit of 20-50 concurrent connections per IP is reasonable for most sites; adjust based on your traffic patterns. Switch from prefork to event MPM (Apache). If you are still running Apache with the prefork MPM, you are maximally vulnerable to Slowloris because every connection pins an entire process. The event MPM handles keep-alive and idle connections in a dedicated listener thread, freeing worker threads for active requests. This does not eliminate the vulnerability, but it raises the bar significantly. Use a reverse proxy. Placing Nginx or HAProxy in front of Apache is a common pattern. The reverse proxy absorbs slow connections with its event-driven architecture, only forwarding complete requests to Apache. Apache workers never see the slow client and never get pinned.
Slowloris targets the request header phase, but the same principle applies elsewhere in the HTTP lifecycle:
  • Slow POST (R.U.D.Y.) — sends the request headers normally, declares a large Content-Length, then trickles the body one byte at a time. The server waits for the full body before processing.
  • Slow read — sends a complete request but reads the response extremely slowly, or sets a tiny TCP receive window, forcing the server to keep the connection and response buffer open.
All of these exploit the same fundamental gap: the server allocates resources to a connection before the transaction is complete, and the attacker delays completion indefinitely. The mitigations are the same family: timeouts, connection limits, and event-driven architectures that do not dedicate a worker to each connection. For deeper mitigation at the kernel and packet level — dropping malicious traffic before it even reaches the web server process — techniques like XDP and eBPF can inspect and drop packets in the network driver, well below the application layer. That approach is covered in Bypassing the Kernel Network Stack: Building Line-Rate DDoS Mitigation with eBPF and XDP, though it is more relevant to volumetric floods than to slow HTTP attacks.
If your DDoS monitoring only watches bandwidth and packet rate, add connection-state monitoring. Track established connections per IP, workers in reading state, and the ratio of connections to completed requests. Set mod_reqtimeout or equivalent header/body timeouts on every web server you manage. Limit concurrent connections per source IP at the web server or firewall level. If you run Apache prefork, seriously consider switching to the event MPM or fronting it with an event-driven reverse proxy. These are not exotic hardening steps — they are baseline configuration for any internet-facing web server. The attack tool is trivial to run, and the fix is configuration, not hardware.

Join My Newsletter & Get Updates!

Get notified whenever a new technical guide, server infrastructure breakdown, or personal reflection goes live, plus a curated weekly digest.