Welcome! Log In Create A New Profile

Advanced

Re: Nginx with big geo maps affects whole system performance on reload

August 03, 2021 01:00PM
Thanks for your quick answer!

>> I'm running Nginx 1.20.1 on CentOS 8.4.2105 with a quite large geo maps,
>> including country/isp/connection for both IPv4 and IPv6, with raw size about
>> 80Mb.
>> Hardware is: 2x Intel(R) Xeon(R) Silver 4116 CPU @ 2.10GHz, 64Gb RAM
>>
>> On nginx testconf or reload I'm experiencing increase of running nginx
>> latency, 99th percentile growth from 10ms to seconds.

[...]

> Loading large geo map can be quite expensive, that's expected:
> nginx has to parse all the records provided in text and build
> corresponding radix tree. Make sure you have enough spare CPU and
> free memory to actually do the work without affecting other tasks
> on the server. In particular, in my practice it is a good idea to
> make sure the number of nginx worker processes is less than number
> of available cores, or you'll risk getting high latencies when
> doing CPU-intensive tasks like parsing geo maps or compressing
> logs.

I followed this path but did not reach the end.
Currently I set workers processes twice less than physical cores number,
but this does not affect situation. Next step should be start nginx under taskset
and set workers affinity to other cores but this sounds hacky for me.

> Also it might be a good idea to switch to using ranges and a
> separate include file, so nginx will be able to cache parsing
> results in a binary file.

According to [1] ranges does not support IPv6 for now.
Is there a chance to request this via feature request?

[1]: https://github.com/nginx/nginx/blob/master/src/http/modules/ngx_http_geo_module.c#L732
Subject Author Posted

Nginx with big geo maps affects whole system performance on reload

SannisDev August 03, 2021 09:13AM

Re: Nginx with big geo maps affects whole system performance on reload

Maxim Dounin August 03, 2021 10:42AM

Re: Nginx with big geo maps affects whole system performance on reload

SannisDev August 03, 2021 01:00PM

Re: Nginx with big geo maps affects whole system performance on reload

Maxim Dounin August 03, 2021 01:48PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 72
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready