How many simultaneous users on an app deployed to shinyapps.io?

shinyappsio
#1

Hi,

I’m helping with the development of a Shiny app that my organisation plans to deploy to shinyapps.io. I’ve been asked how many people will be able to use our app simultaneously. (The context for this question is the possibility of an initial surge of interest immediately after launch, rather than on-going traffic.)

Having looked at these links…

… I understand that a Professional plan on shinyapps.io will support:

  • up to 10 instances of the app running at the same time
  • up to 10 R worker processes running on each instance
  • multiple end-users being serviced by each R worker process.

Does this mean it’s realistic to think we could have up to 100 R worker processes in action supporting 1000 (or 2000, or perhaps even 5000?) simultaneous end-users?
Especially if:

  • the data files loaded by the app are not too big – so that 10 separate R worker processes really can be running in the memory allocated to a single instance
  • the app is not computationally heavy – essentially filtering a dataframe of pre-calculated statistics and re-drawing graphs – so that a single R worker process really can handle several end-users.

Does anyone have experience of an app getting a spike of this kind of traffic on shinyapps.io?
Or experience of how to load test an app on shinyapps.io?

Many thanks.

2 Likes

#2

I'm sure that the RStudio staff can jump in here and avise you on the specifics on Shiny plans, but if your app's computation involves simply filtering a data frame and rerendering an associated plot, you might also want to look into crosstalk. It allows one or more plots and some simple controls to talk to each other in some limited ways (including filtering and brushing), and the set of plots/controls can be rendered out as a static HTML file (essentially in the same way any other htmlwidget would be rendered).

This HTML file can then be put on a host for static sites, like GitHub Pages or Netlify, and take as much traffic as you want, which makes it great if you need to handle a surge of initial traffic rather than regular, ongoing traffic :slightly_smiling_face:

1 Like

#3

Although this will not currently work directly on shinyapps.io, a big performance determiner for this whole process will be the performance / latency of your Shiny application per R worker process. As a result, it might be worth taking a look at the shinyloadtest package. It, along with the profvis package, will likely help you clean up the bottlenecks in performance of your Shiny application itself and thereby increase the number of users that can work simultaneously on a single R process. Then, by your calculations, you have ~ 100 such R processes with which to serve users. For instance, the difference between 20 users and 50 users on each single R process would determine between 2000 and 5000 final users.

There are also lots of tricks for saving on the static content computation, like @rensa mentioned with crosstalk. memoise is another useful one, as well as the more recent plot caching.

2 Likes