Accelerate Latency:
Heeey! I have a question… has anyone experienced a similar latency issue with Accelerate?
This query should be really fast — and actually is, as you can see in the traces — but there are three consecutive requests to Accelerate that each take more than 3 seconds…

2 Replies
You opted for speed from this bot. Let's conjure up an answer right now!
It’s not uncommon for users to encounter unexpected latency with Prisma Accelerate, even when the underlying database queries are fast. There are several documented causes and troubleshooting steps:
1. Connection Pool Limits: If your app is under high traffic and the number of available database connections is insufficient, queries may queue up, causing delays. By default, Accelerate uses a connection limit of 10, but you can increase this by adjusting the
connection_limit in your connection string to better match your database’s capacity. This is especially important for serverless or edge environments where many short-lived connections are created rapidly Possible causes for P6004.
2. Long-Running Queries or Missing Indexes: Even if a query seems simple, fetching large amounts of data or missing indexes can slow things down. Use the select clause to fetch only necessary fields and ensure your tables are properly indexed. Monitor and optimize any queries that consistently take longer than expected Performance checklist for Prisma ORM.
3. Database Resource Contention: Other heavy workloads on your database (like analytics jobs) can cause intermittent slowdowns, even for simple queries. Monitor your database’s read/write and wait times to identify if this is the case Possible causes for P6004.
4. Network Latency: If your Accelerate region is far from your database, or if there are networking issues (e.g., DNS resolution problems), this can add significant latency. Colocating your function and database in the same region can help reduce round-trip times [Colocate your function and your database](https://www.prisma.io/b
log/make-your-applications-fast-globally#colocate-your-function-and-your-database).
If you continue to see unexplained latency, consider reaching out to Prisma support with request IDs and details, as there may be infrastructure-specific issues at play Very frequent errors and timeouts with Accelerate.
🤔 Alright, thanks for letting us know that there's still some help needed. A team member will reply to you shortly.
In the meantime, please let us know any additional info, questions, or which parts of the answer may need clarification.Hey!
Do you get this latency for all queries or only for certain specific queries?
You might face additional latency in case your environment hasn't received traffic for a while and if all existing Query Engines have shut down due to inactivity.