在heroku上配置请求超时 [英] Configure request timeout on heroku

查看:148
本文介绍了在heroku上配置请求超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能在heroku上配置请求超时?



我有一些报告查询需要的时间超过了heroku提供的默认30秒。理想情况下,我想为特定请求(只是报告)设置它。



谢谢。

解决方案

Heroku似乎鼓励500ms或更少的响应 。由于他们没有提到在该页面上改变请求超时,我猜测他们不支持改变它(尽管你可以问Heroku支持)。



什么你是否在为报告工作?


  1. 你可以在后台作业中运行计算工作并存储结果吗? (例如,在memcache中,在数据库中的另一个表中,等等)信息需要最新?

  2. 你可以加快你的速度查询?你的查询计划是什么样的?通过改变查询数据的方式或添加索引,是否有改进的余地?

我会建议先尝试方法1或2,看看他们是否有所帮助。如果你给我们更多关于你在做什么的细节,我们可能会帮助更多。


Is it possible to configure the request timeout on heroku?

I have some report queries that that take longer than the default 30 seconds heroku provides. Ideally, I'd like to set it for specific requests (just the reports).

Thanks.

解决方案

Heroku seems to encourage responses of 500ms or less. Since they don't mention altering the request timeout on that page my guess would be that they don't support changing it (though you could ask Heroku Support).

What kind of work are you doing for your report?

  1. Can you run calculation work in a background job and store the result? (e.g. in memcache, in another table in your database, etc) How up-to-date does the information need to be?

  2. Can you speed up your query? What does your query plan look like? Is there room for improvement by changing how the data is queried or adding indexes?

  3. Would an approach like HTTP streaming help?

I would suggest trying approaches 1 or 2 first and seeing if they help. If you give us more detail on what exactly you're doing we may be able to help more.

这篇关于在heroku上配置请求超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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