GeoIP API Benchmarks

Below are benchmarks for several APIs.

C API

(mod_geoip, Perl XS, and PHP Extension APIs should have similar performance, since they wrap the C API.)

GeoIP Database Cache Queries/Second
GeoIP Country None 306,227
GeoIP Country GEOIP_CHECK_CACHE 291,169
GeoIP Country GEOIP_MEMORY_CACHE 7,284,470
GeoIP Country GEOIP_MEMORY_CACHE and GEOIP_CHECK_CACHE 4,514,672
GeoIP Region None 234,937
GeoIP Region GEOIP_CHECK_CACHE 247,439
GeoIP Region GEOIP_MEMORY_CACHE 5,090,656
GeoIP Region GEOIP_MEMORY_CACHE and GEOIP_CHECK_CACHE 3,440,317
GeoIP City None 120,475
GeoIP City GEOIP_INDEX_CACHE 1,180,004
GeoIP City GEOIP_MEMORY_CACHE 2,670,678
GeoIP City GEOIP_INDEX_CACHE and GEOIP_CHECK_CACHE 1,008,742

Java API

GeoIP Database Cache Queries/Second
GeoIP Country None 32,930
GeoIP Country GEOIP_MEMORY_CACHE 724,637
GeoIP Region None 63,965
GeoIP Region GEOIP_MEMORY_CACHE 692,840
GeoIP City None 24,469
GeoIP City GEOIP_MEMORY_CACHE 375,939

Pure PHP API

GeoIP Database Cache Queries/Second
GeoIP Country None 6,513
GeoIP Country GEOIP_MEMORY_CACHE 9,382
GeoIP Region None 7,900
GeoIP Region GEOIP_MEMORY_CACHE 8,402
GeoIP City None 5,462
GeoIP City GEOIP_MEMORY_CACHE 6,399

The benchmarks were run on an Intel Core i5 2.53 GHz machine with a SATA hard drive.