Nginx reload process in detail

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Nginx reload process in detail

rnburn
We have a persistent connection to Nginx on which we are issuing https
requests. Now when we do a reload, the persistent connections (the requests
which are already accepted) are failing as soon as the reload was issued.
Those connections are being dropped. Is this the expected behavior?

In the Nginx documentation, it was mentioned that the older worker process
would continue to run untile they have served the accepted inflight requests
and then would go down. But the actual behavior seems to be different as the
persistent connections are being dropped as soon as a configuration reload
was issued.

To add to the above question, while reload was in progress, i am trying to
establish a new connection and its not being established. Can't the new
worker processes which were spawned as a result of configuration reload,
straight away serve the incoming new connections?

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,273904,273904#msg-273904

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: Nginx reload process in detail

Alex Samad
Thats what support have advised me, reload finished the current request and then closes the connection.  No longer honors the long lived

Alex

On 27 April 2017 at 19:21, shivramg94 <[hidden email]> wrote:
We have a persistent connection to Nginx on which we are issuing https
requests. Now when we do a reload, the persistent connections (the requests
which are already accepted) are failing as soon as the reload was issued.
Those connections are being dropped. Is this the expected behavior?

In the Nginx documentation, it was mentioned that the older worker process
would continue to run untile they have served the accepted inflight requests
and then would go down. But the actual behavior seems to be different as the
persistent connections are being dropped as soon as a configuration reload
was issued.

To add to the above question, while reload was in progress, i am trying to
establish a new connection and its not being established. Can't the new
worker processes which were spawned as a result of configuration reload,
straight away serve the incoming new connections?

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,273904,273904#msg-273904

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx


_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: Nginx reload process in detail

Francis Daly
In reply to this post by rnburn
On Thu, Apr 27, 2017 at 05:21:06AM -0400, shivramg94 wrote:

Hi there,

The rough description of the reload process is available by searching
for "nginx control" or "nginx reload"; the exact details are available
in the source.

> In the Nginx documentation, it was mentioned that the older worker process
> would continue to run untile they have served the accepted inflight requests
> and then would go down. But the actual behavior seems to be different as the
> persistent connections are being dropped as soon as a configuration reload
> was issued.

You have used the words "process", "requests", and "connections"
above. You should be aware that they refer to different things.

The intention of a "graceful" shutdown of worker processes is that
current idle connections will be closed, while current active requests
will complete and then their connections will be closed.

That seems to match what you are reporting, but perhaps I am missing
something.

> To add to the above question, while reload was in progress, i am trying to
> establish a new connection and its not being established. Can't the new
> worker processes which were spawned as a result of configuration reload,
> straight away serve the incoming new connections?

I believe that nginx should allow new connections to be established
and be handled by the new workers during an "nginx -s reload" invocation,
or when the master process receives a HUP signal.

Can you show a test case where that does not happen?

What nginx version do you use? How do you invoke the reload? Can you
show the new connection failing to be established, perhaps in "tcpdump"?

Cheers,

        f
--
Francis Daly        [hidden email]
_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx