From 4eb26e3a9608d41710200987a7123c2606a055e9 Mon Sep 17 00:00:00 2001 From: Guofang Date: Mon, 2 Nov 2026 21:00:02 +0800 Subject: [PATCH] Download with 16 aria2c connections by default Co-Authored-By: Claude Sonnet 5.5 --- download-images.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/download-images.sh b/download-images.sh index 139364d..3da1e31 100755 --- a/download-images.sh +++ b/download-images.sh @@ -139,8 +139,8 @@ Download one or more shared VM images. With no arguments, all targets are processed. The Debian/AlmaLinux/Fedora/Ubuntu image architecture (arm64 or amd64) is auto-detected from the host; override it with VM_IMAGE_ARCH. -When aria2c is installed and an image has several mirrors, the image is -downloaded from all of them at once, with one connection per mirror. +When aria2c is installed, an image is downloaded with 16 connections in total +(DOWNLOAD_CONNECTIONS, up to 16), spread across all its mirrors if it has several. Otherwise curl or wget downloads from the mirrors in order. The windows11 target is not part of "all". It downloads the Windows 11 ISO for @@ -305,16 +305,17 @@ download_single_source() { fi } -# Download to $partial with aria2c, splitting the file across all URLs with a -# single connection to each server. +# Download to $partial with aria2c, splitting the file across all URLs with up +# to DOWNLOAD_CONNECTIONS (default 16) connections in total and to each server. download_multi_source() { local partial="$1" shift + local connections="${DOWNLOAD_CONNECTIONS:-16}" aria2c \ --continue=true \ - --split="$#" \ - --max-connection-per-server=1 \ + --split="$connections" \ + --max-connection-per-server="$connections" \ --file-allocation=none \ --auto-file-renaming=false \ --max-tries=5 \