Opencpu POST request times out in 90 seconds

515 Views Asked by At

POST request to an OpenCPU function times out at 90 seconds.

response <- httr::POST(url, httr::config(timeout = 300, verbose = TRUE), httr::content_type("application/x-www-form-urlencoded"), body = list(myjson = jsoninput), encode = "form")

Error: timeout reached (90.000000 sec)

HTTP status code: 400

  1. Per OpenCPU manual, we changed the following conf files and updated the default timelimit.post value to 300 seconds.

    /etc/opencpu/server.conf.d/server.conf

    /usr/local/lib/R/site-library/opencpu/config/defaults.conf

  2. Despite these changes, we keep getting the same error. Although with a smaller data set, the request is processed successfully, but after almost 13MB of request object, it starts to time out.

  3. In addition, rlimit.as setting is 4e9 (approx. 3.7 GB) and default timeout on apache conf file is 300 seconds.

  4. Interestingly enough, the same request works when the function is invoked via opencpu/apache's test page. https://servername/ocpu/test

Two questions:

1) How to confirm that the timeout (timelimit.post) overrides are honored by the opencpu/apache server?

2) Any other setting that we can try to change for a longer data processing call on OpenCPU?

Thanks in advance.

0

There are 0 best solutions below