Shiny App on Shinyapps.io loads very slow

Hi everyone,

I have a relativly small application hosted on shinyapps.io that loads a 56000 x 23 data.frame from a roughly 3000 KB RDS-file. The small view is build with the "shinydashboard" package and contains three tabs.

  • Welcome: Empty
  • Plot: selectizeInput, plotlyOutput: Select row -> Display plot via plotly bar chart (23 bars)
  • Download: selectInput, downloadButton, dataTableOutput -> Select set of columns to download table as csv, with preview

Packages used: shiny, shinydashboard, DT, plotly
I'm on the free tier, thus I have 1 instance with 1 GB of Memory (Metrics shows a max, of 125 MB is actually used).

Startup time locally is around 3 seconds, on shinyapps.io around 27 seconds on Chrome, 45 seconds on EDGE, and does not load on Firefox with a "slow website" warning.

Error-logs on shinyapps show no errors or warnings.
CPU-Usage is around 3,5 x 10^9 nanoseconds, thus 3,5 seconds. (This should be the overall loading time.. give or take a second for the rendering)

Network traffic seems as follows:
A couple of .js are loaded in the first 5 seconds. Then after shinyapps.css there is a 20 seconds break where nothing is beeing loaded and then a xhr request with "_token?_=XXXXX" followed by a few other xhr requests.

I cant believe that loading this few packages and the dataset from a RDS-file takes 27 seconds, neglecting the fact that firefox will not load at all.

Is there anything that I can do?

Cheers

Ron

I suggest trying the app with a smaller dataset to see if this is the cause. 56000 x 23 sounds kinda big and I would expect the free tier to be slower than your own computer.

Hi villanueval,

Thanks for the reply. The dataset size is totally fine for the free tier shinyappsio instance ...

However whats brings it down to its knees was the 'selectizeInput' with 56.000 options (one for each row in the data.frame). I could solve this issue thanks to:

Hope this helps someone else facing this issue.

Cheers,

Ron

2 Likes

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