Shiny app crashing due to high traffic

I am a first time Shiny user.

I recently deployed a fairly large app through Shinyapps.io using a free account. It got a lot of traffic (300+ users simultaneously) and promptly crashed. I've rewritten my code to run more efficiently, reduced the instance idle timeout time to the minimum (5 minutes), and reduced the instance load factor to 1%. All other settings are at the default, since I don't know what most of them mean. Even after these few changes it is still very slow to load even with minimal traffic.

Can anyone with more experience provide some insight? Are there more adjustments I can make to the settings? Or do I need to upgrade my account?

With that many users you will probably also go very fast through your server time. Did you think about the option of setting up your own sever? Dean Attali has written a very nice tutorial:

I have been using the cheapest droplet option and it has been running all my apps quite smoothly. I don't get that many users as you though...

1 Like

Yes and you can destroy your droplet at anytime so you don't have to pay anything if it doesn't work out.

Another thing you could try is to run your code through profvis which is build into Rstudio:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.

Thank you so much for sharing this.

After looking into this option, it seems like it's hard to predict how many users this could handle at once. It seems like a lot of variables come into play. I don't know what my max capacity needs to be, but in six hours my app had 18,000 (attempted) views.

However, this could very well be the answer to my problem. And it's inexpensive enough that I could get a subscription just to try it out.

Thanks again!