了解 ShinyServer 上托管的 RShiny 应用程序的可扩展性 [英] Understanding the scalability of RShiny apps hosted on ShinyServer

查看:20
本文介绍了了解 ShinyServer 上托管的 RShiny 应用程序的可扩展性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为一个我正在考虑将其转变为公司的项目构建一系列闪亮的交互式网络应用程序.我的背景是数据科学,我在 Web 应用程序/服务器端没有很多经验,但这些是我在项目中需要考虑的重要方面.我目前有一个安装了 ShinyServer(免费、开源)的 Amazon Linux AMI EC2 实例,并且我目前正在那里托管我的 Web 应用程序的早期版本.到目前为止一切正常,但我还没有公开链接.

I am building a series of interactive shiny web apps for a project that I am considering turning into a Company. My background is in data science and I don't have a lot of experience on the web app / server side of things, but these are important aspects for me to consider with my project. I currently have an Amazon Linux AMI EC2 instance with ShinyServer (free, open-source) installed, and I am currently hosting early versions of my web apps there. So far everything works fine, but I haven't made the links public yet.

  1. 我的第一个问题是是否有人知道我在使用 RShiny 应用程序和 ShinyServer 时是否会不可避免地遇到某些限制(可扩展性限制、与数据库的集成限制、安全/身份验证限制等)? 我还没有听说过许多成功的、超级流行的网络应用程序是托管在 ShinyServer 上的闪亮应用程序,但我的感觉是 ShinyServer 主要用于托管仅在少数人之间共享的 RShiny 应用程序(即在公司的团队成员之间共享.).每个线程 - R-Server 或 Shiny Server 是否为每个用户创建一个新的 R 进程/实例? - 我特别担心我的应用程序将无法同时处理数千个用户,因为只创建了 1 个 R 进程对于应用程序,无论应用程序的并发用户数量如何.如果我打算扩展到超过数百或数千个用户,那么通过 ShinyServer pro 拥有 10-20 个进程可能无法解决问题.我还注意到 ShinyServer Pro 每年会给我带来不可忽视的 1 万美元.

  1. My first question is whether anyone knows if there are certain limitations (scalability limitations, integration with database limitations, security / authentication limitations, etc.) that I will inevitably run into using RShiny apps and ShinyServer? I haven't heard of many successful, super-popular web apps being shiny apps hosted on ShinyServer, but rather my feeling is that ShinyServer is mainly used for hosting RShiny apps that are shared amongst only a small number of people (i.e. shared amongst team members at a company.). Per this thread - Does R-Server or Shiny Server create a new R process/instance for each user? - I am particularly concerned that my app won't be able to handle thousands of users simultaneously since only 1 R process is created for the app regardless of the # of concurrent users of the app. Having 10-20 processes through ShinyServer pro probably doesn't solve the issue either if I ever intend to scale greater than the hundreds or thousands of users. I also noticed that ShinyServer Pro would run me a not-so-negligible $10K per year.

我的第二个问题是是否可以使用其他服务器技术(例如 Heroku)部署 RShiny 应用程序.我遇到了这个 github 页面(https://github.com/virtualstaticvoid/heroku-buildpack-r/tree/heroku-16) 但还没有深入研究它.有人告诉我,heroku 可以轻松更新代码在 github (git push heroku:master) 上的应用程序的版本.

My second question is whether RShiny apps can be deployed using other server technologies, such as Heroku. I came across this github page (https://github.com/virtualstaticvoid/heroku-buildpack-r/tree/heroku-16) but haven't dug too deep into it yet. I've been told that heroku makes it easy to update releases to apps whose code is on github (git push heroku:master), amongst other things.

我的第三个问题涉及我的某些特定考虑.特别是,我目前正在编写一个脚本,该脚本从 API 查询数据并将该数据写入我的(尚未设置的)数据库.这是我的应用程序使用的数据,我有兴趣在数据库更新时实时更新应用程序,而无需用户刷新网页.我的一个朋友为这种类型的异步行为建议了 AJAX,看起来这在 R 中是可能的,就像这样(https://github.com/daattali/advanced-shiny/tree/master/api-ajax).

My third question involves certain specific considerations of mine. In particular, I am currently working on a script that queries data from an API and writes that data to a (not-yet-setup) database of mine. This is the data my apps use, and I'd be interested in having the apps update in real time as the database updates, without requiring the user to refresh the webpage. A buddy of mine suggested AJAX for this type of asynchronous behavior, and it looks like this may be possible in R with something like this (https://github.com/daattali/advanced-shiny/tree/master/api-ajax).

很抱歉,这是一个如此沉重的问题,但我希望它不会被关闭,因为我认为它很有教育意义.任何建议/来源/将我指向正确的方向将不胜感激.

Sorry that this is such a loaded question, but I hope it doesn't get closed down as I think it is fairly educational. Any suggestions / sources / pointing me in the right direction would be greatly appreciated on this.

推荐答案

Canovice,

我建议您查看以下 RStudio/AWS 支持文章.要扩展闪亮的服务器,您需要考虑使用负载平衡器:

I'd recommend you take a look at the following RStudio / AWS support articles. To scale a shiny server you'll need to look at using a load balancer:

  • RStudio

  • RStudio

AWS

博客文章:

Shiny 是一个很棒的平台,他们的支持很棒.我建议你给他们打电话——他们一定会帮助回答你的问题.

Shiny is a great platform, their support is fabulous. I'd recommend you ring them up - they'll be sure to help answer your questions.

也就是说,如果您的计划是创建一个可扩展的网站来支持数千或数十万人,那么我的感觉是建议您也查看并考虑使用 D3.jsreact.jsAngular.js,别忘了提到node.js.

That said if your plan is to create a scalable website that will support thousands or hundreds of thousands of people then my sense would be to recommend you also review and consider using D3.js in conjunction with react.js or Angular.js, not forgetting to mention node.js.

我的感觉是,您正在查看连接到逻辑引擎和可视化前端的后端数据库.如果您正在寻找有关用法的良好概述,请查看以下网页和 git repo [有点过时但很有用]:

My sense is that you are looking at a backend database connected to a logic engine and visualisation front end. If you are looking for a good overview of usage take a look at the following web page and git repo [A little dated but useful]:

我希望以上内容为您指明了正确的方向.

I hope the above points you in the right direction.

这篇关于了解 ShinyServer 上托管的 RShiny 应用程序的可扩展性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆