R プロジェクトの Web インターフェイスに OpenCPU を使用しています。プロジェクトは正常に動作しており、ローカル マシン (シングル ユーザー サーバー) で期待どおりの結果を得ることができます。
その後、プロジェクトを VM にデプロイしましたが、うまくいきませんでした。VM では、R プロンプトから R 機能が正しく動作しています。単一のユーザーも機能しており、cURL を使用してクエリを実行できます。ただし、公開サーバーは常にハングアップし、90 秒後にタイムアウトします
その他の注意事項:
- tvscore や gitstats などのサンプル プロジェクトは、クラウド サーバーでも正常に動作しています。
- 私のプロジェクトはrJavaに基づいています。セットアップに問題がありましたが、最終的にシングルユーザーサーバーで機能しました.
- AWS EC2 t2.micro を試しました。Google n1 (1-CPU 3.75 GB) および n2 (2-CPU 7.5 GB) インスタンスも試しました。
- /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"]
}