🧱 Chunk is a download manager for slow and unstable servers

Default 8 KiB chunk size means 655K HTTP requests per 5 GB download #17

Open cuducos.me
Open opened by cuducos.me

Problem

DefaultChunkSize is 8192 (downloader.go:24). For the stated use case (37 files, ~5 GB, slow server) the request count alone is the bottleneck; combined with the progress-file rewrite amplification it dominates runtime. A 1–4 MB default would cut both by 100–500× while staying under the 90 s per-chunk timeout for all but dead servers.

Secondary hazard

ChunkSize <= 0 yields an infinite loop in chunks (downloader.go:305-318). Consider a sane minimum.

Suggested fix

Raise the default chunk size and validate ChunkSize on use.

Sign up or Sign in to add to the discussion.