Since you're doing many queries, you should load the database into memory. As it stands, you're repeatedly reading from the disk, which is painfully slow.
Exchange this line:
gi = pygeoip.GeoIP('/path/to/GeoIP.dat')
to this:
gi = pygeoip.GeoIP('/path/to/GeoIP.dat', pygeoip.MEMORY_CACHE)