Machines API keep machines idle for longer than 4 seconds?

Looking at the docs for the machines API, I see:

If no requests arrive within 4 seconds, the machine will exit, but a request will force it to start back up automatically

Is there any way to make it longer than 4 seconds? I have a use case where I’d like to make that ~15 minutes ideally.

Note I do also see:

The wake-on-request behavior described above will be unpredictable when running more than one machine per region.

Is that one machine per app per region? Or just one machine in any app?

Looking at the code now I am assuming that the 4 seconds was an omitted environment variable IDLE_TIME_TO_SHUTDOWN

I don’t think this is quite true. Machines only exit if the main process exits with return code 0. So, your code could be setup to exit after 15m of inactivity, as required; and it should work as expected.

Also, I don’t believe fly.io/fastify-functions docker-image sets a timeout, so it must default to 120s (ref).

Besides, I’ve heard Kurt mention that short timeouts (such as less than 60s) are not handled well by Machines yet.

That’s one machine per region per Fly app.

I was looking at the start script which defined 120s, but the wrapper (tired-proxy) is 60s by default iirc