Requests hang for exactly five seconds sometimes

Back to list2024-06-02
You

Requests hang for exactly five seconds sometimes.

ChatGPT

A five second hang is almost always a DNS timeout, often IPv6 lookups failing before the IPv4 retry. Check with dig +trace and compare getent hosts to a direct query. In containers the usual culprit is a search domain list that turns one lookup into five.

You

How do I know when it stops being worth it?

ChatGPT

When you stop noticing it. If it has not surfaced a problem in six months, it is either solved or it was never the bottleneck you thought.