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.

Significant Engine IPC latency on Docker (Alpine Linux and Debian).

See original GitHub issue

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

image

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

github_iconTop GitHub Comments

1reaction
pimeyscommented, May 4, 2021

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 of 127.0.0.1 ip address. This would mean that by default it must resolve ::1 first and only after that 127.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. 😃

1reaction
sunil-sadasivancommented, May 3, 2021

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: image

  • I have NOT reproduced this on a DO Ubuntu build image

(The older docker version is interesting)

Read more comments on GitHub >

github_iconTop 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 >

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