Shiny Performance Bottle Necks

I am trying to improve app launching. Currently, my apps take 20-15 seconds to start. I have isolated the issue. Here I have printed out the timings when I start the container manually with docker run:

From this I have isolated that the container itself launches fine. In other tests,

I have isolated the data load is not taking all that long. However, there appears to be an independent process, that takes a majority of the loading time eg it takes at least ten seconds for the “Listening on…” message to appear. I say it is independent, because I can move the data processing code into “server-start” contexts which alleviates maybe second or two of startup time. Is this a networking/authentication issue or something?

I don’t have a precise timing metric. However, it seems that if I create a service manually with docker service create for example the openanalytics rbase image.

I observe the delay. Is this a docker swarm issue. One thing that is confusing to us is why ShinyProxy creates a service per user, rather than one service that multiple users use with independent containers.

Not to bump the thread, however I was able to launch one of the apps via the stack service and end to end the service was created almost instantaneously. Though I wasn’t able to test the web socket. Is it the WebSocket initialization that is that slow?

One thing I have noticed though is that the from the docker client launching a service via docker service create vs. docker stack create seems to function very differently, possibly slower to create an independent service than a stack.

The standalone service took 6-7 seconds to deploy as compared to the stack that deployed very quickly.