预留实例和预热请求不起作用 [英] Reserved instances and warmup requests not working

查看:82
本文介绍了预留实例和预热请求不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从来没有能够把这个工作做得相当正确,而且太令人不安:我配置了热身请求,但是我从来没有看到它们通过,所以大约10%的请求导致新的实例被启动并请求获取30秒或更差。而且由于持续减速,有时候这些旋转需要比平时更长的时间,这很糟糕。这是一个春季应用程序,启动起来非常缓慢,我可能可以优化时间少于30秒,但除此之外......我需要热身请求才能工作,因此实例在用户请求之前不会提供服务实际上已经准备就绪。

有人说,除非你有常驻实例,否则热身请求不起作用,所以我每周注册336小时打折实例时间,但一个小时后,我仍然没有看到任何创建的保留实例。即使我杀死了所有动态的,也会创建新的动态的。



所以我的具体问题是:我需要做其他任何事情来设置保留实例吗?一旦这些都启动了,会打开热身请求吗?



我的应用程序设置:



空闲实例: auto-auto

待处理延迟:5s-10s

配置的服务:预热请求



appengine-web.xml:

 <启用warmup-requests> true< / >启用预热 - 请求 - ; 
< 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>

我的主要spring调度器servlet和appstats servlet也有:

 <加载启动> 1< /加载启动> 


解决方案

一个更好的谷歌搜索打开了正确的文档页面:

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



预留实例在您指定空闲实例时创建。所以我将空闲实例设置从auto / auto更改为2 / auto。这就是它!

性能现在非常稳定,所以我会建议任何人使用付费应用程序来指定至少1个空闲实例。



我现在也看到了新的动态实例的热身请求,所以保留的实例确实是热身需求。


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>

解决方案

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.

这篇关于预留实例和预热请求不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆