大网数据广告活动
服务器运维问答

Why are concurrent downloads faster

· 52CE 我爱测

Many download managers like this , this and this support downloading a file over multiple parallel connections, one per thread. The concept is that each connection will download one part of the file separately. For example if the…

问题原文

原帖链接 · Anmol Singh Jaggi · CC BY-SA 4.0

Many download managers like this, this and this support downloading a file over multiple parallel connections, one per thread. The concept is that each connection will download one part of the file separately.
For example if there are 5 connections, then the first connection is going to download the first 0-20% portion of the file, second connection will download 20-40% portion and so on..

Similarly, on the server side, there will be 5 threads, where one thread will be reading 20% of the file in parallel.
But, I thought that trying to concurrently read a single file with multiple threads will actually make the download significantly slower, since the read head of the mechanical disk will have to do more seeks than before.
Even if we assume that the disk controller queuing mechanism is intelligent enough to batch all the 5 multipart requests to a single file together in one sequential read, it does not give us any advantage over doing the read in one just one thread and then serving the file over just 1 http connection.

So how are parallel downloads to a file faster?

已采纳解答

原帖链接 · a3nm · CC BY-SA 4.0

My understanding is that downloading different file parts in parallel is only useful when the bottleneck is the network connection: either the upload bandwidth of the server from which you download, or the bandwidth of the network between the server and you. When these links are saturated, the available bandwidth will be divided up across the connections, and in some cases it could be divided evenly across connections. So if you have 5 connections open then you would be getting a larger share of the bandwidth than if you only have one.

Of course, this doesn't work if the server and network are sharing the bandwidth in a more clever way, e.g., by allocating the share between client IPs instead of connections.

When the bottleneck is disk IO on the server or client, then indeed this strategy will not help, and could even harm performance because the reads and writes will be less sequential. Also, when the bottleneck is the available bandwidth between your ISP and modem (which I'd say is maybe the most common case), then parallel downloads should neither harm nor help.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2020-05-01)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。