Should `keepalive_timeout` be removed from Nginx config?

Solution 1:

Nginx closes keepalive connections when the worker_connections limit is reached.

That's true.

  • src/core/ngx_connection.c:l843 - ngx_drain_connections();
  • src/http/ngx_http_request.c:l3042 - ngx_reusable_connection(c, 1);