Significant Engine IPC latency on Docker (Alpine Linux and Debian).
See original GitHub issueBug description
I have noticed significant added latency to simple findUnique
queries. Using N-API appears to resolve this.
In debugging further, there appears to be a baseline of ~40ms added to each query when using the current version of Prisma without N-API.
This occurs on Alpine Linux and Debian. I DO NOT see this happening on Mac/Darwin.
How to reproduce
I’ve created a simple proof-of-concept app to demonstrate the issue located here: https://github.com/sunil-sadasivan/prisma-engine-latency-poc
As you can see, running withing docker containers, you’ll see the following result:
Expected behavior
Without N-API we should experience the same minimal overhead we see, when using N-API.
Prisma information
This is off the current version 2.21.2
Environment & setup
- OS: Alpine Linux (Also noticed on Debian) CAN NOT REPRO on Mac/Darwin
- PostgreSQL
- Node 14
prisma : 2.21.2
@prisma/client : 2.21.2
Current platform : darwin
Query Engine : query-engine e421996c87d5f3c8f7eeadd502d4ad402c89464d (at node_modules/@prisma/engines/query-engine-darwin)
Migration Engine : migration-engine-cli e421996c87d5f3c8f7eeadd502d4ad402c89464d (at node_modules/@prisma/engines/migration-engine-darwin)
Introspection Engine : introspection-core e421996c87d5f3c8f7eeadd502d4ad402c89464d (at node_modules/@prisma/engines/introspection-engine-darwin)
Format Binary : prisma-fmt e421996c87d5f3c8f7eeadd502d4ad402c89464d (at node_modules/@prisma/engines/prisma-fmt-darwin)
Default Engines Hash : e421996c87d5f3c8f7eeadd502d4ad402c89464d
Studio : 0.371.0
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Benchmarking Debian vs Alpine as a Base Docker Image
Most official Docker images offer both Debian and Alpine based images but there's some surprising performance results between the 2.
Read more >Super small Docker image based on Alpine Linux
Yeah that's cool, but my main point is that images which make use of the stable debian package system and are actively maintained...
Read more >Isolate containers with a user namespace
Linux namespaces provide isolation for running processes, limiting their access to system resources without the running process being aware of the limitations.
Read more >Deep dive into Linux Networking and Docker — Bridge, vETH ...
Linux Networking is a very interesting topic. In this series, my aim is to dig deep to understand the various ways in which...
Read more >Containers: Under the Hood - Agile Actors #learning
We would want to specifically use Docker Engine and not Docker Desktop. ... For example, we can download Alpine Linux inside a folder...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Docker had some trouble with their ipv6 a while ago. I’m not sure and I’m just backseating, but when I read our client code, I see it connecting to
localhost
instead of127.0.0.1
ip address. This would mean that by default it must resolve::1
first and only after that127.0.0.1
. We had some trouble with docker and its ipv6 being broken a while back, so if you’d like to dig more, this might be an interesting path to take. 😃Ok, real sorry for the real-time debugging on this. Thought I had a good reproducible case here.
I have reproduced this on a Digital Ocean Debian build. Example:
I have NOT reproduced this on a DO Ubuntu build
(The older docker version is interesting)