A personal server running Apache2 started hanging under high traffic after a Reddit post went viral. After ruling out CPU/memory issues, mod_pagespeed, file descriptors, and TLS entropy exhaustion, the root cause was found: Apache's default log format uses %h (hostname), which triggers reverse DNS lookups for every client IP. Due to a DNS misconfiguration on the VPS, each lookup timed out after 30 seconds — twice per request — causing a consistent 60-second delay. Changing %h to %a (IP address) in all LogFormat directives resolved the issue instantly, allowing the server to handle 50,000+ requests without further problems.

7m read timeFrom cprimozic.net
Post cover image

Sort: