settings for simultaneous users

I make/use shiny apps a lot for my courses. However, I often have issues when many students are trying to use an app simultaneously in class (~25 users). Yesterday only about 5 or so were able to connect and the rest were shut out. It's not clear to me exactly how to configure worker/instance settings to maximize the number of connections. I'm much less concerned about overall computational performance; I just want to make sure people can connect. My college has a professional plan so I imagine that I should be able to find a config that should handle this. Any thoughts on this kind of tuning?

I would start here

Thanks. I've checked that out, but it's hard to figure out what combination of changes will fix the issue. An important issue is making sure that I don't run out of memory (observed in the log), so I think it would be good to cap the workers/connections and increase the instances. But it never seems to start more than one instance, even if the start count is > 1 and the instance load factor is low.

I just tested the following settings by rapidly opening up 25 connections using browseURL():
workers = 3
max connection = 2
instance load factor = 5%
start count = 5

This resulted in 6 successful connections one a single instance. Any idea why I can't seem to have multiple instances? Do I need to start them manually?


for (i in 1:25) browseURL("___")

I've got a better handle on this now, but cannot seem to make use of multiple instances. I've created four instances (didn't realize this had to be done manually - the only way?), but the total max connections that I'm able to achieve when testing is the maximum amount per instance. I've got memory concerns so really want to make use of multiple instances instead of more workers/connections on a single instance. Here are my current settings:

Max Worker Processes = 3
Max Connections = 4
Worker Load Factor = 5%

Instance Load Factor = 25%
Start Count = 4

This should result in a max of 48 total connections, 12 per instance. When I shut down all instances and start adding browser connections, I can see that all of the 4 instances are indeed started, but after 12 connections I can't add any more (503 error). Any thoughts on why I can't seem to make use of my 4 instances?

Determining when another worker would be started:

Max # of Concurrent connections per worker * Worker Load Factor
50 * 5% = 2.5 (meaning the 3rd Browser Connection would add another worker up to the Max worker processes)

Determining when another Application Instance would be started:

Max # of connections per worker * Max worker processes * Instance Load Factor
50 * 3 * 50% = 75 (meaning the 76th connection would cause an additional instance to be started)

I'm running a large class (180 students, a learnr tutorial for homework every class day) and had considerable problems with students being locked out. I tried adjusting the parameters you've described. The main thing that made a difference was increasing the number of instances. I thought this happened automatically, but evidently you have to create them in the dashboard. This is very easy, but at least for me the little "+" box which adds a new instance didn't draw my attention. Making 3 or four instances eliminated the problems from the student's end.

Thanks very much. Wow, if you can get it working with 180 students, I have hope! I've managed to create/start multiple instances, but can't seem to make use of them and increase the max connections. However, I haven't tested it with students, just with many tabs in my browser.

Would you mind sharing your app settings?