Welcome! Log In Create A New Profile

Advanced

Re: Geoip cache options patch

December 20, 2010 07:42PM
Hi,

On 21/12/2010 01:24, 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
The reading of the data is done by the master process at conf-read time,
and this happens before the main process forks to the worker processes.
> - 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.
According to :

http://en.wikipedia.org/wiki/Fork_(operating_system)#Fork_and_page_sharing

(and I'm assuming whatever OS you're using does this), the pages for the
child process are shared with the parent process, until they are
changed. Since the data is being read into pool-allocated pages that
won't (under normal circumstances) change once you fork to the child
process, these pages will remain unchanged and will (probably) still be
shared between all process, master and worker.

I'm guessing that although the underlying pages are probably shared, the
data utilized by each process will probably show as being 'resident',
and thus this can't be used as a good indicator to the actual total
physical memory usage.

Nevertheless, adding a mmaping option is a nice addition.

Marcus.

_______________________________________________
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 2473 December 20, 2010 01:30PM

Re: Geoip cache options patch

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

Re: Geoip cache options patch

Igor Sysoev 835 December 20, 2010 01:42PM

Re: Geoip cache options patch

Igor Sysoev 829 December 20, 2010 02:00PM

Re: Geoip cache options patch

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

Re: Geoip cache options patch

Eugaia 731 December 20, 2010 05:58PM

Re: Geoip cache options patch

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

Re: Geoip cache options patch

Eugaia 733 December 20, 2010 07:42PM

Re: Geoip cache options patch

Igor Sysoev 794 December 21, 2010 07:28AM

Re: Geoip cache options patch

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



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

Online Users

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