When performing a certain request to my server which accesses my db i get the following error on the server side:
2025-03-03T18:15:34.412 app[d890426c46e328] ams [info] PrismaClientKnownRequestError:
2025-03-03T18:15:34.412 app[d890426c46e328] ams [info] Invalid `prisma.salesData.findMany()` invocation:
2025-03-03T18:15:34.412 app[d890426c46e328] ams [info] Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 3)
2025-03-03T18:15:34.412 app[d890426c46e328] ams [info] at Ln.handleRequestError (/app/node_modules/@prisma/client/runtime/library.js:121:7753)
2025-03-03T18:15:34.412 app[d890426c46e328] ams [info] at Ln.handleAndLogRequestError (/app/node_modules/@prisma/client/runtime/library.js:121:7061)
2025-03-03T18:15:34.412 app[d890426c46e328] ams [info] at Ln.request (/app/node_modules/@prisma/client/runtime/library.js:121:6745)
2025-03-03T18:15:34.412 app[d890426c46e328] ams [info] at async l (/app/node_modules/@prisma/client/runtime/library.js:130:9633)
2025-03-03T18:15:34.412 app[d890426c46e328] ams [info] at <anonymous> (/app/src/actions/getUserTrackedProds.ts:70:25)
2025-03-03T18:15:34.412 app[d890426c46e328] ams [info] at async Promise.all (index 26)
2025-03-03T18:15:34.412 app[d890426c46e328] ams [info] at getTrackedProductStats$2 (/app/src/actions/getUserTrackedProds.ts:68:17)
2025-03-03T18:15:34.412 app[d890426c46e328] ams [info] at <anonymous> (/app/.wasp/build/server/src/middleware/operations.ts:14:24)
2025-03-03T18:15:34.412 app[d890426c46e328] ams [info] at <anonymous> (/app/.wasp/out/sdk/wasp/server/utils.ts:26:5)
2025-03-03T18:15:34.415 app[d890426c46e328] ams [info] POST /operations/get-tracked-products 500 10191.014 ms - 148
2025-03-03T18:15:34.415 app[d890426c46e328] ams [info] PrismaClientKnownRequestError:
2025-03-03T18:15:34.415 app[d890426c46e328] ams [info] Invalid `prisma.user.findUnique()` invocation:
2025-03-03T18:15:34.415 app[d890426c46e328] ams [info] Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 3)
2025-03-03T18:15:34.415 app[d890426c46e328] ams [info] at Ln.handleRequestError (/app/node_modules/@prisma/client/runtime/library.js:121:7753)
2025-03-03T18:15:34.415 app[d890426c46e328] ams [info] at Ln.handleAndLogRequestError (/app/node_modules/@prisma/client/runtime/library.js:121:7061)
2025-03-03T18:15:34.415 app[d890426c46e328] ams [info] at Ln.request (/app/node_modules/@prisma/client/runtime/library.js:121:6745)
2025-03-03T18:15:34.415 app[d890426c46e328] ams [info] at async l (/app/node_modules/@prisma/client/runtime/library.js:130:9633)
2025-03-03T18:15:34.415 app[d890426c46e328] ams [info] at getAuthUserData (/app/.wasp/out/sdk/wasp/auth/session.ts:55:16)
2025-03-03T18:15:34.415 app[d890426c46e328] ams [info] at getSessionAndUserFromSessionId (/app/.wasp/out/sdk/wasp/auth/session.ts:50:11)
2025-03-03T18:15:34.415 app[d890426c46e328] ams [info] at <anonymous> (/app/.wasp/out/sdk/wasp/core/auth.ts:28:26)
2025-03-03T18:15:34.415 app[d890426c46e328] ams [info] at <anonymous> (/app/.wasp/out/sdk/wasp/server/utils.ts:26:5)
and this is happening on the db side:
2025-03-03T18:13:37.560 health[080e513b2946e8] ams [info] Health check for your postgres database is now passing.
2025-03-03T18:14:57.696 health[080e513b2946e8] ams [info] Health check for your postgres vm is now passing.
2025-03-03T18:15:27.974 health[080e513b2946e8] ams [error] Health check for your postgres vm has failed. Your instance has hit resource limits. Upgrading your instance / volume size or reducing your usage might help. [✗] cpu: system spent 1.78s of the last 10 seconds waiting on cpu (32.17µs)
What is happening and how can i fix this issue? Update: increasing ram to 1gb and cpu to 2x works a bit better but still doesnt pass health check and says for some queries that i exceed resource limits.