Restricting the number of concurrent users

Hi Open Analytics community,

We just started using shinyproxy to deploy shiny apps at our university. We are very happy with it so far. There is one thing about which I did not manage to find any information. So ShinyProxy launches a new container for every user and I understand we can limit the number of instances that each user can run using the max-instances setting. What we want to do however is to limit the number of concurrent users. The apps are published open, without a need for authentication. So we want to avoid a situation where maybe 50 different people open some app. We want to limit it to maybe 5 users per app at any given point in time.
I did not find info about any setting for this. Did I miss something?
How would you suggest we can implement this? Tips are very much appreciated.

I wonder why you’d want to do such a thing. Having more users surely is a sign of success. Limiting access will most likely discourage people from using your apps if whenever they try they are denied access and told to try again later. If you think you have limited compute resources, I’d still give it a go as it is to see when you start actually hitting a limit because many web apps are actually quite light on server-side resource consumption with most of the work being done in the user’s browser. On the other hand if your apps may need a lot of server resources (e.g. running computational notebooks) then maybe you need to consider providing enough to support the number of users. Finally if you’re serving your apps behind a reverse proxy (e.g. nginx) you may be able to limit access by playing with request rates and number of connections (for nginx, see https://docs.nginx.com/nginx/admin-guide/security-controls/controlling-access-proxied-http/).

Thank you for your answer jkh1. I am sure I want to limit the number of users.
We are looking for a way to control the number of instances that shinyproxy launches in our cluster, not for a way to limit each instance.