I am using OpenCPU for my R project web interface. the project is working fine and i'm able to get results as expected on my local machine (single user server).
then I deployed my project on VM and it didn't work. On VMs the R functions are working properly from R prompt. The single user is also working and i'm able to query it using cURL. but the public server always hangs-up and time-out after 90 secs
other points to note:
- sample projects like tvscore and gitstats are working fine on cloud server as well
- my project is based on rJava. I have had trouble setting it up but finally it worked on single user server.
- I have tried AWS EC2 t2.micro. I have also tried Google n1 (1-CPU 3.75 GB) and n2 (2-CPU 7.5 GB) instances.
- I didn't change anything in my /etc/opencpu/server.conf
the error that I'm getting on failure:
R call did not return within 90 seconds. Terminating process.
my 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"]
}