h2non / imaginary

Fast, simple, scalable, Docker-ready HTTP microservice for high-level image processing
https://fly.io/docs/app-guides/run-a-global-image-service/
MIT License
5.55k stars 456 forks source link

add file: Dockerfile-jemalloc #366

Open wuzhihui1123 opened 3 years ago

wuzhihui1123 commented 3 years ago

Add the Dockerfile-jemalloc file to build the imaginary of jemalloc. solve the memory leak problem

h2non commented 3 years ago

Can you please provide some additional information about the underlying issue and how does jemalloc solves the problem?

polarathene commented 3 years ago

Can you please provide some additional information about the underlying issue

342 , #314 , #198

Some have identified MALLOC_ARENA_MAX as helpful, which has been reflected in the project README. Others noticed switching to jemalloc can further resolve the issue, where it's been clarified in issues on the libvips project repo IIRC, and one user in the imaginary linked issues references imgproxy docs that details both of these memory tweaks/fixes together.

This PR should probably document somewhere such as the README about why jemalloc variant may be relevant to try. Could be as simple as copy/paste or link referencing imgproxy docs on the subject.

Probably would be good if someone verifies with a before & after result of the Dockerfile resolving the issue too.

angelo-hub commented 3 years ago

@polarathene I'm curious if I should pull this into our current fork, can you provide some benchmarks, as well as docker stats if possible?

angelo-hub commented 3 years ago

@polarathene Also there was a small update to the docker file to upgrade to golang 1.17, can you merge them in here too?

polarathene commented 3 years ago

@angelo-hub I'm not the author of this PR, I do not use imaginary.

My comment was added when I was looking at the project among others, I saw this PR and thought I'd pass some information along at the time. I have no time available for contributions sorry :(

zenyui commented 1 year ago

@angelo-hub do you maintain a more recent fork/build of imaginary?