Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Speed up how quickly we launch new tasks #16660

Merged
merged 2 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/16660.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Reduce max concurrency of background tasks, reducing potential max DB load.
2 changes: 1 addition & 1 deletion synapse/util/task_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ async def wrapper() -> None:
self._running_tasks.remove(task.id)

# Try launch a new task since we've finished with this one.
self._clock.call_later(1, self._launch_scheduled_tasks)
self._clock.call_later(0.1, self._launch_scheduled_tasks)

if len(self._running_tasks) >= TaskScheduler.MAX_CONCURRENT_RUNNING_TASKS:
return
Expand Down