Skip to content

Commit a541b02

Browse files
committed
minor tune
1 parent 16e91eb commit a541b02

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

src/otaclient/configs/_cfg_consts.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,31 +29,31 @@
2929
class StorageDeviceType(StrEnum):
3030
"""Classification of rootfs storage device performance tier.
3131
32-
L1: High-performance storage (NVMe SSD).
33-
L2: Medium-performance storage (SATA SSD).
34-
L3: Low-performance storage (eMMC, SATA HDD, or unknown).
32+
- L1: High-performance storage (NVMe SSD).
33+
- L2: Medium-performance storage (SATA SSD).
34+
- L3: Low-performance storage (eMMC, SATA HDD, or unknown).
35+
36+
Thread count ranges per storage tier (scaled by CPU count):
37+
38+
- L1 (NVMe SSD): 24 - 32 threads
39+
- L2 (SATA SSD): 16 - 24 threads
40+
- L3 (eMMC/HDD): 10 - 16 threads
3541
"""
3642

3743
L1 = "L1"
3844
L2 = "L2"
3945
L3 = "L3"
4046

4147
def map_device_rank_to_download_threads(self) -> int:
42-
"""Calculate download thread count based on this storage tier and CPU count.
43-
44-
Thread count ranges per storage tier (scaled by CPU count):
45-
L1 (NVMe SSD): 24 - 32 threads
46-
L2 (SATA SSD): 16 - 24 threads
47-
L3 (eMMC/HDD): 8 - 12 threads
48-
"""
48+
"""Calculate download thread count based on this storage tier and CPU count."""
4949
cpu_count = os.cpu_count() or 4
5050

5151
if self == StorageDeviceType.L1:
5252
threads = min(32, max(24, cpu_count * 4))
5353
elif self == StorageDeviceType.L2:
5454
threads = min(24, max(16, cpu_count * 3))
5555
else: # L3
56-
threads = min(12, max(8, cpu_count * 2))
56+
threads = min(16, max(10, cpu_count * 2))
5757

5858
logger.info(
5959
f"download threads calculated: {threads} "

0 commit comments

Comments
 (0)