summary refs log tree commit diff
path: root/docs/usage/administration/admin_api
diff options
context:
space:
mode:
authorOlivier Wilkinson (reivilibre) <oliverw@matrix.org>2021-11-09 11:58:35 +0000
committerOlivier Wilkinson (reivilibre) <oliverw@matrix.org>2021-11-09 11:58:35 +0000
commit9d3b04e7495e147829a09c56a9e5762467d18b78 (patch)
tree39cd3fadcbc3e3be8c89777099724643730c5df1 /docs/usage/administration/admin_api
parentMerge remote-tracking branch 'origin/release-v1.46' into matrix-org-hotfixes (diff)
parentInclude cross-signing signatures when syncing remote devices for the first ti... (diff)
downloadsynapse-9d3b04e7495e147829a09c56a9e5762467d18b78.tar.xz
Merge branch 'release-v1.47' into matrix-org-hotfixes
Diffstat (limited to 'docs/usage/administration/admin_api')
-rw-r--r--docs/usage/administration/admin_api/background_updates.md84
1 files changed, 84 insertions, 0 deletions
diff --git a/docs/usage/administration/admin_api/background_updates.md b/docs/usage/administration/admin_api/background_updates.md
new file mode 100644

index 0000000000..b36d7fe398 --- /dev/null +++ b/docs/usage/administration/admin_api/background_updates.md
@@ -0,0 +1,84 @@ +# Background Updates API + +This API allows a server administrator to manage the background updates being +run against the database. + +## Status + +This API gets the current status of the background updates. + + +The API is: + +``` +GET /_synapse/admin/v1/background_updates/status +``` + +Returning: + +```json +{ + "enabled": true, + "current_updates": { + "<db_name>": { + "name": "<background_update_name>", + "total_item_count": 50, + "total_duration_ms": 10000.0, + "average_items_per_ms": 2.2, + }, + } +} +``` + +`enabled` whether the background updates are enabled or disabled. + +`db_name` the database name (usually Synapse is configured with a single database named 'master'). + +For each update: + +`name` the name of the update. +`total_item_count` total number of "items" processed (the meaning of 'items' depends on the update in question). +`total_duration_ms` how long the background process has been running, not including time spent sleeping. +`average_items_per_ms` how many items are processed per millisecond based on an exponential average. + + + +## Enabled + +This API allow pausing background updates. + +Background updates should *not* be paused for significant periods of time, as +this can affect the performance of Synapse. + +*Note*: This won't persist over restarts. + +*Note*: This won't cancel any update query that is currently running. This is +usually fine since most queries are short lived, except for `CREATE INDEX` +background updates which won't be cancelled once started. + + +The API is: + +``` +POST /_synapse/admin/v1/background_updates/enabled +``` + +with the following body: + +```json +{ + "enabled": false +} +``` + +`enabled` sets whether the background updates are enabled or disabled. + +The API returns the `enabled` param. + +```json +{ + "enabled": false +} +``` + +There is also a `GET` version which returns the `enabled` state.