element-hq / element-hq/synapse

Make it possible to configure repeat interval of background jobs

Open
#19,179 1 comment 0 reactions 0 assignees View on GitHub
A-Background-Updates A-Config A-Database A-Performance T-Enhancement
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

**Description:**

I noticed that `prune_old_user_ips` is executed quite often ([every 5s](https://github.com/element-hq/synapse/blob/938c97416d2f3f1e248b2e208fa14874103c5bcc/synapse/storage/databases/main/client_ips.py#L440)) and wanted to lower the execution interval a bit to reduce server load, however it looks like it's currently not possible to do this at runtime.

It would be nice if the repeat interval of background jobs would be configurable somewhere.

Contributor guide

Open the contributing guide

Research direction

Start with synapse/storage/databases/main/client_ips.py, especially the prune_old_user_ips call around the linked line, and trace how background jobs are scheduled and configured at runtime. Define how an interval setting would be exposed and applied consistently, then verify that the job can run at the configured frequency without increasing server load unexpectedly.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.