0

I have configured a version of my default service on Google App Engine Standard (Java, though that shouldn't make any difference) to use basic scaling and run a single B2 instance:

<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
    <application>${app.id}</application>
    <version>tasks</version>
    <threadsafe>true</threadsafe>
    <runtime>java8</runtime>
    <module>default</module>
    <instance-class>B2</instance-class>

    <basic-scaling>
        <idle-timeout>60s</idle-timeout>
        <max-instances>1</max-instances>
    </basic-scaling>

    <!-- Other stuff -->
</appengine-web-app>

Despite not getting any request for almost 28 minutes, the instance did not shutdown by itself (I manually shut it down with appcfg.cmd stop_module_version...):

enter image description here

There are no background threads.

Why doesn't this instance shutdown? Two days prior the instance ran almost the whole day, idle, with this configuration... so what's the issue?

The definition of idle is that no new requests are received in x amount of time. What if the last request is taking 20 minutes to execute? Shouldn't idle be defined as the time since the last request finished?

I posted this question on SeverFault (since this is not a programming question) but was told that StackOverflow would be the better site...

Dan Cornilescu
  • 39,470
  • 12
  • 57
  • 97
markvgti
  • 4,321
  • 7
  • 40
  • 62

1 Answers1

1

GCP Support here:

I tried to reproduce the same behaviour but either using 1m or 60s, instances would be shutdown after serving its last request.

Nonetheless, when I had any long lasting requests, threads, and/or Task queues running for minutes, the instance wouldn't be shutdown until this request was finished. You can also find this information here for both Manual/basic scaling :

Requests can run for up to 24 hours. A manually-scaled instance can choose to handle /_ah/start and execute a program or script for many hours without returning an HTTP response code. Task queue tasks can run up to 24 hours.

In your case, it seems there was a request lasting for minutes prior being finished and thus, the instance was active (rather than idle) throughout until you manually stopped it. You may find this Instance life cycle documentation useful as well.

If you believe this behaviour isn't what you experienced back then, I'd suggest you to create a private issue tracker so we can investigate further. Make sure to provide the project number and all required details in there (fresh samples). Once created, share the issue tracker number so we can look into this.

Miller G.
  • 178
  • 6
  • Thank you for your help. I'll try it out again and if I can reproduce the issue, I'll create a private issue tracker – markvgti May 02 '18 at 09:48