shinyapps.io 503 errors

Hi all --
We have created a fairly massive shiny app that is used in real time during motorsports racing events. It receives real time GPS/telemetry data from vehicles on track and allows users to compare driving lines and other aspects between different laps and/or vehicles/competitors.

We have a professional subscription to shinyapps.io to test out its viability for hosting the app long term. We have the app configured to use the xxxlarge app size, spin up 10 instances, and we limit each instance to only 1 worker process and 1 connection (the resources required for this app are high, and any time we have a setup that allows sharing of resources, there are performance hits).

However, at random times, we receive 503 errors when the app attempts to refresh data, or when a user first attempts to visit the app. It usually requires clearing their browser cache in order to get the 503 error to go away (otherwise, once they get the 503, they are never able to get into the app until browser cache is cleared).

I'm not sure why we are receiving the 503 errors as often/sporadically as we do. There doesn't seem to be a pattern, it's very random.

Has anyone else experienced this behavior on shinyapps.io?

Thanks!

1 Like

With only 1 worker supporting 1 connection per instance, you could handle at most 10 requests across 10 instances.

However, instances will go to sleep if they are idle. And it requires load to trigger them to spin up. While they spin up, a 503 will be returned if you have reach the limit of simultaneous requests.

There are various resources that talk about tuning Shiny applications:

And since you have the Professional subscription, you could open a support ticket to get more help.

Thank you for the feedback!

We are aware that our configuration will result in only a single connection per instance, and we have deployed our app in such a way that it will only ever have 10 users (we grant access to only 10 users for each app, and when we need more users, we deploy the app multiple times) --

It's not ideal, but we notice performance degradation when we have an instance spawn multiple worker processes, and/or allow a worker process to service multiple connections -- again, we attribute this to the fact that this app is enormous!

I'm getting the 503 screen too, but on startup.

I too have a big app of size 276MB (disk) and 3.1GB (RAM). On startup, quite a few heavy files are loaded, which takes about one minute. Here is a clear and minimal step-by-step description of my problem:

    1. on dashboard, all 5 instances associated with the app are stopped
    1. I connect to the app, all instances immediately start
    1. on the app's tab in my browser, I can see the 'please wait' message on top. After a couple of seconds, it is replaced by the 503 screen
    1. if I immediately refresh (no matter how many times I try), the tab immediately reloads the 503 screen. However, after waiting for about one minute, any new refresh now makes the tab load something. The tab keeps loading (with the 503 screen still on) for about 30 seconds. Then, finally, the 503 screen disappears and the app interface shows.

Instead of displaying the 503 screen (which is quite scary to the user), why doesn't the 'please wait' message stays until the first instance is ready to serve the app? This is what happens for all my other apps and it is much better. Why is the big size of this particular app breaking this pipeline?

Below are my app's settings:

instance type: 3X-large
Max Worker Processes = 2
Max Connections = 1
Instance Load Factor = 60
start count = 5
Worker Load Factor = 5.

I also have a paying account, and filed an issue on Rstudio support (see bottom of the page): https://support.rstudio.com/hc/en-us/requests/35035

Thank you in advance for any help.

Antoine

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