I'm trying to simultaneously download multiple files. How am I to determine an optimal number of files to download in parallel?

有帮助吗?

解决方案

Impossible to answer - that depends on many factory that are outside of your control, mostly latency, packet loss.

The optimal number will use up all bandwidth with as few connections as possible. This may vary, over time, over download location (same server, not) and may have limits imposed from the other side.

Make it configurable, start with something like 2-4 connections to start.

其他提示

There are many components surrounding the issue. How many request the server (file host) can handle effectivly, what is the file size, what is the user pc specs, how many threads can it handle, and many more...

I would rather for simplicity leave this vairable as user configurable via UI so that user can set the value according to his own experince and needs.

To complement the existing answers: Latency at the server and network is very important. When the server takes 1000ms to respond you might need 100 connections to saturate the system.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top