GeoIP: anyway to pull out lat/lon?

Phillip B Oldham phill at theactivitypeople.co.uk
Wed May 14 17:03:35 MSD 2008


OK, I've merged the files I need to, and have generated a geo.conf. The 
file size is huge: 140M! nginx actually fails to load on my virtual 
machine which has 300M dedicated ram.

Unless anyone has any further suggestions, it looks as though I'll have 
to code up a plugin to query the maxmind .dat file for the information.

Igor Sysoev wrote:
> On Wed, May 07, 2008 at 03:59:06PM +0100, Phillip B Oldham wrote:
>
>   
>> Looking into that further, the data I've got for lat/lon at city level 
>> adds up to 120Mb. I could convert this to a geo.conf file using 
>> geo2nginx.pl, but what sort of impact would this have on nginx running? 
>> Would each child process take up 120Mb ram? Would nginx slow down for 
>> each request having to work through such a large data set?
>>     
>
> We are using 141240 lines geo file:
>
> wc geo.conf 
>   141240  282480 2979471 geo.conf
>
> Could you show yours ? Also could you show pair lines of the file ?
>
> Performance should not depend on file size if you have enough memory.
> For geo map workers use the same memory inherited from parent on copy
> on write basis. But as there are no writes to this memory, it remain
> the same. Also duplicate values are stored only once.
>
> What does
>
> awk '{print $2}' geo.conf | sort | uniq | wc -l
>
> show ?
>
>   
>> Igor Sysoev wrote:
>>     
>>> On Tue, May 06, 2008 at 04:06:06PM +0100, Phillip B Oldham wrote:
>>>
>>>  
>>>       
>>>> I've just got the geo module working, and I've geo2nginx.pl'd the 
>>>> maxmind geolite country data which is working great. However, for our 
>>>> application I need to get more information (specifically a lat/lon) back 
>>>>         
>>> >from nginx to pass to PHP.
>>>       
>>>> Any way I can do this? Or is the geo module too simple for this task?
>>>>    
>>>>         
>>> The geo module simply maps ip to some string. You may use any strings.
>>> Probably you need to modify geo2nginx.pl to process lat/lon.
>>>       
>
>
>   

-- 

*Phillip B Oldham*
The Activity People
phill at theactivitypeople.co.uk <mailto:phill at theactivitypeople.co.uk>

------------------------------------------------------------------------

*Policies*

This e-mail and its attachments are intended for the above named 
recipient(s) only and may be confidential. If they have come to you in 
error, please reply to this e-mail and highlight the error. No action 
should be taken regarding content, nor must you copy or show them to anyone.

This e-mail has been created in the knowledge that Internet e-mail is 
not a 100% secure communications medium, and we have taken steps to 
ensure that this e-mail and attachments are free from any virus. We must 
advise that in keeping with good computing practice the recipient should 
ensure they are completely virus free, and that you understand and 
observe the lack of security when e-mailing us.

------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: phill.vcf
Type: text/x-vcard
Size: 261 bytes
Desc: not available
URL: <http://nginx.org/pipermail/nginx/attachments/20080514/d1d4bbe4/attachment.vcf>


More information about the nginx mailing list