maxmind / geoip-api-mod_geoip2

DEPRECATED GeoIP Legacy module for Apache 2
Other
50 stars 22 forks source link

Allow multiple GeoIPFlag's on GeoIPDBFile config line #10

Closed pprindeville closed 10 years ago

pprindeville commented 10 years ago

It may be handy to use IndexCache together with CheckCache, especially if one is subscribed for automatic updates of the database. This patch allows mixing and matching flags.

borisz commented 10 years ago

This change introduce undesired side effects. mod_geoip use currently around used-memory = 1 x database-size no matter how much childs you use. But this change turns the memory usage into used-memory = childs x database-size with MemoryCache | CheckCache. The updates and lookups are not locked. Running lookups return undefined results or segfault until all childs use the same database. This is b/c the childs use the updated data but expect the old database. The MMAP | CheckCache mode must find a way to wait until all running lookups finished and lock the childs. Then update the database and release the childs.

I think the best way to update the database is to send apache the usr1 signal once a week or daily.

pprindeville commented 10 years ago

Isn't that a separate issue having to do with locking and threads?

borisz commented 10 years ago

Not really. It might count as separate task, but it hast to be solved before we enable updates from the plugin. But what I'm saying is the patch should not dramatically increase the memory usage. It must be stable even during database updates and work with as much Apache MPMs as possible.

pprindeville commented 10 years ago

Isn't that a usage issue, though? What if someone is using it from a single process/thread?