2

We have a service that based on a local timer does a GET request to our server on Azure to transmit some information to be saved on the server. At this stage we are only testing and we are finding that some of the clients are synchronizing so they hit the server at the same time. This seems to be caused due to delays within the azure infrastructure (long story behind that), for example the database is unavailable for a minute or so. This causes the clients to synch up.

So the obvious answer for us is to introduce some randomness into the clients timer to ensure a reasonably even distribution on our server as the issue is when we go live it will kill our server if lots of clients are synchronized.

How much randomness is required to ensure the even distribution? Searching turns up lots on synchronization (esp. java) but not tips on the anti-synchronization.

The question comes in two forms: a) What is the correct terminology for this problem so that I can find either the right domain terms to get the theory behind this> b) Tips on how to define the amount of randomness other than just guessing and setting up elaborate trial and error testing.

Any help appreciated.

2

Two approaches come to mind.

Cron allows specifying what amounts to an order of magnitude rather than a specific time. If you need these clients to hit an endpoint on a fixed interval, this may be an attractive solution.

TCP handles collisions through exponential back off, which has the downside that it requires an irregular amount of time to complete. This can be a bit awkward unless your client is written as an asynchronous service. As the current behaviour already induces lag, it's more likely to improve performance than to degrade it.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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