Welcome! Log In Create A New Profile

Advanced

Re: Upstream with zone directive

Sergey Kandaurov
September 19, 2018 07:36AM
> On 17 Sep 2018, at 16:05, Johan Ekenlycka <johan.ekenlycka@tui.se> wrote:
>
> Hi!
>
> I am using ngx_lua_upstream module in OpenResty, which is calling ngx_http_get_module_main_conf(r, ngx_http_upstream_module). For some reason, I think the peer data is not correct when the zone directive is used in an upstream. But I am not really sure where in the source the config is parsed and peer/server data is populated.
>
> Can someone please get me some pointers to where I should look or even better if somebody could reaffirm and check the problem.

The ngx_lua_upstream module is not adapted to work with peers stored
in memory as a linked list, thus it cannot be used with upstream zone
that copies peers from configuration to shared memory one by one, thus
the peers' layout is effectively changed from an array to a linked list.
The problem you observe is that lua iterates peers by index as an array.

See this change as a guidance:
http://hg.nginx.org/nginx/rev/c44459611d91

--
Sergey Kandaurov

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

Upstream with zone directive

Johan Ekenlycka 374 September 17, 2018 09:06AM

Re: Upstream with zone directive

Sergey Kandaurov 179 September 19, 2018 07:36AM



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

Online Users

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