Hello!

There is a request for api on the page. There is a limit of 5 requests per second from the VC.

If the user encounters an error that the maximum number of requests in one second to this application is exceeded, then a redirect to the same script is triggered after 2 seconds, and the request is executed again.

Here I am interested in one thing, that if the request is executed immediately, for example, 100 users. What will happen then?

Logically, all of them in 2 seconds with a redirect will go to repeat the request.

And I wonder, 5 people out of a hundred will still fulfill the request? After that, 95 people should remain, then after another 2 seconds, 5 people will fulfill the request, and so on.

Or none of these 100 people will fulfill the request again and they will again go to the request in 2 seconds. and so on to infinity?

  • one
    Why not execute? 5 out of 100 if everyone makes one call. - xEdelweiss
  • Can randomly determine the number? from 1 to 5 seconds Each person will be updated in different ways, maybe the load will be distributed in such a way? and at different times everyone will fulfill requests, well, and everything will flow faster? - PHPcoder
  • At least 100 users cannot simultaneously press the .. lag in a split second button, but there will be. Also, the request time may be different for everyone - depending on the connection speed, and also how quickly the contact server requests load ... that is, even if everyone clicks exactly at the same time, the answer will come to everyone at a time ... so someone after of the first message yes ahead of everyone - Alexey Shimansky
  • It is not necessary to engage in such calculations, it does not depend on you. - Daniel Shatz

0