Webserver Connection Handling and Request Dropping
What Does Your Webserver Do When a User Hits Refresh? - Shopify

What Does Your Webserver Do When a User Hits Refresh? - Shopify

3/19/2013

What this post added

This post introduces a patch for the Unicorn webserver that adds a `check_client_connection` option. This feature allows Unicorn to test the client connection by attempting to write a small amount of data (an 'H' character) to the socket before invoking the application. If the write fails, indicating a disconnected client, the request is dropped, saving application server resources. This directly addresses the issue of wasted rendering time for clients that have already disconnected, particularly during high-traffic events like flash sales, and helps mitigate the occurrence of HTTP 499 responses logged by Nginx.

Read the original post ↗