Reputation: 131
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 'Disconnected from the server.'
So I get Basic-plan and set memory size is xxxlarge and config some other settings.
But my apps shut-down with 'Disconnected from the server.' continue..
How can I set my server setting?
Please help me, and sorry my bad English.
Here is server log and url https://tmap.shinyapps.io/break_map/ (RN count 3~19, and all select mech_cd, then shut-down)
2016-08-24T05:34:08.539162+00:00 shinyapps[121340]: Server version: 0.4.5.2170
2016-08-24T05:34:08.539194+00:00 shinyapps[121340]: R version: 3.3.0
2016-08-24T05:34:08.539201+00:00 shinyapps[121340]: shiny version: 0.13.2
2016-08-24T05:34:08.539203+00:00 shinyapps[121340]: rmarkdown version: NA
2016-08-24T05:34:08.539204+00:00 shinyapps[121340]: knitr version: NA
2016-08-24T05:34:08.539212+00:00 shinyapps[121340]: RJSONIO version: NA
2016-08-24T05:34:08.539204+00:00 shinyapps[121340]: jsonlite version: 0.9.19
2016-08-24T05:34:08.539212+00:00 shinyapps[121340]: htmltools version: 0.3.5
2016-08-24T05:34:08.754267+00:00 shinyapps[121340]: Using jsonlite for JSON processing
2016-08-24T05:34:08.758255+00:00 shinyapps[121340]:
2016-08-24T05:34:08.758256+00:00 shinyapps[121340]: Starting R with process ID: '17'
2016-08-24T05:34:08.964272+00:00 shinyapps[121340]: Loading required package: gsubfn
2016-08-24T05:34:08.970689+00:00 shinyapps[121340]: Loading required package: proto
2016-08-24T05:34:09.000933+00:00 shinyapps[121340]: Warning: no DISPLAY variable so Tk is not available
2016-08-24T05:34:09.011202+00:00 shinyapps[121340]: Loading required package: RSQLite
2016-08-24T05:34:09.016999+00:00 shinyapps[121340]: Loading required package: DBI
2016-08-24T05:34:10.597571+00:00 shinyapps[121340]: Loading required package: tcltk
2016-08-24T05:34:12.215392+00:00 shinyapps[121340]:
2016-08-24T05:34:12.215396+00:00 shinyapps[121340]: Listening on http://0.0.0.0:60468
Upvotes: 10
Views: 14326
Reputation: 624
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/")
Upvotes: 1
Reputation: 560
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.
Upvotes: 3
Reputation: 1564
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
Upvotes: 5