HTTP

HTTP 408Request Timeout

HTTP 408 Request Timeout means the server waited for the client to send a request (or finish sending one) and gave up. It typically arises on idle keep-alive connections, slow uploads or clients that open a connection and stall. It is distinct from 504, where the server is waiting on an upstream.

BlackhawkHub Editorial · Updated

What 408 means

After accepting a TCP connection, the server started a timer for the request headers (and separately for the body). If the timer expired before the request was complete, the server sent 408 and closed the connection. Clients are expected to retry with a new connection if they still want the resource.

When it happens

  • Idle keep-alive connections that a browser opened but never used. Apache logs these as 408 when RequestReadTimeout fires; they are harmless.
  • Slow uploads exceeding the body timeout.
  • Stalled clients: a script that opens a socket, writes half a request and hangs.
  • Slowloris-style attacks that deliberately hold connections open; timeouts are the defence.

408 versus 504

408504
Who was slowThe clientAn upstream server behind a proxy
FixClient retries, sends fasterOperator fixes the backend or raises proxy timeouts

Tuning

Apache: RequestReadTimeout header=20-40,MinRate=500 body=20,MinRate=500. nginx: client_header_timeout 15s; client_body_timeout 15s;. Raising these helps genuine slow uploads at the cost of holding resources longer per connection.

Frequently asked questions

Why do I see 408 in my server logs but never in the browser?

Browsers open speculative or keep-alive connections and sometimes never use them. When the server times those out with 408, nothing is displayed because no page was being requested. Such log entries are normal.

Is 408 caused by a slow internet connection?

It can be, for large uploads on a slow or unstable link where the body arrives too slowly. Retry on a better connection or in smaller chunks.

Sources