[Glass] nginx least_conn

Otto Behrens otto at finworks.biz
Wed Jan 1 02:53:11 PST 2014


Hi,

If you are using nginx and have some load on your machine, setting
least_conn in your upstream section may improve your site's
responsiveness.

The particular case where it improves things for us is where we have
some requests that have been taking longer, for example reports. Yes,
we should optimise requests that take long and perhaps spawn bigger
reports in the background.

What happens with the default round robin load balancing is that the
unlucky request gets routed to the session that's busy with a request
that takes longer. Given that Seaside works with a callback and
rendering phase (2 requests), we found that with multiple users the
responsiveness of the site degrades quickly to the time it takes to
serve the longer requests.

This least_conn setting routes more requests to sessions that are not busy.

Hope this helps.
Otto


More information about the Glass mailing list