question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New Query Engine Process Get Created Every Time a Query is Executed

See original GitHub issue

Bug 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.

image

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:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
danilhendrasrcommented, Mar 21, 2022

I see, I guess I’ll try that and get back to this issue later. Thank you.

0reactions
danilhendrasrcommented, May 26, 2022

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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Query Processing Architecture Guide - SQL Server
The SQL Server Database Engine can process Transact-SQL statements using two distinct processing modes: Row mode execution; Batch mode execution ...
Read more >
Query engine (Concepts) - Prisma
Prisma's query engine manages the communication with the database when using Prisma Client. Learn how it works on this page.
Read more >
Understanding a SQL Server Query Execution Plan
The generated execution plan, known as a Query Execution Plan is input for the SQL Server storage engine to tell it how to...
Read more >
What is a Query Engine? - Starburst Data
A query engine takes a request for data, translates it from human to machine language, and then fulfills the request by retrieving specific...
Read more >
What is the difference between Execution Start and Stop Time ...
This Article describes an issue where the Execution Time shown on the ... the Query Engine process (executing the SQL against the warehouse) ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found