openanalytics / shinyproxy

ShinyProxy - Open Source Enterprise Deployment for Shiny and data science apps
https://www.shinyproxy.io
Apache License 2.0
525 stars 151 forks source link

Running multiple instances of ShinyProxy has led to the unresponsiveness or failure of ShinyProxy Application Proxies. #438

Closed littlenetcoder closed 1 year ago

littlenetcoder commented 1 year ago

ShinyProxy version - 3.0.1/3.0.2

For the purpose of replicating the problem locally, I've set up a configuration similar to the one provided at containerized Kubernetes config,utilizing WSL/Minikube.

While operating a single ShinyProxy instance, everything appears to be functioning adequately. However, upon expanding the ShinyProxy instances to two or more, I consistently encounter the following issues:

I am utilizing the IP from the minikube service to access ShinyProxy.

Our infrastructure is primarily composed of Azure Kubernetes Services, the Nginx Ingress Controller, custom ShinyProxy code, and other components.

I would appreciate it if you could assist me with this issue, as I have no intention of transitioning to or utilizing the shinyproxy-operator.

LEDfan commented 1 year ago

Hi

You don't need the operator for running multiple proxies, however, you'll have to run ShinyProxy in High Availability mode. This requires a Redis server, which is used for persisting session information and also for communicating between the replicas.

So basically the steps are:

  1. deploy a Redis server (or use one provided by a cloud service)
  2. configure ShinyProxy to use "session persistence" and "app persistence" https://shinyproxy.io/documentation/configuration/#session-and-app-persistence

Although you don't want to use the operator, you can have a look at the examples in the operator repo, especially these parts: https://github.com/openanalytics/shinyproxy-operator/blob/master/docs/deployment/overlays/1-namespaced/resources/shinyproxy.shinyproxy.yaml#L11-L22

The operator does not do anything with Redis, so you can use the same config actually.

littlenetcoder commented 1 year ago

I appreciate your reply. I inadvertently omitted to mention that I am utilizing Redis along with ShinyProxy session persistence, but not App persistence. I have also activated Application recovery. I will now attempt the approach involving Application persistence.

littlenetcoder commented 1 year ago

I followed the recommended approach, and it worked wonderfully. I'm pleased to report that my problem has been resolved. Thank you so much for your prompt assistance.