New Query Engine Process Get Created Every Time a Query is Executed
See original GitHub issueBug description
I’m using Prisma with Nexus through nexus-plugin-prisma. The issue is, every time a query is executed, a new process for prisma’s query engine is created, leading to memory leak.
I’m quite sure this doesn’t happened before because previously this API is hosted on a server with 8GB of memory capacity and the API handle requests just fine without ever causing the server to shut down. Only after I move the API to a new server with 12GB of memory capacity I started getting this behavior, my server would randomly shuts down after a few days because of this memory leak.
Maybe someone can help me with this, I have no idea of the origin of this behavior.
Thank you in advance guys.
How to reproduce
I’m not sure about this, I only noticed this recently because the server would shut down randomly every few days. I never noticed this before because of the server’s relatively luxurious memory capacity. But it’s for sure that every time a query is executed, a new process for prisma’s query engine pops up on htop.
Expected behavior
I’m not sure, but I guess the query engine should only be initiated once (?)
Prisma information
Here’s the beginning of my Prisma schema as I cannot expose the schema fully:
generator client {
provider = "prisma-client-js"
}
generator dbml {
provider = "prisma-dbml-generator"
}
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}
Environment & setup
- OS: Ubuntu
- Database: MySQL
- Node.js version: 14.18.3
Prisma Version
prisma : 2.21.2
@prisma/client : 2.21.2
Current platform : debian-openssl-1.1.x
Query Engine : query-engine e421996c87d5f3c8f7eeadd502d4ad402c89464d (at node_modules/prisma/node_modules/@prisma/engines/query-engine-debian-openssl-1.1.x)
Migration Engine : migration-engine-cli e421996c87d5f3c8f7eeadd502d4ad402c89464d (at node_modules/prisma/node_modules/@prisma/engines/migration-engine-debian-openssl-1.1.x)
Introspection Engine : introspection-core e421996c87d5f3c8f7eeadd502d4ad402c89464d (at node_modules/prisma/node_modules/@prisma/engines/introspection-engine-debian-openssl-1.1.x)
Format Binary : prisma-fmt e421996c87d5f3c8f7eeadd502d4ad402c89464d (at node_modules/prisma/node_modules/@prisma/engines/prisma-fmt-debian-openssl-1.1.x)
Default Engines Hash : e421996c87d5f3c8f7eeadd502d4ad402c89464d
Studio : 0.371.0
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
I see, I guess I’ll try that and get back to this issue later. Thank you.
Up to this day I haven’t found a fix for this but I think I’ll close this issue because I no longer work on the project. Thank you for the help!