Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I wasn't sure whether this was best suited to SO or SF, I originally posted this on SO - Link to original - but it seems to me now that it probably is better suited to SF. Moderators please feel free to close either if it obvious to you.

We're implementing some code on our homepage that depends on a geoip lookup for every unique vistor and we have a choice of querying a geoip web service (Maxmind) or downloading the geoip database and querying it locally. The server is currently a 512MB Linode instance and only receives around 1500 uniques per day however we are concerned what will happen when during a traffic spike. Obviously upgrading the servers memory is easily achieved if going local is the best route. Using the database locally is marginally cheaper and therefor not a factor.

  1. Which solution in your opinion would likely give us a faster page load speed when the server is not under load?
  2. Which solution is more likely to survive when the site gets hit with a flood of traffic? Assuming we have to avoid caching.
share|improve this question

Clearly, querying a local database will be faster than sending HTTP request to a remote server especially if your database is setup properly. However, you need to updated your database periodically to stay up-to-update with current geoip mappings unless you can live with a somehow inaccurate/out-dated data.

share|improve this answer
Thanks for your input. Yes, it's clear to me that the lookup would be faster but under load hitting the database would be more ram/CPU intensive than processing an additional http request. I would imagine that over a certain number of connections per second, the server would be less likely to become unavailable querying a webapi than its local database. And yes, we have a subscription to keep the database up to date. – Michelle May 6 '12 at 13:20
You can also reach a point when the remote server does not respond to your http request quickly (or does not respond at all). They should have some limit on maximum number of requests. – Khaled May 6 '12 at 13:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.