Answer the question
In order to leave comments, you need to log in
How to choose the best mirror for WebService?
There are several geographically distributed servers running the same Web services (mirrors).
Let's say we have 3 service mirrors:
https://ru.site.ru/webservice.asmx
https://us.site.ru/webservice.asmx
https://hk.site.ru/webservice.asmx
How to choose for client's fastest mirror?
Answer the question
In order to leave comments, you need to log in
the obvious option: measure the request / response time from each and choose the optimal
dumb option: check the client's position and choose the closest one in the hope that it will be the fastest, but somehow...
Here a question in that also consists, how to measure speed of access?
I do not want to reinvent the wheel, there is probably a standard solution.
It is possible to write a javascript function using a timer and downloading a small amount of information from each server, or not from each, depending on the results. Based on this data, choose the one that took less time, then substitute the appropriate url.
The result can be stored in a database on the server if users register, otherwise in localstorage
You can use WatchDog and measure the time from the start of the request (synchronous) to the receipt of the result. Only from personal experience, it is necessary to take into account not the first request to the service, but the second and further, because in the first connection overhead.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question