_
Optimize Replatform Spring Boot on Cloud Foundry with autoscaling and rightsizing
STACKIT
Last updated on
This pattern uses STACKIT Cloud Foundry as the primary runtime for Spring Boot applications. The design focuses on fast delivery through platform-managed runtime, managed PostgreSQL, and autoscaling.
Check the per-instance resource limits and persistence requirements before selecting Cloud Foundry as the migration target. Keep application state in the backing service rather than relying on local container files surviving restart, redeployment, or scaling.
Individual instances of application processes or executions (tasks) can consume up to 32 GB RAM and up to 6 GB ephemeral local disk storage, including additional processes (sidecars).
If nothing else is specified, a single web process with 256 MB RAM and 512 MB ephemeral local disk storage is assumed. These values can be changed, for example, using the manifest file.
This section is copied from the STACKIT docs automatically, several times a day. It cannot be changed here. Changes belong in the STACKIT docs.
Since your applications run in containers, their local filesystem is not persistent. As soon as the container is stopped or crashes, the storage is assigned to other containers. This means that if an application writes data to the local filesystem and the container is redeployed due to an update or crash, all locally stored data is lost.
Also, the local filesystem of a container is not shared between all instances. So if an application keeps data on the local filesystem, only that one instance knows about it. If the user then refreshes the page and is routed to another instance, access to the data is no longer possible.
Instead of persisting data on the local filesystem, you can use data services from the marketplace or volumes as a service from the STACKIT Portal. Learn more at Create a service instance.
This section is copied from the STACKIT docs automatically, several times a day. It cannot be changed here. Changes belong in the STACKIT docs.
Use this repository when the target runtime is Cloud Foundry with PostgreSQL, App Autoscaler, and Observability.
cp env.tfvars.example terraform.tfvarsSet your project, auth, and Cloud Foundry values in terraform.tfvars.
Initial rollout (Terraform creates app and route):
setup_workload = truemanage_workload_app_route = trueterraform init -upgradeterraform planterraform applymanage_workload_app_route = falseexisting_cf_app_id = "<your-app-guid>"terraform planterraform applyHint: This mode split exists because some Cloud Foundry provider versions can still produce recurring app/route drift after the initial creation.
For the optimization and rightsizing step in the Optimize module, continue with: