napi engine cause OOMKilled in container environment
See original GitHub issueBug description
We were running prisma in our production environment inside our k8s cluster for several month now. Using the legacy NodeEngine result in avg 700m ~ 800m ram consumption after start up. After startup, the ram consumption seems pretty fine, the gc in the js side would maintain that ram at around 800m ~ 1gb.
After trying the preview NapiEngine in our staging server, the ram jumped to 1.4gb on startup, and the worst part is it keeps getting higher to 4gb and never gets down until it gets OOMKilled (which is fairly quick).
I tried setting maxOldSpaceSize
and increase the requested/limited memory for the service, but none seems can help improving the situation.
Right now, we have switched back to the old NodeEngine and everything is back to normal again.
From what I see, the memory some how never gets released by NapiEngine, and just gets killed pretty quickly if one trying to run a lot of the query at the same time. I tried set DEBUG
to see what engine is printing, but after the client printed something, before engine print anything the container just gets OOMKilled
How to reproduce
Sorry I canāt share our repo or cluster environment with you guys. And donāt have the time and resource to create a repo to reproduce this, but Iām happy to provide more information and run the test for your guysš .
Expected behavior
NapiEngine should provide same if not better performance than NodeEngine
Prisma information
Environment & setup
The below information is on NodeEngine
prisma : 2.20.1
@prisma/client : 2.20.1
Current platform : linux-musl
Query Engine : query-engine 60ba6551f29b17d7d6ce479e5733c70d9c00860e (at ../root/.npm/_npx/2778af9cee32ff87/node_modules/@prisma/engines/query-engine-linux-musl)
Migration Engine : migration-engine-cli 60ba6551f29b17d7d6ce479e5733c70d9c00860e (at ../root/.npm/_npx/2778af9cee32ff87/node_modules/@prisma/engines/migration-engine-linux-musl)
Introspection Engine : introspection-core 60ba6551f29b17d7d6ce479e5733c70d9c00860e (at ../root/.npm/_npx/2778af9cee32ff87/node_modules/@prisma/engines/introspection-engine-linux-musl)
Format Binary : prisma-fmt 60ba6551f29b17d7d6ce479e5733c70d9c00860e (at ../root/.npm/_npx/2778af9cee32ff87/node_modules/@prisma/engines/prisma-fmt-linux-musl)
Default Engines Hash : 60ba6551f29b17d7d6ce479e5733c70d9c00860e
Studio : 0.365.0
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:5 (4 by maintainers)
Top GitHub Comments
@pimeys I had a quick test on our staging environment, seems itās not get OOMKilled. Will update if find anything further. So far it seems pretty good.
prisma@2.22.0-dev.13
should have the changes, would be nice if youād check it out to see if you still have issues, early enough so we can do more work before the next release if somethingās still off.