GeoIP2 location tracking for high traffic instances

I’m looking into the location tracking options for Matomo. There is two options for reading GeoIP databases.

  1. Using PHP API to read the database.
  2. Using HTTP-server module.

The documentation says option 2 is faster and more accurate. But that solution only works with normal browser tracking. Then i saw there is an optional C extension for the PHP API used in option 1 recommended for high traffic instances. Is this solution equally good as solution 2 or is that still faster? Solution 1 with the C extension seems more simple and less complex than solution 2.


Using 1. with the C extension should be the easiest solution and faster than without the C extension.

But the only way to know how fast it is in your setup would be to try it out.

In case you have not found this page yet:

Thanks for the answer! Do you know if the http-module (solution 2) always is faster than 1 with the C extension? I read in this article that there was no performance metrics for the Nginx module. Is that still the case?


I don’t think that the http-module will be faster (or slower) than the PHP module (with C module) as after all they are doing the exact same lookup, just in one case Matomo does it and in the other one the webserver does it and Matomo trusts its output.

I don’t think anyone on the Matomo team is using the nginx module, but that doesn’t mean much apart from that you probably need to do some testing yourself.