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

Commit

Permalink
Speed up how quickly we launch new tasks (#16660)
Browse files Browse the repository at this point in the history
Now that we're reducing concurrency (#16656), this is more important.
  • Loading branch information
erikjohnston authored Nov 17, 2023
1 parent d9dcfe2 commit 6088303
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
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

0 comments on commit 6088303

Please sign in to comment.