【问题标题】:Prediction IO: Configure Timeouts for Engine预测 IO:为引擎配置超时
【发布时间】:2016-05-13 21:56:10
【问题描述】:

我有一个训练有素的模型,我可以轻松部署它。但是,查询 API 会收到响应:

服务器无法及时响应您的请求

一个简单的谷歌搜索(和过去的经验)告诉我这是 Spray 告诉我响应时间太长了。我希望能够增加超时,但我找不到如何配置引擎。

知道如何更改引擎使用的配置吗?

【问题讨论】:

    标签: scala spray predictionio


    【解决方案1】:

    来自Spray documentation

    # The time after which an idle connection will be automatically closed.
    # Set to `infinite` to completely disable idle connection timeouts.
    idle-timeout = 60 s
    
    # If a request hasn't been responded to after the time period set here
    # a `spray.http.Timedout` message will be sent to the timeout handler.
    # Set to `infinite` to completely disable request timeouts.
    request-timeout = 20 s
    

    还有其他一些与超时相关的设置,您可能需要调整。

    【讨论】:

    • 我应该把这个配置放在哪里?在 src/resources 下的 application.conf 中? pio 文档没有提到可以传递给 pio train 的配置之外的配置
    • @JakeGreene 通常你应该把类似spray.can { server { request-timeout = 20 s }} 的东西放到src/main/resources/application.conf 上,它应该可以工作。您使用的是哪个引擎模板?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多