ShinyProxy not connecting to apps which require longer times to load

Hello,

First of all a huge thanks for the team for providing this platform for deploying shiny apps.

We are currently facing some issues with the loading of a few of our Shiny apps, which are experiencing significant delays to open or even not open at all (perhaps due to the number of modules that need to be loaded at startup).

Here are the observations we’ve made:

  1. When running these apps locally within an R session, the browser opens, and the content is displayed within approximately one minute.
  2. When we manually run the Docker image, the containers successfully start in the background and can be accessed through their respective ports.
  3. However, when we attempt to access the apps via the ShinyProxy platform (by clicking on the app icon), they fail to load after a long period of attempting to establish a connection, despite the containers opening correctly in the background. The logs indicate that ShinyProxy makes several attempts (approximately every 7 seconds) and shows the following message: “Container unresponsive, trying again (37/310).”

According to the ShinyProxy configuration documentation, a container is considered “available” only when its HTTP listener responds with a status code of 200.

We suspect that this behavior suggests ShinyProxy does not directly check for the container’s availability but instead waits for the HTTP listener to respond. If ShinyProxy attempts to establish a connection every 7 seconds, it may not provide sufficient time for our applications to become fully available before it retries.

For your reference, we are currently using ShinyProxy version 3.1.1 with the default Docker setup, and our Shiny apps are built using the Golem framework.

Has anyone else encountered this? Any ideas or suggestions on how to address this?

Thanks!

Hi, thanks for the detailed explanation. First of all, I think it’s not ideal that the initial request to your app takes ~1 minute. In general we try to load these kind of modules in the startup of the Shiny app and not during the initial request.

ShinyProxy has an undocumented property proxy.container-wait-timeout which is by default 5 seconds. This is the timeout for the request which checks whether the app is ready. You mention the check happens every 7 seconds, this confirms that you are hitting this timeout, since there is a delay of 2 seconds between every check. You could try changing this property to e.g. 100 seconds using:

proxy:
   container-wait-timeout: 100000
1 Like

Hi @tdekoninck, thank you for your response, it worked!

Indeed, that seem to have been the issue. I would have never thought about the existence of this (undocumented) property! As far as your point about not being ideal to load these modules up during the initial request, you are right, this is something that we currently look at how to improve.

Thank you.