opencpu를 사용하여 flexsurv 패키지에서 함수를 호출하려고합니다. 나는 OSX Sierra에서 실행 중이다.Opencpu 호출이 예상보다 오래 걸림
나는 사전로드 된 패키지 목록에서 flexsurv 포함하도록 내 opencpu의의 .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","survival","flexsurv"]
} 그때 개방 CPU를 시작하고 컬의 다음 호출 할
:
을curl localhost:7210/ocpu/library/flexsurv/R/pgompertz/json -d "q=[0,1,2,3]&shape=0.001&rate=0.001" -w "%{time_total}\n" -o /dev/null
매우 간단하고 빠른 함수 호출 임에도 불구하고이 호출에는 약 1.4 초가 소요됩니다.
curl localhost:7210/ocpu/library/stats/R/rnorm/json -d "n=100000" -w "%{time_total}\n" -o /dev/null
왜 비교적 간단한 flexsurv 호출이 걸립니까 훨씬 더 시간 : 비교함으로써
호출 rnorm 적은 0.5 초 이상 10,000 임의 정상 샘플 반환을 그리는? 예하 중 작동하지 않습니까? 그렇다면 어떻게 해결할 수 있습니까? 그렇지 않은 경우 추가 대기 시간을 유발하는 요인은 무엇입니까?