uwsgi_ignore_client_abort
The 'uwsgi_ignore_client_abort' directive controls the handling of client disconnections during uWSGI responses.
Description
The 'uwsgi_ignore_client_abort' directive determines whether NGINX should continue processing requests to the uWSGI server even if the client has disconnected. When set to 'on', NGINX will ignore any early client aborts, which means it will proceed to send the request to the uWSGI application and await for processing to complete, regardless of the client's connection status. This can be beneficial for long-running requests where you want to ensure that the application handles all business logic, even if the response may not be delivered to the client.
By default, NGINX behaves in a way where if the client disconnects before the server is done processing the request, it will terminate the connection to the backend server, potentially disrupting any ongoing processing. With 'uwsgi_ignore_client_abort on;', the server will continue processing even in such scenarios, which may help avoid unnecessary resource handling and improve application throughput in certain use cases. This can help ensure that tasks initiated by the client, such as file uploads or intensive computations, are fully completed.
This directive can be specified within the contexts of 'http', 'server', and 'location', providing flexibility based on where you expect to handle requests in your configuration. It works with uWSGI module-specific configurations but does not affect other types of upstream modules, such as HTTP or gRPC proxies.
Config Example
location /long-request {
uwsgi_pass 127.0.0.1:9000;
uwsgi_ignore_client_abort on;
}If both 'uwsgi_ignore_client_abort' and connection timeout settings are not correctly managed, it may lead to resource wastage if clients disconnect frequently.
Using 'on' option without considerations for system resources may lead to unwanted execution of long processes, thus affecting overall performance.