We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c765887 commit 0ddc4e0Copy full SHA for 0ddc4e0
tokenomics_decentralization/helper.py
@@ -633,7 +633,8 @@ def get_concurrency_per_ledger():
633
# and run in parallel without exhausting the system's memory.
634
if max_file_size > 0:
635
# When loaded in (a dict in) memory, each file consumes approx. 2.5x space compared to storage.
636
- concurrency[ledger] = int(system_memory_total / (2.5 * max_file_size))
+ # Limit processes to CPU count to avoid OS process management overhead.
637
+ concurrency[ledger] = min(os.cpu_count(), int(system_memory_total / (2.5 * max_file_size)))
638
# Find if some ledger files are too large to fit in the system's available memory.
639
if concurrency[ledger] == 0:
640
too_large_ledgers.add(ledger)
0 commit comments