由LogEntries记录的Heroku路由器错误H13

我想弄清楚我是否经常从LogEntries获得这些错误值得担心。 我有一个iPhone应用程序与heroku上的Rails API对话。 我使用HireFire自动增加和减少应用程序所需的dynos和worker的数量。

我认为这些错误是由dynos缩小,然后调用该dyno引起H13错误引起的。 如果是这样,有没有办法阻止这个? 当然用户请求不会进入不再存在的dyno?

以下是我在上下文中最常见的日志:

1。

2012-10-18 10:01:15.170 209 1 2012-10-18T10:01:14+00:00 app web.1 - - Started GET "/hirefireapp/xxxxxxxxxxxxxxxx/info" for 23.22.73.241 at Thu Oct 18 03:01:14 -0700 2012 2012-10-18 10:01:15.170 162 1 2012-10-18T10:01:14+00:00 app web.1 - - cache: [GET /hirefireapp/xxxxxxxxxxxxxxxx/info] miss 2012-10-18 10:01:22.147 146 1 2012-10-18T10:01:22+00:00 app web.2 - - Connected to NewRelic Service at collector-2.newrelic.com:80 2012-10-18 10:01:22.308 217 1 2012-10-18T10:01:22+00:00 app web.2 - - ** [NewRelic][10/18/12 03:01:22 -0700 xxxxxxxxxxxxxxxx (2)] INFO : Reporting performance data every 60 seconds. 2012-10-18 10:01:38.118 86 1 2012-10-18T10:01:38+00:00 app web.2 - - 2012-10-18 10:01:38.212 86 1 2012-10-18T10:01:38+00:00 app web.2 - - 2012-10-18 10:01:38.212 154 1 2012-10-18T10:01:38+00:00 app web.2 - - Started GET "/" for 204.93.223.151 at Thu Oct 18 03:01:38 -0700 2012 2012-10-18 10:01:38.212 128 1 2012-10-18T10:01:38+00:00 app web.2 - - Processing by CmsController#index as */* 2012-10-18 10:01:38.212 148 1 2012-10-18T10:01:38+00:00 app web.2 - - Rendered cms/index.html.erb within layouts/application (4.8ms) 2012-10-18 10:01:41.291 124 1 2012-10-18T10:01:41+00:00 heroku web.2 - - Stopping all processes with SIGTERM 2012-10-18 10:01:42.243 217 1 2012-10-18T10:01:42+00:00 heroku router - - Error H13 (Connection closed without response) -> GET my-api.heroku.com/ dyno=web.2 queue= wait= service= status=503 bytes= 

2。

 2012-10-16 17:31:25.184 189 1 2012-10-16T17:31:25+00:00 app web.2 - - ** [NewRelic][10/16/12 10:31:25 -0700 (2)] INFO : Dispatcher: thin 2012-10-16 17:31:25.184 197 1 2012-10-16T17:31:25+00:00 app web.2 - - ** [NewRelic][10/16/12 10:31:25 -0700 (2)] INFO : Application: my-api 2012-10-16 17:31:25.184 220 1 2012-10-16T17:31:25+00:00 app web.2 - - ** [NewRelic][10/16/12 10:31:25 -0700 (2)] INFO : New Relic Ruby Agent 3.3.1 Initialized: pid = 2 2012-10-16 17:31:25.585 265 1 2012-10-16T17:31:25+00:00 app web.2 - - ** [NewRelic][10/16/12 10:31:25 -0700 (2)] INFO : NewRelic::Agent::Samplers::DelayedJobLockSampler sampler not available: No DJ worker present 2012-10-16 17:31:37.068 217 1 2012-10-16T17:31:37+00:00 app web.2 - - ** [NewRelic][10/16/12 10:31:36 -0700 (2)] INFO : Reporting performance data every 60 seconds. 2012-10-16 17:31:39.786 86 1 2012-10-16T17:31:39+00:00 app web.2 - - 2012-10-16 17:31:39.884 86 1 2012-10-16T17:31:39+00:00 app web.2 - - 2012-10-16 17:31:39.884 154 1 2012-10-16T17:31:39+00:00 app web.2 - - Started GET "/" for xxx.xx.xxx.xxx at Tue Oct 16 10:31:39 -0700 2012 2012-10-16 17:31:39.884 128 1 2012-10-16T17:31:39+00:00 app web.2 - - Processing by CmsController#index as */* 2012-10-16 17:31:39.981 149 1 2012-10-16T17:31:39+00:00 app web.2 - - Rendered cms/index.html.erb within layouts/application (18.1ms) 2012-10-16 17:31:46.082 217 1 2012-10-16T17:31:46+00:00 heroku router - - Error H13 (Connection closed without response) -> GET my-api.heroku.com/ dyno=web.2 queue= wait= service= status=503 bytes= 

任何建议将不胜感激!

谢谢皮特

H13问题的一个潜在原因是Rack密钥空间。 Rack通过HTTP请求发送大量参数密钥,从而增强了对潜在恶意攻击的保护。

Rack Utils设置了65536的密钥空间限制,如果您发送具有大参数集的HTTP请求,则可能不够大。

您可以通过将以下内容添加到Rails初始化程序文件来更改此限制:

 if Rack::Utils.respond_to?("key_space_limit=") Rack::Utils.key_space_limit = 262144 end 

我发现这个数字(4倍标准)大到可以解决我的H13问题,但你可能需要根据自己的个人要求测试不同的设置。

这可能不是您特定H13问题的原因,但值得检查作为可能的解决方案。