Disconnected from Server in shinyapps, but local's working

前端 未结 3 1438
萌比男神i
萌比男神i 2020-12-19 09:34

I deployed my Shiny code to shinyapps.io successful. My data has little much rows (over 190,000), these data\'s can display in my local PC but shinyapps cannot with \'Discon

相关标签:
3条回答
  • 2020-12-19 10:08

    You might be using setwd() in your code. Delete that line or comment it out so you can later choose to run it when running your app locally. Then try again.

    #Set wd if running code locally----
    #setwd("/Users/Dropbox/YourPathHere/")
    
    0 讨论(0)
  • 2020-12-19 10:16

    If there are no errors in the logs, then you are likely running into one of two problems: You are either running out of memory, or your application startup is timing out.

    Try reducing your data to just a few rows and see if it displays. If you can get something to display, then you know it's a data size issue. Next, try increasing the application startup time under Settings -> Advanced -> Startup Timeout.

    If that doesn't fix it, you may be running out of memory. Make sure you're on the Large setting under Settings -> General -> Instance Size.

    shinyapps.io only allows up to 1GB for the free tier, so to get around it you'll either need to find a way of reducing your data or getting a paid plan: http://shiny.rstudio.com/articles/shinyapps.html

    0 讨论(0)
  • 2020-12-19 10:31

    I had faced a similar issue, adding a few pointers which might help someone.

    Load you application and try analysing the requests from the browser network logs section.

    On doing so i noticed two of my requests from the Shiny app were pretty heavy and taking a long while ~25-30s. After a while connection would get terminated with the error as below:

    {"type":"close","code":3000,"reason":"No response from heartbeat","wasClean":true}

    Shiny has few params related to heartbeat.

    http://docs.rstudio.com/shiny-server/#sockjs_heartbeat_delay

    Setting them is what helped me. Increase the value of 'sockjs_heartbeat_delay' in shiny-server.conf to a large number and the disconnect issue was not seen anymore.

    0 讨论(0)
提交回复
热议问题