No sleep if shell command running

From Fin :

"Scale-to-Zero only looks at whether there’s any incoming traffic (and no held connections like WebSockets or HTTP/2 streams) during the idle period. It doesn’t consider “work happening inside the instance” as a reason to keep it awake.

So your script can keep running until the idle period elapses, then the service will scale down to zero and go to Sleeping."

This is incredibly stupid. There are many GPU/AI scenarios like training a model which require a running command shell for some length of time. There may not be HTTP traffic but the instance is still busy.

Please change this.

The entire point of scale-to-zero is that it ignores cpu usage because it is not a reliable factor of activity. If you want to keep the service alive for only a certain period of time (e.g. 5 hours) turn on an external cronjob for that period of time. Also, websockets and http/2 streams will keep your service active in my experience.

If your service never needs http traffic at all, consider using a worker, which was meant for exactly that.

I am not affiliated with or an employee of Koyeb.