invidious icon indicating copy to clipboard operation
invidious copied to clipboard

Dockerfile: Switch to 84codes crystal compiler container image

Open Fijxu opened this issue 3 months ago • 3 comments

Closes https://github.com/iv-org/invidious/issues/5456

The 84codes Crystal container image builds libgc (bdwgc) with --enable-large-config: https://github.com/84codes/crystal-packages/blob/b321bb4358b0140a63573d9d05ccf2f06c5ae040/alpine/Dockerfile#L13-L22

I tested it locally and I'm now going to test it on my fork of Invidious https://git.nadeko.net/Fijxu/invidious/commit/b38791e7ca6b7549e3a894f26f43cb77660c798e

Fijxu avatar Sep 14 '25 02:09 Fijxu

Ah so this image fixes the memory leak?

unixfox avatar Sep 14 '25 06:09 unixfox

Ah so this image fixes the memory leak?

No, this is unrelated to the memory leak. It just improves GC performance and for now, my Invidious processes seem to use less memory.

2fd67c34-000f-40ed-9d5b-04f1def58b93

At 00:00 is when I changed my instance to the 84codes container image to build Invidious.

Fijxu avatar Sep 14 '25 11:09 Fijxu

After approximately 1 day and 12 hours I can confirm that the 84codes container image which uses --enable-large-config for bdwgc has a more stable memory usage when combining it with https://github.com/iv-org/invidious/pull/5441. There is no memory limits (mem_limit) on my docker-compose file and I have around 8GB of memory free that Invidious could use, but the memory usage is stable ;):

image

Fijxu avatar Sep 15 '25 21:09 Fijxu

https://github.com/iv-org/invidious/pull/5441 got merged instead of this one.

unixfox avatar Dec 18 '25 09:12 unixfox

#5441 is for memory leak

This one is for bdwgc compiled with --enable-large-config and not related to the memory leak. Is for better memory management in the GC

Fijxu avatar Dec 18 '25 11:12 Fijxu

@Fijxu ok. I saw that they provide ARM64: https://hub.docker.com/r/84codes/crystal/tags. Could we unify our Dockerfile for both x86 and ARM64?

unixfox avatar Dec 18 '25 11:12 unixfox