imgproxy icon indicating copy to clipboard operation
imgproxy copied to clipboard

Featured Request: Application Timeout for Auto-Shutdown

Open bwhli opened this issue 2 years ago • 2 comments

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.

bwhli avatar Feb 14 '23 07:02 bwhli

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

DarthSim avatar Feb 22 '23 17:02 DarthSim

@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”.

strogonoff avatar Jun 03 '24 09:06 strogonoff