imagor
imagor copied to clipboard
Typical memory usage for docker instance
We are running a single docker container with s3 loader and storage and memory usage hangs out around 2 Gib (last I checked 1.819GiB of total 7.667GiB). And it seems the memory grows and is not freed when an image is not found in the cache. Is that a reasonable/expected memory usage?
Is it 2GB of steady memory or it keeps growing? What is the peak memory usage? Since it is a single instance, it really depends on the number of requests per second and the complexity of operations applied. Can you share the docker stats
? What are the common image URLs/operations applied?
I have been waiting a bit to find the trend and it seems it stabilizes around 2GB. But we occasionally get random restarts. The only operationa we use are resizing, quality reduction and rotation. mostly
imagor_1 | {"level":"warn","ts":1644913179.5152287,"caller":"imagor/imagor.go:297","msg":"load","key":"900x0/filters:quality(75):rotate(0)/q0cdfsr099cx0l904l53oqt6c73p","error":"imagor: 404 not found"}
imagor_1 | {"level":"warn","ts":1644913184.7839189,"caller":"imagor/imagor.go:297","msg":"load","key":"1200x675/filters:quality(75):rotate(0)/q0cdfsr099cx0l904l53oqt6c73p","error":"imagor: 404 not found"}```
Recent stats after 12 hours of a restart:
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
991e93a24cfc imagor_imagor_1 0.00% 1.111GiB / 7.667GiB 14.49% 1.8GB / 1.25GB 60.6MB / 0B 86
If it stabilizes at 2GB on a 8GB machine, that sounds reasonable to me. Though I am keen to know about what causes that restart. Did you see any abnormal docker logs during the restart?
You may also find this parameter useful, available at shumc/imagor:0.8.11
:
-imagor-process-concurrency int
Imagor semaphore size for process concurrency control. Set -1 for no limit (default -1)
This limits the number of concurrent requests (excluding cached requests) can be processed. Any requests that exceeded the concurrency limit will be throttled.
I don't see anything unusual during restarts, but it usually happens when we receive multiple concurrent requests.
what is an ideal value for that param? Is it a function of requests we receive?