Skip to content

Variables

Max concurrent processes per concurrency partition (stacksync_utils)

  • Variable name: max_concurrent_processes_per_concurrency_partition
  • Single source of truth: Helper functions in this package compute the value from an app’s rate limit.

Helpers

  • File: python-utils-3/stacksync_utils/configurations/max_concurrent_processes_per_concurrency_partition.py
  • calculate_max_concurrent_processes_per_concurrency_partition(rate_limit: int, frequency: int) -> int
  • calculate_max_concurrent_processes_per_concurrency_partition_from_app_schema(app_schema: dict) -> int

Formula

  • max(1, rate_limit // (2 * frequency))
  • Uses floor division and a 50% safety buffer; returns at least 1.

Intended usage

  • All services (Frontend-Logics, Connectors, Event-Forward) should call the *_from_app_schema helper when they have app_schema in scope, and avoid ad-hoc computations.
  • If a minimum of 2 is desired for persisted rows, apply that minimum at the persistence layer (not in the helper) to keep the helper consistent.