We’ve built an auto-scaler for our App Platform app, which uses the Apps API to scale up and down depending on our workload. However, we’ve noticed that App Platform will trigger a rebuild every time we scale up or down. Is there any way to prevent this?

The problem with this is that it causes our scale up/down time to be very slow since we have to wait for the build to finish, and we’re concerned about exceeding our monthly build time limit.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

👋 @philipCrab

Thanks for reaching out. You’ve brought up some good feedback that when scaling your app it does appear in a “building” state briefly, however if we have not detected changes in your code we will reuse the existing container image we created from the last time there was changes.

To add a bit more detail, when scaling up or down, a new deployment is created, we check to ensure the container image we have is still valid then we start up the instances. Once those instances are up and healthy we redirect traffic from your active deployment to the new deployment and shutdown the old deployment.

If you’re seeing unexpected build times with your app when scaling please reach out to support so we can take a look at your app.

Hope this helps!