Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/18939.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Reduce overall number of calls to `_get_e2e_cross_signing_signatures_for_devices` by increasing the batch size of devices the query is called with, reducing DB load.
5 changes: 4 additions & 1 deletion synapse/storage/databases/main/end_to_end_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,10 @@ async def get_e2e_device_keys_and_signatures(
if d is not None and d.keys is not None
)

for batch in batch_iter(signature_query, 50):
# 1000 is an arbitrary batch size. It helped performance on a very
# large-scale deployment (matrix.org), but has not been tested against
# any other setup.
for batch in batch_iter(signature_query, 1000):
Comment thread
anoadragon453 marked this conversation as resolved.
cross_sigs_result = (
await self._get_e2e_cross_signing_signatures_for_devices(batch)
)
Expand Down
Loading