<div dir="ltr">Thank you both for the awesome input. Running stat on a file each time a request comes in is something I would like to avoid. Would it be possible to go by the varnishd uptime instead, and trigger database checks every N seconds instead? We're looking to push around 5k req/s on average which is why I'm trying to avoid the added syscalls.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 28, 2016 at 9:16 AM, Thomas Lecomte <span dir="ltr"><<a href="mailto:thomas.lecomte@virtual-expo.com" target="_blank">thomas.lecomte@virtual-expo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sat, Nov 26, 2016 at 3:22 PM, Andrei <<a href="mailto:lagged@gmail.com">lagged@gmail.com</a>> wrote:<br>
</span><span class="">> Hello all,<br>
><br>
> I was wondering if there were any preferences among the community on which<br>
> vmod (from <a href="https://varnish-cache.org/vmods" rel="noreferrer" target="_blank">https://varnish-cache.org/<wbr>vmods</a>) to use for geolocation, and why.<br>
> My main concerns are of course speed, resources and accuracy. The ones I'm<br>
> looking over from the vmods page are:<br>
><br>
> ip2location - <a href="https://github.com/thlc/libvmod-ip2location" rel="noreferrer" target="_blank">https://github.com/thlc/<wbr>libvmod-ip2location</a><br>
<br>
</span>Hello Andrei,<br>
<br>
I will talk only about ip2location since I'm the developer behind it.<br>
As it only implements some bindings to the C library provided by<br>
ip2location, the overhead is pretty minimal.<br>
<br>
The accuracy depends on the freshness of you IP2location database. Its<br>
UNIX mtime is checked at each call and the database is reloaded on the<br>
fly if the file has been updated. Our varnish servers don't handle a<br>
lot of requests per second so I can't say wether it is able to cope<br>
with more than 1000 req/s without increasing the CPU load.<br>
<br>
I only implemented the bindings we needed, that's why I don't provide<br>
full bindings to the whole library yet. I can add some if you need<br>
them.<br>
<br>
Thanks,<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Thomas Lecomte | Sysadmin @ Virtual Expo<br>
</font></span></blockquote></div><br></div>