matrix-org / synapse

Synapse: Matrix homeserver written in Python/Twisted.
https://matrix-org.github.io/synapse
Apache License 2.0
11.81k stars 2.13k forks source link

Performance Testing Report for Snaps PostgreSQL #16593

Open RickJou opened 11 months ago

RickJou commented 11 months ago

Description: I conducted performance testing for Snaps PostgreSQL running on a dedicated server with 4 cores and 8GB of RAM, separate from the Snaps server. The testing involved the following scenarios:

  1. Using JMeter, I conducted load testing for sending messages to groups with 10/20/50/100 users via the /_matrix/client/v3/rooms/${admin_room_id}/send/m.room.message/${__time(,)} API.

  2. I used the sync API to sync the latest 1/5/10 events via /_matrix/client/v3/sync.

Results:

  1. Only the scenario with 10 users in a group exhibited satisfactory throughput.
  2. In a group of 30 users, where each user sent 3000 continuous messages without syncing any events, the PostgreSQL server's CPU reached a bottleneck.
  3. The performance of the sync API exhibited peculiar behavior, with some unfragmented events reaching sizes as large as 10MB!!!

I would like to know if there are any optimal production server hardware requirements, as well as official performance test reports

erikjohnston commented 11 months ago

Hmm, that seems odd. I wonder if the default cache configuration is too low.

I would like to know if there are any optimal production server hardware requirements, as well as official performance test reports

We don't have either unfortunately, as performance depends heavily on usage patterns