D
D
darkdiver2014-07-14 13:30:45
ASP.NET
darkdiver, 2014-07-14 13:30:45

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

4 answer(s)
C
Cyril, 2014-07-14
@llirikkkk

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...

D
darkdiver, 2014-07-14
@darkdiver

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.

M
Mykola Dzedzinskyi, 2014-07-14
@dzedzinskiy

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

V
Vitaly, 2014-07-21
@vipuhoff

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 question

Ask a Question

731 491 924 answers to any question