Requesting a remote web API and local MySQL database during a traffic spike?

We implement some code on our home page, which depends on the search for geoinformation for each unique vistor, and we have the choice to request the geoip web service (Maxmind) or to download the database and query it locally. Currently, the server is a 512 MB Linode instance and receives about 1,500 unique data per day, however we are worried about what happens during a burst of traffic.

It is clear to me that local search will be faster, but, of course, when loading the database it will be much larger than when working with an additional HTTP request. Obviously, updating server memory is easily achieved if the local route is the best route. I would suggest that within a certain number of connections per second, the server is more likely to become inaccessible to query its local database than the web api (provided, of course, that the api web servers can handle HTTP requests).

Any contribution is welcomed in which the solution is the most reliable long-term solution for handling random traffic flow without any denial of service.

EDIT: just try quantifying it a little further, let's say the server should be able to handle up to 200 connections per second. Each connection requires one DB request or an HTTP request.

+5
source share
4 answers

Given 200 views per second, you definitely want to go with a local database. I doubt that any third-party website providing such a service would want to handle many requests, but even if they are probably much slower than accessing the local database.

, . , . , 1 1/2 Linux- 32 , - 1000 .

200 . , .

+1

- , . , 200 , .

gis, ( ), . , , .

: http://blog.jcole.us/2007/11/24/on-efficiently-geo-referencing-ips-with-maxmind-geoip-and-mysql-gis/ , . 2000 / 1 . , gis, mysql, . , 2007 , .

. , , LookupService, . -, . URI json maxmind, maxmind .

+1

- . , -, 200 q/s, ... 72 . !

0

Maxmind, .dat , ( 500 ) - . , . Ad, Maxmind, , 10, 25 50 .

API , , Geo. , , Geo.

0

All Articles