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

Commit 49e1356

Browse files
authored
Minor cleanup on recently ported doc pages (#11466)
* move wiki pages to synapse/docs and add a few titles where necessary * update SUMMARY.md with added pages * add changelog * move incorrectly located newsfragment * update changelog number * snake case added files and update summary.md accordingly * update issue/pr links * update relative links to docs * update changelog to indicate that we moved wiki pages to the docs and state reasoning * requested changes to admin_faq.md * requested changes to database_maintenance_tools.md * requested changes to understanding_synapse_through_graphana_graphs.md * add changelog * fix leftover merge errata * fix unwanted changes from merge * use two spaces between entries * outdent code blocks
1 parent d2279f4 commit 49e1356

File tree

5 files changed

+48
-46
lines changed

5 files changed

+48
-46
lines changed

CHANGES.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
UNRELEASED
22
==========
33

4-
We've decided to move the existing, somewhat stagnant pages from the GitHub wiki
4+
We've decided to move the existing, somewhat stagnant pages from the GitHub wiki
55
to the [documentation website](https://matrix-org.github.io/synapse/latest/).
6+
67
This was done for two reasons. The first was to ensure that changes are checked by
78
multiple authors before being committed (everyone makes mistakes!) and the second
89
was visibility of the documentation. Not everyone knows that Synapse has some very
910
useful information hidden away in its GitHub wiki pages. Bringing them to the
1011
documentation website should help with visibility, as well as keep all Synapse documentation
1112
in one, easily-searchable location.
1213

13-
Note that contributions to the documentation website happen through [GitHub pull
14+
Note that contributions to the documentation website happen through [GitHub pull
1415
requests](https://github.com/matrix-org/synapse/pulls). Please visit [#synapse-dev:matrix.org](https://matrix.to/#/#synapse-dev:matrix.org)
1516
if you need help with the process!
1617

@@ -102,7 +103,6 @@ Internal Changes
102103
- Refactor including the bundled relations when serializing an event. ([\#11408](https://github.com/matrix-org/synapse/issues/11408))
103104

104105

105-
106106
Synapse 1.47.1 (2021-11-23)
107107
===========================
108108

changelog.d/11466.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update and clean up recently ported documentation pages.

docs/usage/administration/admin_faq.md

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,31 @@ If your server already has an admin account you should use the user admin API to
66

77
If you don't have any admin accounts yet you won't be able to use the admin API so you'll have to edit the database manually. Manually editing the database is generally not recommended so once you have an admin account, use the admin APIs to make further changes.
88

9-
UPDATE users SET admin = 1 WHERE name = '@foo:bar.com';
10-
9+
```sql
10+
UPDATE users SET admin = 1 WHERE name = '@foo:bar.com';
11+
```
1112
What servers are my server talking to?
1213
---
1314
Run this sql query on your db:
14-
15-
SELECT * FROM destinations;
15+
```sql
16+
SELECT * FROM destinations;
17+
```
1618

1719
What servers are currently participating in this room?
1820
---
1921
Run this sql query on your db:
20-
21-
SELECT DISTINCT split_part(state_key, ':', 2)
22-
FROM current_state_events AS c
23-
INNER JOIN room_memberships AS m USING (room_id, event_id)
24-
WHERE room_id = '!cURbafjkfsMDVwdRDQ:matrix.org' AND membership = 'join';
22+
```sql
23+
SELECT DISTINCT split_part(state_key, ':', 2)
24+
FROM current_state_events AS c
25+
INNER JOIN room_memberships AS m USING (room_id, event_id)
26+
WHERE room_id = '!cURbafjkfsMDVwdRDQ:matrix.org' AND membership = 'join';
27+
```
2528

2629
What users are registered on my server?
2730
---
28-
29-
SELECT NAME from users;
31+
```sql
32+
SELECT NAME from users;
33+
```
3034

3135
Manually resetting passwords:
3236
---
@@ -50,13 +54,13 @@ There are two exceptions when it might be sensible to delete your database and s
5054
I've stuffed up access to my room, how can I delete it to free up the alias?
5155
---
5256
Using the following curl command:
53-
54-
curl -H 'Authorization: Bearer <access-token>' -X DELETE https://matrix.org/_matrix/client/r0/directory/room/<room-alias>
55-
56-
\<access-token\> - can be obtained in riot by looking in the riot settings, down the bottom is:
57+
```
58+
curl -H 'Authorization: Bearer <access-token>' -X DELETE https://matrix.org/_matrix/client/r0/directory/room/<room-alias>
59+
```
60+
`<access-token>` - can be obtained in riot by looking in the riot settings, down the bottom is:
5761
Access Token:\<click to reveal\>
5862

59-
\<room-alias\> - the room alias, eg. #my_room:matrix.org this possibly needs to be URL encoded also, for example %23my_room%3Amatrix.org
63+
`<room-alias>` - the room alias, eg. #my_room:matrix.org this possibly needs to be URL encoded also, for example %23my_room%3Amatrix.org
6064

6165
How can I find the lines corresponding to a given HTTP request in my homeserver log?
6266
---
@@ -93,4 +97,7 @@ WHERE g.room_id = s.room_id
9397
GROUP BY s.canonical_alias, g.room_id
9498
ORDER BY num_rows desc
9599
LIMIT 10;
96-
```
100+
```
101+
102+
You can also use the [List Room API](../../admin_api/rooms.md#list-room-api)
103+
and `order_by` `state_events`.

docs/usage/administration/database_maintenance_tools.md

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,14 @@ This blog post by Victor Berger explains how to use many of the tools listed on
55
## [Purge Remote Media API](../../admin_api/media_admin_api.md#purge-remote-media-api)
66
The purge remote media API allows server admins to purge old cached remote media.
77

8-
#### Purge local media
9-
10-
There is no purge API for local media because you may be the only one with a copy. If you are sure you want to delete local media you could use something like the following to delete media that hasn't been accessed in a while.
11-
12-
```
13-
find /path/to/synapse/media_store/local_content -atime +365 -delete
14-
find /path/to/synapse/media_store/local_thumbnails -atime +365 -delete
15-
```
16-
17-
This will delete media that hasn't been accessed in 365 days.
18-
19-
**Warning, check noatime flag**: You also have to double-check that the filesystem where synapse's media store don't have [noatime flag](https://unix.stackexchange.com/questions/219015/how-to-disable-access-time-settings-in-debian-linux/219017#219017). Check it with `mount`, `noatime` is something that is usually enabled by default to reduce read-write operations in the filesystem for a feature is not so demanded.
8+
## [Purge Local Media API](../../admin_api/media_admin_api.md#delete-local-media)
9+
This API deletes the *local* media from the disk of your own server.
2010

2111
## [Purge History API](../../admin_api/purge_history_api.md)
2212
The purge history API allows server admins to purge historic events from their database, reclaiming disk space.
2313

24-
## [synapse_janitor.sql](https://github.com/xwiki-labs/synapse_scripts)
25-
26-
- this project is [unmantained and dangerous](https://github.com/xwiki-labs/synapse_scripts#unmaintained-and-dangerous)
27-
- USE WITH CAUTION. It may cause database corruption (see https://github.com/matrix-org/synapse/issues/7305 for example).
28-
- ["Our team hasn't used any of these scripts for some time (possibly years) (...) if anyone wants to volunteer to maintain this repo I'd be happy to transfer ownership.](https://github.com/xwiki-labs/synapse_scripts/pull/12#issuecomment-617275345)
29-
30-
Cleans a synapse Postgres database of deleted messages and abandoned rooms.
31-
3214
## [synapse-compress-state](https://github.com/matrix-org/rust-synapse-compress-state)
3315
Tool for compressing (deduplicating) `state_groups_state` table.
3416

35-
## [SQL for analyzing Synapse PostgreSQL database stats](https://github.com/matrix-org/synapse/wiki/SQL-for-analyzing-Synapse-PostgreSQL-database-stats)
36-
Some easy SQL that reports useful stat about Matrix Synapse database.
17+
## [SQL for analyzing Synapse PostgreSQL database stats](useful_sql_for_admins.md)
18+
Some easy SQL that reports useful stats about your Synapse database.

docs/usage/administration/understanding_synapse_through_grafana_graphs.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
## Understanding Synapse through Grafana graphs
22

3-
It is possible monitor much of the internal state of Synapse using [Prometheus](https://prometheus.io) metrics and [Grafana](https://grafana.com/). A guide for configuring Synapse to provide metrics is available [here](../../metrics-howto.md) and information on setting up Grafana is [here](https://github.com/matrix-org/synapse/tree/master/contrib/grafana). In this setup, Prometheus will periodically scrape the information Synapse provides and store a record of it over time. Grafana is then used as an interface to query and present this information through a series of pretty graphs.
3+
It is possible to monitor much of the internal state of Synapse using [Prometheus](https://prometheus.io)
4+
metrics and [Grafana](https://grafana.com/).
5+
A guide for configuring Synapse to provide metrics is available [here](../../metrics-howto.md)
6+
and information on setting up Grafana is [here](https://github.com/matrix-org/synapse/tree/master/contrib/grafana).
7+
In this setup, Prometheus will periodically scrape the information Synapse provides and
8+
store a record of it over time. Grafana is then used as an interface to query and
9+
present this information through a series of pretty graphs.
410

511
Once you have grafana set up, and assuming you're using [our grafana dashboard template](https://github.com/matrix-org/synapse/blob/master/contrib/grafana/synapse.json), look for the following graphs when debugging a slow/overloaded Synapse:
612

@@ -57,16 +63,22 @@ we should probably consider raising the size of that cache by raising its cache
5763

5864
![image](https://user-images.githubusercontent.com/1342360/82241440-13566680-9934-11ea-8b88-ba468db937ed.png)
5965

60-
Forward extremities are the leaf events at the end of a DAG in a room, aka events that have no children. The more exist in a room, the more [state resolution](https://matrix.org/docs/spec/server_server/r0.1.3#room-state-resolution) that Synapse needs to perform (hint: it's an expensive operation). While Synapse has code to prevent too many of these existing at one time in a room, bugs can sometimes make them crop up again.
66+
Forward extremities are the leaf events at the end of a DAG in a room, aka events that have no children. The more that exist in a room, the more [state resolution](https://spec.matrix.org/v1.1/server-server-api/#room-state-resolution) that Synapse needs to perform (hint: it's an expensive operation). While Synapse has code to prevent too many of these existing at one time in a room, bugs can sometimes make them crop up again.
6167

6268
If a room has >10 forward extremities, it's worth checking which room is the culprit and potentially removing them using the SQL queries mentioned in [#1760](https://github.com/matrix-org/synapse/issues/1760).
6369

6470
## Garbage Collection
6571

6672
![image](https://user-images.githubusercontent.com/1342360/82241911-da6ac180-9934-11ea-9a0d-a311fe22acd0.png)
6773

68-
Large spikes in garbage collection times (bigger than shown here, I'm talking in the multiple seconds range), can cause lots of problems in Synapse performance. It's more an indicator of problems, and a symptom of other problems though, so check other graphs for what might be causing it.
74+
Large spikes in garbage collection times (bigger than shown here, I'm talking in the
75+
multiple seconds range), can cause lots of problems in Synapse performance. It's more an
76+
indicator of problems, and a symptom of other problems though, so check other graphs for what might be causing it.
6977

7078
## Final Thoughts
7179

72-
If you're still having performance problems with your Synapse instance and you've tried everything you can, it may just be a lack of system resources. Consider adding more CPU and RAM, and make use of [worker mode](../../workers.md) to make use of multiple CPU cores / multiple machines for your homeserver.
80+
If you're still having performance problems with your Synapse instance and you've
81+
tried everything you can, it may just be a lack of system resources. Consider adding
82+
more CPU and RAM, and make use of [worker mode](../../workers.md)
83+
to make use of multiple CPU cores / multiple machines for your homeserver.
84+

0 commit comments

Comments
 (0)