In general, you assume that this should not happen.
In the case of access to external servers, this is not so. Your code should be fully aware of servers that may not respond, not respond on time, or not respond correctly. The HTTP process allows everything to go wrong. If you get to the server, you should be notified by the HTTP error code (although this does not always happen), but network problems can create useless answers.
Do not trust external input. This is the root of the problem.
In your particular case, you consistently increase the number of requests. This will create more requests, open sockets and other uses. To find a solution to your exact problem, you need enhanced access to the server so you can see the log files and monitor open connections and other problems. You can test this on a test server without any other software creating connections so that you can isolate the problem.
But how well you have experienced this, you have only uncertainties. For example, you can block external servers because you are making too many requests. You may be stuck with some security filters, such as DDOS filters, etc. Monitoring and adjusting the number of requests (automated or manual) will create the most stable solution for you. You can also simply accept these lost requests and simply process a stable queue that ensures that you receive the content at a specific point in time.
source share