Welcome! Log In Create A New Profile

Advanced

Re: Nginx logging phase

Maxim Dounin
October 29, 2020 11:52AM
Hello!

On Thu, Oct 29, 2020 at 06:23:59PM +0530, Vikas Kumar wrote:

> Do you have a recommendation on what handlers are suitable for my use case?

In nginx itself, proper approach to count in-flight request would
be:

1. Increment the counter only if no module's cleanup handler is installed
in the request pool. This way the counter can be incremented
in any phase, which makes it possible to do this in a
particular location. If the handler is called multiple times,
additional calls are simply ignored.

2. Once the counter incremented, install module's cleanup handler
to decrement the counter. This ensures that the counter is
always properly decremented when the requst is freed.

This is more or less what limit_conn module does (except it uses
some bits in the request structure to optimize checking if the
cleanup handler is installed).

No idea though if something similar can be done with the Lua
module you are trying to use.

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

Nginx logging phase

Vikas Kumar October 28, 2020 04:46AM

Re: Nginx logging phase

Maxim Dounin October 28, 2020 09:30AM

Re: Nginx logging phase

Vikas Kumar October 29, 2020 08:56AM

Re: Nginx logging phase

Maxim Dounin October 29, 2020 11:52AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 137
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