Welcome! Log In Create A New Profile

Advanced

Re: Use of upstream keepalive_time

Maxim Dounin
February 02, 2023 10:18PM
Hello!

On Thu, Feb 02, 2023 at 01:03:13PM +0530, Vishwas Bm wrote:

> Can this keepalive_time be made infinite ?
> So that connection is not broken after default 1hr

There is no specific infinite value, though you can use a large
enough keepalive_time instead. Something like "keepalive_time 10d;"
should be a good replacement for "infinite".

Note though that this might not be a good idea for the reasons
outlined in the previous response.

[...]

> > The "keepalive_time" is a directive to limit total lifetime of the
> > connection, making it possible to free any resources associated
> > with the connection, notably allocated memory. Further, in some
> > setups it might be important to periodically redo connection
> > authentication, notably re-validate peer certificates.
> >
> > The "keepalive_time" directive is mostly equivalent to
> > keepalive_requests, which is documented as follows:
> >
> > : Closing connections periodically is necessary to free
> > : per-connection memory allocations. Therefore, using too high
> > : maximum number of requests could result in excessive memory usage
> > : and not recommended.
> >
> > Note though that keepalive_time is 1 hour by default, and reopening
> > connections once per hour is not expected to have any performance
> > impact. Rather, it is expected to be a hard limit on the total
> > connection lifetime on connections which are mostly idle and
> > therefore do not reach the "keepalive_requests" limit in a
> > reasonable time.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list
nginx@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Use of upstream keepalive_time

Vishwas Bm January 20, 2023 01:08AM

Re: Use of upstream keepalive_time

Maxim Dounin January 20, 2023 07:04PM

Re: Use of upstream keepalive_time

Vishwas Bm February 02, 2023 02:34AM

Re: Use of upstream keepalive_time

Maxim Dounin February 02, 2023 10:18PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 315
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready