summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erikj@matrix.org>2023-11-17 16:36:02 +0000
committerGitHub <noreply@github.com>2023-11-17 16:36:02 +0000
commit6088303efb0f1498401718797941542089c2d432 (patch)
tree0ae5123e0ab36be68baee867e6b7159fb073c1fe
parentBump requests-toolbelt from 0.10.1 to 1.0.0. (#16659) (diff)
downloadsynapse-6088303efb0f1498401718797941542089c2d432.tar.xz
Speed up how quickly we launch new tasks (#16660)
Now that we're reducing concurrency (#16656), this is more important.
-rw-r--r--changelog.d/16660.misc1
-rw-r--r--synapse/util/task_scheduler.py2
2 files changed, 2 insertions, 1 deletions
diff --git a/changelog.d/16660.misc b/changelog.d/16660.misc
new file mode 100644
index 0000000000..6763685b9d
--- /dev/null
+++ b/changelog.d/16660.misc
@@ -0,0 +1 @@
+Reduce max concurrency of background tasks, reducing potential max DB load.
diff --git a/synapse/util/task_scheduler.py b/synapse/util/task_scheduler.py
index 8c2df233d3..b254d3f84c 100644
--- a/synapse/util/task_scheduler.py
+++ b/synapse/util/task_scheduler.py
@@ -377,7 +377,7 @@ class TaskScheduler:
                 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