svenstaro/miniserve

Limited upload speeds

rtkpX opened this issue · 9 comments

rtkpX commented

Program works perfectly, but when uploading files to the server, the upload speed seems to be limited to around 10Mbit, even with 1Gbit or 100Mbit upload capable networks. Upload speeds work fine on other apps and websites, but I can't figure out how to upload at more than 10Mbit/s, it's a big issue when dealing with decently big files, even 50MB.

Plus there's no upload bar so I've got no idea how much progress it got.

I'm afraid I don't really have an idea why this would be. Only thing that comes to mind is that your client requests transfer compression (which miniserve does support) and so the overhead of the compression might slow it down for local transfers. Could you try uploading with curl and not setting any specific transfer compression headers?

rtkpX commented

I'm afraid I don't really have an idea why this would be. Only thing that comes to mind is that your client requests transfer compression (which miniserve does support) and so the overhead of the compression might slow it down for local transfers. Could you try uploading with curl and not setting any specific transfer compression headers?

Both server and client are on Windows, and not using local area network transfer.

What's the client application? You could try finding an option to disable requesting transfer compression if you use a desktop browser (though I don't really know which browser allows you to easily do that). Alternatively, we could look into adding an option to miniserve to disable transfer compression with a flag and then see whether that does anything for you.

rtkpX commented

What's the client application? You could try finding an option to disable requesting transfer compression if you use a desktop browser (though I don't really know which browser allows you to easily do that). Alternatively, we could look into adding an option to miniserve to disable transfer compression with a flag and then see whether that does anything for you.

Firefox and Chrome, both seem limited, download speed is fine though

I just checked whether my browser actually sets a Content-Encoding but it does not appear to do so. Therefore, transfer compression might not actually be the issue. I wonder, does miniserve spike in CPU usage while you're uploading?

I just checked and I'm able to sustain 900MiB/s upload speed on miniserve so I don't think it's a technical limitation of the software. I'll check the Windows version now.

Using Firefox and the 0.22 Windows release I can get about the same speed, roughly 1GiB/s. Frankly I have no idea what might be wrong on your side. :/

rtkpX commented

@svenstaro After some testing, the issue is HTTPS, when the server is HTTPS it allow uploads at around 7Mb/s, but when it's HTTP, it's unlimited.

Edit: Upload speeds are not affected when on a local network, I guess cause the certificate isn't valid then, and I'm guessing when connecting directly to the public IP it's not affected either since the certificate isn't valid there either.

Hm I wonder whether this is CPU-bound on either the client or the server? Could you check CPU usage on both during uploads?

rtkpX commented

Hm I wonder whether this is CPU-bound on either the client or the server? Could you check CPU usage on both during uploads?

CPU on Server increases around a 2%. Still, 7Mbps.