When my (local) prisma server gets hit with a lot...
# orm-help
k
When my (local) prisma server gets hit with a lot of activity it dies with : prisma_1 | [Bugsnag - local / testing] Error report: com.bugsnag.Report@1e1a0a37 prisma_1 | java.util.concurrent.RejectedExecutionException: Task slick.basic.BasicBackend$DatabaseDef$$anon$2@2a3caff2 rejected from slick.util.AsyncExecutor$$anon$2$$anon$1@496b3645[Running, pool size = 9, active threads = 9, queued tasks = 1000, completed tasks = 2857] prisma_1 | at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2063) prisma_1 | at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:830) prisma_1 | at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1379)
c
We have the same problems when there are a lot of requests for the metadata/schema file or the size of query response is large in size. Small size (<10kb) requests at high volumes seem to be ok, but the server will get overwhelmed when requesting larger packs of data
Whats the instance/server size your running prisma on?
k
The environment is local macbook pro (developer workstation). In my case lots of little queries in parallel cause the error. (looping through a interim row set creating a promise for each). Putting an await on reach row resolves the problem but makes it go WAY slower. The problem seems to occur >1000 rows which seems to be some thread config limit in the Prisma service. The main concern here is resiliency in production. WHen we get busy, it looks like it will just fall over...
c
If you make that many promises, you may run out of connections between prisma and the rds, so its likely blocking each thread.
the cardinal sin of db usage is to make a database call inside a loop block, but im assuming your doing this as a test against prisma