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秒かかります。比較すると
、後半未満10,000ランダム正常サンプルリターンを描画するrnormを呼び出す:
curl localhost:7210/ocpu/library/stats/R/rnorm/json -d "n=100000" -w "%{time_total}\n" -o /dev/null
なぜ比較的簡単なflexsurvコールはそんなに多くの時間がかかるのでしょうか?予圧は機能していませんか?もしそうなら、私はこれをどのように修正できますか?そうでない場合、追加レイテンシの原因は何ですか?
すべてのヘルプははるかに高く評価されています...