I’ve migrated our Staging environment from another PaaS to Qovery, I’ve provisioned a redis instance and a database instance and 5 app services.
Every service uses the same image, and they only differ in configuration and resources.
I assigned the same resources to all of these services compared to the resources they had with our other service provider. However, the response times of my web service are rather unbearably slow. Depending on the complexity of the request/response, the response time ranges between 15 and 35 seconds.
I certainly hope that this is just a misconfiguration of myself, but I’ve looked everywhere and can’t seem to find the issue.
Do you have any recommendations for NestJS GraphQL app (or any backend [node] application), the cluster, database and service resources?
Yes, I’m using the same allocated resources per task/pod.
I assigned .128 vCPU and 512 MB in the beginning (resources assigned with our old PaaS) and as I noticed that the app was very slow, I increased them to .256 vCPU and 1024 MB, but still no change.
Do you use a monitoring system? How do you measure performances? Can you see what happen in your application (APM?) to see where those degraded performances are coming from?
I’m currently using a Postres DB (instance type db.t3.micro) with 20 GiB of storage.
I’ll upgrade it to db.t3.medium just to see if there’s a difference.
Hi @pantajoe, I have a couple of questions to understand better where your performance issue could come from:
Does your database and app run on the same AWS region? (It’s yes if you used the Qovery interface to deploy your RDS database)
Can you confirm that you connect to your database from your app using the *_INTERNAL environment variable? (It’s using the private network instead of the public network)
Can you show your knex configuration and verify that nothing could potentially lead to those performance penalties? Can you show me your complete knex configuration?
Can you confirm that the id field is indexed? What’s the size of your table user?
Thanks again @rophilogene for your time!
Here’s a quick update:
I reduced the vCPU units and RAM to 0.512 vCPU and 768 MB RAM and the app is still reasonably fast. I configured the app to have at least 4 connections in the connection pool to the DB open.
So I would deduce that establishing a connection from a service to the Postgres DB seems somewhat expensive, i.e., it takes longer than expected. This is in line with what I discovered in the other services as well as the lifecycle job I configured. In our previous setup the database migration command (without any migrations to be run) took about 3-5 seconds. It now takes around 10-15 seconds.
Hello again! Unfortunately, this issue still persists? Did you have some time to check this out by any chance? Or do you have any idea as to what the issue might be?