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.

Track prisma engine binary size

See original GitHub issue

Problem

Over prisma 2’s lifespan, the binary size of the bundled engines has been increasing at a steady rate as new features are added. query-engine-debian-openssl-1.1.x went from ~12mb around preview.10, to 24 at 2.11, to now 38mb with 2.20.1 and napi enabled. While this is usually not a problem in traditional server environments it’s becoming increasingly troubling in a serverless environment, where the bundled .zip need to stay below a certain size.

Suggested solution

I’d like to propose to add an internal monitoring of the binary size, and maybe dedicating some time into thinking how we could reduce it. I hope that moving napi to stable can reduce some engine networking code and dependencies, and maybe having more finegrained builds with or without certain features ( no need to bundle a sqlite adapter when only postgres support is needed) could help as well, though I’m not sure how technically feasible that is.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:6
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ShanonJacksoncommented, Jul 28, 2022

Any chance of reviving this? I think 40MB is excessive and it without knowing the complexities of reducing it I’m hoping that it can be reduced anyway by a large margin.

I think the differences between Azure and AWS here are huge, AWS on this front download size doesn’t seem like too much of a factor to cold start on AWS but on Azure we’re seeing like 7s cold starts with serverless applications on consumption plans that basically just have prisma and a few other dependencies compared to like 150-200ms without.

0reactions
ShanonJacksoncommented, Aug 7, 2022

@janpio thanks, it’s in the chain above.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prisma engines
Using custom engine libraries or binaries · Automated download of engine files is not possible. · You have created your own engine library...
Read more >
Query engine (Concepts) - Prisma
Prisma's query engine manages the communication with the database when using Prisma ... Prisma to use the query engine compiled as an executable...
Read more >
Environment variables reference - Prisma
PRISMA_CLI_QUERY_ENGINE_TYPE is used to define the query engine type Prisma CLI downloads and uses. Defaults to library , but can be set to...
Read more >
Deploying to a different OS - Prisma
Deploying to a different OS. Prisma Client depends on the query engine that is running as a binary on the same host as...
Read more >
Prisma CLI Command Reference
"format-binary": "prisma-fmt 60ba6551f29b17d7d6ce479e5733c70d9c00860e (at node_modules\\@prisma\\engines\\prisma-fmt-windows.exe)",.
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