⚖ Compare news

Put up to three stories side by side. Pick IDs from any article URL: /compare?id=123&id=456

«client prematurely closed connection», хотя пользователь никуда не уходил

habrahabr.ru ·Russian Federation · world
Words
60
Chars
409
AI summary
Yes
Full story

Nginx logs show 499, “client prematurely closed connection”, even when the user never left. Behind that code can be a load balancer timeout, a slow backend, and requests that keep running for nothing. Examples in Go, aiohttp, and Angie show where 499s come from and how they affect infrastructure. They also show how to distinguish an ordinary request cancellation from a server-side problem.

В логах nginx появляется 499, и кажется, что клиент просто закрыл соединение. Но за таким обрывом может скрываться таймаут балансировщика, медленный бэкенд и запросы, которые продолжают выполняться впустую. На примерах с Go, aiohttp и Angie разбираемся, откуда берутся 499, как они влияют на инфраструктуру и по каким признакам отличить обычную отмену запроса от проблемы на стороне сервера. Разобраться с 499

Open article