ashep
ashep2w ago

Enormous DB pressure

Hello there! My self-hosted Zitadel instance performs many SELECTs from the event store, resulting in the database reading thousands of rows per second.
SELECT created_at, event_type, "sequence", "position", payload, creator, "owner", instance_id, aggregate_type, aggregate_id, revision FROM eventstore.events2 WHERE instance_id = $1 AND aggregate_type = $2 AND aggregate_id = $3 AND event_type = ANY($4) ORDER BY "sequence"
SELECT created_at, event_type, "sequence", "position", payload, creator, "owner", instance_id, aggregate_type, aggregate_id, revision FROM eventstore.events2 WHERE instance_id = $1 AND aggregate_type = $2 AND aggregate_id = $3 AND event_type = ANY($4) ORDER BY "sequence"
About 2 QPS, fetching about 8K rows per second. This notably decreased the performance of the DB and Zitadel, especially CreateSession requests. Has anyone else experienced this? Zitadel 3.4.2 AWS Postgres 17, m6g.xlarge, 4vCPU, 16GB RAM.
1 Reply
ashep
ashepOP2w ago
Guys, this request returns about 140K records in some cases! I have about 41 M records in the events2 table. This table isn't sharded or partitioned. Was it a conscious architectural decision?

Did you find this page helpful?