Reserved instances and warmup requests not working

2019-05-05 19:49发布

I have never been able to get this to work quite right and it's so unnerving: I have configured warmup requests but I never see them come through, so about 10% of requests result in a new instance being spun up and request taking 30 seconds or worse. And because of the ongoing slowdowns, sometimes those spinups take longer than usual and time out, which is just terrible. It's a spring app, so very slow to startup up, and I probably could optimize to take less than 30 seconds, but that's besides the point... I need warmup requests to work so instances don't serve user requests until they're actually ready.

Someone said warmup requests didn't work unless you have resident instances, which makes sense, so I signed up for 336 hours/week of discounted instance hours, but after an hour I still don't see any reserved instances created. Even if I kill all dynamic ones, new dynamic ones get created.

So my specific question is: Do I need to do anything else to setup reserved instances? and once those are up, will that turn on warmup requests?

My app settings:

Idle Instances: auto-auto

Pending Latency: 5s-10s

Configured Services: Warmup Requests

appengine-web.xml:

<warmup-requests-enabled>true</warmup-requests-enabled>
<threadsafe>true</threadsafe>

web.xml:

   <servlet>
   <servlet-name>_ah_warmup</servlet-name>
   <servlet-class>com.google.apphosting.utils.servlet.WarmupServlet</servlet-class>
   </servlet>
   <servlet-mapping>
   <servlet-name>_ah_warmup</servlet-name>
   <url-pattern>/_ah/warmup</url-pattern>
   </servlet-mapping>

also my main spring dispatcher servlet and the appstats servlet have:

   <load-on-startup>1</load-on-startup>

1条回答
趁早两清
2楼-- · 2019-05-05 20:15

Figured it out myself. A better Google search turned up the right docs page:

https://developers.google.com/appengine/docs/adminconsole/performancesettings

Reserved instances are created when you specify idle instances. So I changed Idle Instances setting from auto/auto to 2/auto. That's it!

Performance is now great and stable, so I would recommend anyone with a paid app to specify at least 1 idle instance.

I also do see warmup requests coming in now for new dynamic instances so reserved instances are indeed a requirement for warmups.

查看更多
登录 后发表回答