Shopify app slow to respond causing webhook timeouts

I have a simple Shopify app on a free plan. It has a small sqlite database mounted using the volumes feature. The main purpose of the app is to respond to product/update webhook events and sync inventory.
So far in testing, the app seems to “stop” when there is no load, and then if a webhook request occurs, it takes a while for the machine to start again which seems to be causing timeouts on the webhooks. If the machine/app is “active”, everything seems to work fine.
Looking at the logs, I can see a few different warning messages, but I’m not sure what to make of them.
For example:
“Downscaling app xxxxxxxxxx in region sea. Automatically stopping machine xxxxxxxxxxx. 1 instance is running but has no load”
“[warn] Health check on port 8081 is in a ‘warning’ state. Your app may not be responding properly.”
“[error] instance refused connection. is your app listening on 0.0.0.0:8081? make sure it is not only listening on 127.0.0.1 (hint: look at your startup logs, servers often print the address they are listening on)” - this last one is an error, but seems to resolve itself quickly, as the logs after it continue as expected

Would be grateful for any insight into how I can keep the app responsive so it doesn’t take time to get running again after being inactive.

Thanks!

1 Like

The fly.toml should have a auto_stop_machines setting under [http_service]. If you set that to false and redeploy, it will stay running!

2 Likes

That seems to be working, thanks @kurt !

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.