Abnormal delays in download

Pierre Couderc pierre at couderc.eu
Mon Aug 2 12:46:03 UTC 2021

On 8/2/21 1:19 AM, Maxim Dounin wrote:
> Hello!
> On Sun, Aug 01, 2021 at 10:38:48PM +0200, Pierre Couderc wrote:
>> On 8/1/21 3:32 AM, Maxim Dounin wrote:
>>> Hello!
>>> On Fri, Jul 30, 2021 at 10:40:00AM +0200, Pierre Couderc wrote:
>>>> I am trying to download a 12M pdf file and it takes more than 4 minutes
>>>> with http nginx while it takes a few seconds with scp.
>>>> I have asked detailed log here https://paste.debian.net/1206029/
>>>> I see timeouts but I am not able to interpret them correctly.
>>>> nginx is in lxd container in a nearly not used  server (htop load
>>>> average 0.08 ...).
>>>> I use nearly defaut debian configuration of nginx.
>>> The logs provided suggest that the client is limiting download
>>> rather than nginx.  Further, the client seems to do at least 17
>>> various range requests to the file which is being downloaded, thus
>>> downloading many more than the file itself, but this is probably
>>> not the issue.  Rather, the issue seems that the client does not
>>> proceed with the file download while doing these requests.
>>> Try disabling Firefox PDF Viewer to see if it helps (Preferences
>>> -> General -> Applications -> Portable Document Format (PDF), set
>>> to "Save File", see [1]).  Alternatively, try using curl (or wget,
>>> or fetch, or whatever you prefer) to download the file instead of
>>> trying to view it in the browser.
>>> [1] https://support.mozilla.org/en-US/kb/view-pdf-files-firefox-or-choose-another-viewer#w_disable-the-built-in-pdf-viewer-and-use-another-viewer
>> Thank you very much, I had not the idea it could be a client such as
>> firefox, which I suppose bulletproof...
>> So I followed your idea and tried with wget : about  2 minutes 40s..
>> This is too much long too as with scp (in wifi at 2meters from the
>> server) it is only 3 seconds... ;)
>> Log is here (shorter ;) : https://paste.debian.net/1206278/
> No additional range requests now, though still looks limited by
> the client.  Any antivirus/firewall on the client (or on the
> server)?

No. I have not soon understood the interest of a firewall : either the 
port is closed and  I do not see the interest, either it is open and I 
can only trust the application which manages it...

All my clients are debian and have no antivirus or firewall and tests 
are done in the room where is the server.

nginx is in a lxd container with snap.

>   What happens if you download a random binary file of
> similar size instead of a pdf file?
It does not change, after copying ggg.pdf to ggg using wget : 

Time out seem to occur :

2021/08/02 14:39:10 [debug] 17204#17204: *22637 event timer add: 26: 
2021/08/02 14:39:15 [debug] 17204#17204: *22637 http run request: "/ggg?"

I have tried too with another client computer with equivalent results...

Thanks again.


More information about the nginx mailing list