Welcome! Log In Create A New Profile

Advanced

Re: Geoip cache options patch

December 21, 2010 07:28AM
On Mon, Dec 20, 2010 at 06:24:26PM -0500, Akins, Brian wrote:

> On 12/20/10 5:56 PM, "Eugaia" <ngx.eugaia@gmail.com> wrote:
>
> > Each worker process will see virtual data usage of 50MB for the data,
> > but unless I'm mistaken, the overall system usage should still only be
> > 50MB because the data is shared in the same physical memory by the OS
> > until such a time that it's changed (which it won't unless you re-read
> > the config, and in which case it would change for all worker processes).
>
> I think with the memory cache it reads the entire geoip datafile into memory
> for each worker process - and the memory shows as resident for each process.
> At least when I switched to using mmap cache, the memory moved from resident
> to shared.

Did you see changes in free memory in top ? Linux/top may count differently
memory implicitly shared via fork() using copy on write method and memory
explicitly shared using mmap().

nginx calls GeoIP_open() in master process while (re)configuration, so
all workers get the same physical memory unless they will modify it.
I'm not sure, but I think that GeoIP does not modify the base after it
is loaded.

BTW when GeoIP_open() uses mmap(), it calls mmap() with MAP_PRIVATE flag,
which means that pages modified in a worker ceased to be shared between
workers, so basically there is no difference from malloc() method.


--
Igor Sysoev
http://sysoev.ru/en/

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

Geoip cache options patch Attachments

Akins, Brian 3006 December 20, 2010 01:30PM

Re: Geoip cache options patch

Akins, Brian 1094 December 20, 2010 01:38PM

Re: Geoip cache options patch

Igor Sysoev 1111 December 20, 2010 01:42PM

Re: Geoip cache options patch

Igor Sysoev 1123 December 20, 2010 02:00PM

Re: Geoip cache options patch

Akins, Brian 958 December 20, 2010 05:46PM

Re: Geoip cache options patch

Eugaia 1020 December 20, 2010 05:58PM

Re: Geoip cache options patch

Akins, Brian 981 December 20, 2010 06:26PM

Re: Geoip cache options patch

Eugaia 1041 December 20, 2010 07:42PM

Re: Geoip cache options patch

Igor Sysoev 1068 December 21, 2010 07:28AM

Re: Geoip cache options patch

Akins, Brian 1332 December 21, 2010 09:20AM



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

Online Users

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