Cloud SQL High CPU Usage
We are using CloudSQL with postgres 15, and everyday at 12:00 pm, we have a 100% CPU consumption as we can see in the first image.
We saw that the queries that are consuming the most from our database are those in the second image, but this query: "select owner, created_at, "sequence", position from eventstore.push($1::eventstore.command[])" were called 15 thousand times, this query overload our database, this is happening in our production environment everyday, so we need some help ASAP
We have a 4 vCPU and 16 GB RAM of CPU and a few more than 20 organizations and 31K of users


5 Replies
Hi there, that is a weird case.
What version of zitadel are you currently on?
We are experiencing similar behavior with 1 Org and 35k users. Zitadel 3.3.0 and RDS Serverless Aurora.
AWS RDS performance insights report the same queries as above.
@Gabriel Brandão any insights/tips you could provide from your side?
Can you share your zitadel config?
The HelmRelease would look like this, secret only contains RDS endpoint and credentials.
We switched to a db.r6g.large RDS since I posted the message and it improved. With Serverless we had 2 ACUs.
We are reaching ~70% of CPU usage in RDS though during periods where we perform lots of queries to search users using REST
POST /v2/users
.Hm, could be that have something that is not well cached/optimized here.
The r6g.large is a 2CPU machine, right? Mainly asking because having too many SQL connections open can plague small CPU machines
Can you check some metrics on RDS for me, especially query latency would be interesting