Welcome! Log In Create A New Profile

Advanced

Re: Routing to a certain worker

Maxim Dounin
July 23, 2018 03:16PM
Hello!

On Mon, Jul 23, 2018 at 01:53:21PM -0400, M.P. Ardhanareeswaran wrote:

> I understand the desire for worker processes to be symmetric.
>
> ProxyPass and upstream allow sticky session/session affinity
> which does introduce some skew though mighty useful IMHO.
>
> Do you have any thoughts about use of this?
>
> I am very new to handler development in NGINX. It appears that
> the handlers cannot do this and is heavily discouraged.

Normally, if a module needs some information to be shared between
worker processes, it uses shared memory zones:

http://nginx.org/en/docs/dev/development_guide.html#shared_memory

Sticky sessions use shared memory and therefore do not introduce
any inequalities between worker processes. Many other modules,
such as limit_conn and limit_req, do the same.

Unfortunately, your particular case as you've described it is
different, as you are trying to open a database connection and
keep it open for future requests. Unless a connection is statless
and can be re-opened on demand, this is won't be something
possible to implement within nginx worker model, because there are
no mechanisms to share connections between worker processes.

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

Routing to a certain worker

M.P. Ardhanareeswaran 410 July 23, 2018 10:46AM

Re: Routing to a certain worker

Maxim Dounin 164 July 23, 2018 10:48AM

Re: Routing to a certain worker

M.P. Ardhanareeswaran 160 July 23, 2018 11:26AM

Re: Routing to a certain worker

Maxim Dounin 172 July 23, 2018 11:36AM

Re: Routing to a certain worker

M.P. Ardhanareeswaran 147 July 23, 2018 01:54PM

Re: Routing to a certain worker

Maxim Dounin 179 July 23, 2018 03:16PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

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