Estimated number of threads is only valid for workers
Hello 👋,
The check estimated_number_of_threads assumes a worker will always be started. In case the configuration specifies to boot only a scheduler or a dispatcher, the estimation will return three (main + heartbeat + threads for each worker) instead of two (heartbeat + dispatcher or heartbeat + scheduler).
Maybe the problems comes from the default value for thread_count, it is 1 when it should be 0 if no workers are specified in the configuration, WDYT?
I think the supervisor might need 3 connections as well: one for the main thread, one for the process maintenance task and one for its own heartbeat. The dispatcher, with default configuration, too: one for the polling, one for concurrency maintenance, and one for its heartbeat. I think 3 is a safe assumption so that you don't run out of DB connections, which is the purpose of this check.
I think 3 is a safe assumption so that you don't run out of DB connections, which is the purpose of this check.
Fair enough 👍, this function might need a rewrite tho, when we looked into it we felt it was too focused on workers.
On an other note, does your explanation also apply to the scheduler? I'm unsure it would need at least three (main + heartbeat + schedule_recurring_tasks) or if it depends on the number of recurring tasks to process at once (so main + heartbeat + n * schedule_recurring_tasks)
No, the scheduler should have enough with 2 (heartbeat + task scheduling).
Going to close this one as the estimation and error shown should be ok regardless of whether you configure workers or not.