0

我将 OpenCPU 用于我的 R 项目 Web 界面。该项目运行良好,我能够在我的本地机器(单用户服务器)上获得预期的结果。

然后我在VM上部署了我的项目,但它没有用。在 VM 上,R 函数在 R 提示符下正常工作。单个用户也在工作,我可以使用 cURL 查询它。但是公共服务器总是在 90 秒后挂断和超时

其他需要注意的地方:

  1. tvscore 和 gitstats 等示例项目在云服务器上也可以正常工作
  2. 我的项目基于 rJava。我在设置它时遇到了麻烦,但最后它可以在单用户服务器上运行。
  3. 我已经尝试过 AWS EC2 t2.micro。我还尝试过 Google n1(1-CPU 3.75 GB)和 n2(2-CPU 7.5 GB)实例。
  4. 我没有更改我的 /etc/opencpu/server.conf 中的任何内容

我遇到的错误:

R call did not return within 90 seconds. Terminating process.

我的 server.conf

{
    "enable.api.library": true,
    "enable.api.apps": true,
    "enable.api.bioc": true,
    "enable.api.cran": true,
    "enable.api.gist": true,
    "enable.api.github": true,
    "enable.api.user": true,
    "enable.api.tmp": true,
    "enable.cors" : true,
    "enable.post.code": true,
    "error.showcall": true,
    "gist.cache": 300,
    "github.cache": 86400,
    "cran.cache": 86400,
    "public.url" : "https://public.opencpu.org/ocpu",
    "smtp.server" : "localhost",
    "httpcache.post": 300,
    "httpcache.lib": 86400,
    "httpcache.git": 900,
    "httpcache.gitapi": 120,
    "httpcache.tmp": 86400,
    "httpcache.cran": 86400,
    "httpcache.static": 31536000,
    "httpcache.bioc": 31536000,
    "key.length" : 9,
    "appspaths": "/usr/local/lib/opencpu/apps-library",
    "repos": "http://cran.rstudio.com",
    "rlimit.as": 2e9,
    "rlimit.fsize": 1e8,
    "rlimit.nproc": 50,
    "timelimit.get": 600,
    "timelimit.post": 90,
    "timelimit.webhook": 900,
    "preload": ["ggplot2", "lattice"]
}
4

1 回答 1

1

增加 server.conf 中“timelimit.post”的值。默认为 90 秒,显然您需要更多。

于 2016-04-14T22:03:26.360 回答