5

I use nginx with geo_module for MaxMind GeoIP paid DB. I put a cron script, which downloads a fresh MaxMind GeoIP paid DB every week and replaces the old GeoIP.dat file with the new one.

Is reloading the service after the replacement enough or do I need to restart it?

Valentin Stoianoff
  • 187
  • 3
  • 3
  • 11

2 Answers2

3

I have just checked it on nginx 1.81. The GeoIP database file is opened both by the master process and the worker processes. However, reload seems to be enough for both to load the new version of GeoIP.dat file (but both keep also the old/deleted version open).

What reload in fact does is that it spawns a new set of workers (which process new connections), while allowing the old workers to finish all of existing requests.

Marki555
  • 6,434
  • 3
  • 37
  • 59
  • Please note that the MaxMind's GeoIP database is obsoleted now and not updated anymore since March 2018. They have GeoIP2 (with free Lite version), but it has different API and format, so will need different nginx module. – Marki555 Jul 11 '18 at 12:38
1

Reload is enough to update geoip in nginx