Closed matjazp closed 5 years ago
@matjazp it is a good finding. I knew it is happening but I didn't know that it is so predictive (every 1000 requests). I am still waiting for httpx parallel requests to be implemented https://github.com/encode/httpx/pull/52 before a switch to httpx. If it is not gonna happen soon I implement automatic reconnect after 999 images.
If this is a new feature for httpx, we should test it thoroughly before using it in production. Low hanging fruit is to just send pics in batches of 999. This should be fairly simple change, yes? I vote for implementation as soon as possible, as now this always sends extra load over network...
also look at the debate at https://github.com/encode/httpx/issues/258
I've been testing a new version of the backend. There seems to be a problem with sending more than 999 images.
Sending 1000 images throws an exception and the last 100+ reqs in a last "minibatch" (up to http2 max_concurrent_streams, usually 128) is sent again (seen in logs as retry=1).
Everything is OK when batch is 999:
But even if I send 2 or even 4 parallel connections with 999 each, everything is OK.
A quick fix appears to be to send pics to the server in batches of no more than 999 in one connection and/or make parallel connections. We should also replace Hyper (see #146).