I have a Java Spring application running on standard instances of Google App Engine. We recently switched from auto-scaling to manual scaling in order to accommodate for longer cronjobs.
We've been running into issues when trying to run the server locally ./gradlew startServer
. This is due to our manual scaling configuration inside *appengine-web.xml":
<instance-class>B8</instance-class>
<manual-scaling>
<instances>1</instances>
</manual-scaling>
Even though we try to set the instances number to 1. Gradle attempts to start the application more than 1 time, causing errors. The issues is only solved when I switch the settings back to auto-scaling:
<instance-class>@server.instance.class@</instance-class>
<automatic-scaling>
<min-idle-instances>@min.idle.instances@</min-idle-instances>
<max-idle-instances>@max.idle.instances@</max-idle-instances>
<min-pending-latency>@min.pending.latency@</min-pending-latency>
<max-pending-latency>@max.pending.latency@</max-pending-latency>
</automatic-scaling>
One solution for this is to swap manual scaling to autoscaling based on the env
and add that to ./gradlew startServer
with a script.
Is there a way from a configuration standpoint to this without going the script route