advice on writing simple http backend for use with nginx
mdounin at mdounin.ru
Thu Sep 6 23:36:41 MSD 2007
On Thu, 6 Sep 2007, Bert Douglas wrote:
> I am writing an application specific http backend for use with nginx.
> Any advice is welcome.
> Where are potential problems?
> I some specific question about how nginx talks to http backends.
> (1) Is connection always closed after every request/response?
> Or do I need to keep connection open?
Currently, nginx uses only HTTP/1.0 connections to backends (and not uses
Keep-Alive). So connection is opened/closed for each request.
> (2) is only one connection opened at a time to same backend?
> Or do I need to accept multiple connections (at same time)?
You should accept as many connections as you are able to process. If not
accepted, connections will hang in listen queue of your backend and will
be eventually timed out by nginx (resulting in 502 error sent to client or
trying next upstream, depending on your server configuration).
More information about the nginx