5

Extra information relevant to this: https://shiny.rstudio.com/articles/scaling-and-tuning.html

I am trying to determine the best Worker and Instance settings for my Shiny App to make the user experience as smooth as possible. For the most part, traffic on the app is minimal, but there will be some times where traffic will be abnormally high such as when it is being presented to a large audience (maybe 100+ users?).

First, based on personal experience as well as this SO question., I am setting the "Max Connections" (the number of concurrent connections allowed per R worker process) to 1. This will avoid some strange 'interactions' between connections that share the same R worker.

I have a Professional subscription to shinyapps.io, which means each app has a maximum of 10 instances. In the settings for the app, I have the ability to adjust several values to determine when new instances are launched, when new workers are added or shared, etc.

Consider two scenarios:

  1. I set it up so there is as many instances as possible, and additional workers fill in as they appear. If I have a max of 10 workers per instance, the first 10 connections would each start their own instance, and the 11th connection would end up joining one of those instances with a new worker.

  2. I set it up to have as few instances as possible, adding workers until a new instance is needed. If max of 10 workers per instance, the first connection starts the instance, the next 9 start workers within that instance, and the 11th will start a new instance and worker.

What are the pros and cons to using either of these methods?

Does one increase performance? Are they the same?

Does having more workers on an instance slow computational speeds?

Thanks!

TTS
  • 1,818
  • 7
  • 16

1 Answers1

0

I'm wondering the same thing, but set "Max connection" to 1 seems not efficient to me, as they can be up to 50 isn't it

speedy
  • 3
  • 1