Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Featured Request: Application Timeout for Auto-Shutdown #1113

Open
bwhli opened this issue Feb 14, 2023 · 2 comments
Open

Featured Request: Application Timeout for Auto-Shutdown #1113

bwhli opened this issue Feb 14, 2023 · 2 comments

Comments

@bwhli
Copy link

bwhli commented Feb 14, 2023

Hello, I'm using imgproxy on Fly.io. Right now, I'm using Fly's standard application platform which keeps servers running 24/7. I'd like to take advantage of Fly's Machines API which boots up full VMs on demand. It would be great to see some sort of application timeout setting which sends SIGTERM to exit the application after the specified time – the SIGTERM will also cause Fly to automatically suspend the machine into a state where the user only pays for image storage and not CPU/RAM.

@DarthSim
Copy link
Member

Hey @bwhli!
It doesn't look like this should be implemented on the imgproxy's level. Also, I can't find anything about SIGTERM handling in the blog post you've shared

@strogonoff
Copy link

@DarthSim from the link

So here’s how we modeled this: when you use Fly.io machines to run apps that need to scale down, make your process exit when it’s idle. That’s it. You’ve exited the container, effectively stopping the machine, but it’s intact to pick up a future start request from a clean slate.

This works because your in-machine process has a strongly-consistent view of local activity and can confidently detect “idle”.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants