mirror of
https://github.com/flyimg/flyimg.git
synced 2026-04-25 09:45:50 +03:00
[GH-ISSUE #495] With many flyimg docker replicas, does it make sense to share the /tmp directory ? #183
Labels
No labels
Docs
Docs
Docs
Security
UnitTest
bug
dependencies
duplicate
enhancement
enhancement
enhancement
hacktoberfest
help wanted
invalid
pull-request
question
stale
version 1
version 2
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/flyimg#183
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @francescor on GitHub (Sep 9, 2024).
Original GitHub issue: https://github.com/flyimg/flyimg/issues/495
Originally assigned to: @sadok-f on GitHub.
We have been using successfully flyimg in a Traefik/Docker swarm setup with 2+ replicas (thanks!)
So far we did not use S3 (we'll start now) and to easy the load we've so far been sharing the
/tmpdirectory between replicas: the idea was that the job of one container can be somehow recycled by the other container (I guess at least the 'download' of the original...)This is the relevant part of the stack.yml file
btw: that shared dir ended up with over 100.000 files and over 50G, so I guess it's really too much
Now that we start using S3, does it make sense to still share that
/tmpdirectory? (we'll enable the cron to empty it for sure now)@sadok-f commented on GitHub (Sep 9, 2024):
@francescor that's a good question, when you enable S3 storage, only the generated images that will be served in the response will be stored there, the
/tmpfolder contains the original downloaded images plus the images that need multiple processing iterations.for better performance I think it'll be good to keep sharing the
/tmpfolder between containers and setup the corn job to clean it up regularly.@francescor commented on GitHub (Sep 9, 2024):
so, imagine I have two containers: A, B
I am curious of the scenario
When for the very first call for an image link (e.g. https://demo.flyimg.io/upload/o_auto,w_2500,h_2500/https%3A%2F%2Fs3-eu-west-1.amazonaws.com%2Fstatic.opencity.opencontent.it%2Fvar%2Fmasullas%2Fstorage%2Fimages%2F3330-2-ita-IT%2FHomepage_header_logo.png ) container A will
did I get it right?
When the same request arrive to the same container A what steps above will be skipped?
Now, when the same request arrives (for the first time) to the other container B (with no shared /tmp with container A) what will happen?
@sadok-f commented on GitHub (Sep 10, 2024):
The
/tmpfolder is used only to download the original image (if not there, or to force refresh withrf_1option).if you're using the same bucket for both containers, Flyimg will check if the generated image is already there (in your case in the S3 bucket), if so then serve it, otherwise it regenerates it again.
@sadok-f commented on GitHub (Sep 26, 2024):
Hi @francescor
did you get your answer to your question? can we close this issue?
Thanks!
@francescor commented on GitHub (Sep 26, 2024):
We still have to go into production with the new setup (I need two step from my colleague which is pretty busy).
@francescor commented on GitHub (Oct 18, 2024):
yes, please
thank you