Shiny app very long TTFB

Hi community,
I am having troubles after installing Shiny Server Open Source.
I deployed my very own application which is working fine, but the TTFB time seems huge ! I searched in the forums, tried to improve coding etc, but it seems to be a more global problem. Indeed, the TTFB time is very long even for the hell/It's Alive basic app : around 6.5 sec of TTFB.
Here is the associated screenshot .

The problem is only occuring the first time the app loads. When I refresh the app, it takes around 1 sec.
Where could that come from ?
Thanks !

I recommend you to profile your code to find out where the problem is, take a look to this example that shows how to do it with profvis

https://rstudio.github.io/profvis/examples.html#example-3---profiling-a-shiny-application

Thank you for your answer,
The thing is, it is happening on the hello_world very basic application from the Shiny Server.
I read from this discussion group https://groups.google.com/forum/#!topic/shiny-discuss/r8pDDLYuTTU
that the simple apps should load within a second.

Have in mind that the loading time is going to be affected by the computational resources available on the server at any given moment and the capabilities of your network infrastructure.

Well, I thought that 4GB RAM and 2To of memory would be enough to host very basics shiny apps (I hoped !). Do you think that there is no other possibilities, than coming from my server resources and network ? The hello_world app is the most basic app, if it takes 6sec to load, it would not be acceptable for users (my own application will definitly be more computationally complex than the hello_world app)

Could you tell us more about your deployment setup? I think this has to do with your specific system configuration (networking most likely) since I can't reproduce your issue even with a t2.micro instance on AWS (very low computing power) or even rstudio-server installed on a Raspberry Pi 3B+ (even less computing power).

1 Like

Hi @andresrcs,
My server is Atom N2800 - 4GB DDR3 1066 MHz - 2To SATA.
It should be enough, right ?

Yes, In theory, but we don't know what other services you have running on that machine (consuming resources or generating conflicts) or if your network configuration could be causing the problem.
Since I can't reproduce your issue in two different systems, I believe this has to do with your specific system configuration and not with shiny, so there is not much we can do for you since we don't have access to your system.

Do you have any additional information you think it could be relevant for this issue?

The server is quite new and I have only a GitLab and an RStudio Server, both working really fine, that is why I thought it could come from shiny and that someone could have had the same issue as me.
Thank you anyway !