From 5b28ab1c4931036441d46771173d70a95683bc73 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 26 Apr 2026 09:44:57 -0500 Subject: [PATCH] Cap download_content_many at 8 workers (was 16) --- esphome/external_files.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/esphome/external_files.py b/esphome/external_files.py index 0cf6ab70065..d4f2649a105 100644 --- a/esphome/external_files.py +++ b/esphome/external_files.py @@ -121,10 +121,11 @@ def download_content(url: str, path: Path, timeout: int = NETWORK_TIMEOUT) -> by # Cap concurrent connections so a config with hundreds of remote files doesn't -# open hundreds of sockets at once. 16 is wide enough that wall time is -# dominated by the slowest single request for normal configs (a couple dozen -# files), and tight enough to be polite to the upstream host. -DEFAULT_DOWNLOAD_WORKERS = 16 +# open hundreds of sockets at once. 8 matches the requests connection-pool +# default and the per-host connection limit browsers use, which keeps us +# polite to the upstream host while still cutting wall time roughly 8x for +# typical configs (a couple dozen files). +DEFAULT_DOWNLOAD_WORKERS = 8 def download_content_many(