Users will be uploading files to my servers. In perl, how could I detect which server would be most suitable given a list of server ips and the users ip? I looked at MaxMind but it would only tell me the location of ips. How would I find the closest one?
Share
perhaps I am missing something but
IF you know the location of the IPs (of the servers and the user via MaxMind) just calculate the distance between every server ip versus the user ip and choose the smallest one…
EDIT – as per comment:
The physical distance doesn’t say much about performance… OTOH for measuring/comparing performance you would need to send test packets between the user and the servers and then compare/decide…
EDIT 2 – as per comment:
IF you only have one server per continent then the calculation is rather easy… check the continent of the user IP and choose the server accordingly since it is usually pretty safe to assmue that servers on a continent different from the user would perform worse…