Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is nginx reload enough when updating GeoIP.dat

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?

like image 988
Valentin Stoianoff Avatar asked Sep 26 '22 05:09

Valentin Stoianoff


1 Answers

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.

like image 53
Marki555 Avatar answered Sep 30 '22 01:09

Marki555