Skip to content

Commit 9ed0d36

Browse files
Bump batch size from 50 to 1000 for _get_e2e_cross_signing_signatures_for_devices query (#18939)
Co-authored-by: Eric Eastwood <[email protected]>
1 parent ddc7627 commit 9ed0d36

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

changelog.d/18939.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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.

synapse/storage/databases/main/end_to_end_keys.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,10 @@ async def get_e2e_device_keys_and_signatures(
354354
if d is not None and d.keys is not None
355355
)
356356

357-
for batch in batch_iter(signature_query, 50):
357+
# 1000 is an arbitrary batch size. It helped performance on a very
358+
# large-scale deployment (matrix.org), but has not been tested against
359+
# any other setup.
360+
for batch in batch_iter(signature_query, 1000):
358361
cross_sigs_result = (
359362
await self._get_e2e_cross_signing_signatures_for_devices(batch)
360363
)

0 commit comments

Comments
 (0)