multiple users crash shiny.io app - configure instance size a remedy?

616 views
Skip to first unread message

Aaron Swoboda

unread,
Sep 23, 2014, 5:43:14 PM9/23/14
to shiny-...@googlegroups.com

I'm a teacher and new to shiny. I love the idea of creating shiny apps, deploying them to the web, and having my students access them in class as in-class activities. I deployed my first app for class via shinyapps.io https://aswoboda.shinyapps.io/BasketSimulator/BinarySim.Rmd
and everything looked great when I started class. I had my students click on the url to access the site to play around with the app and it kept crashing with an "Application unexpectedly exited. Diagnostic information has been dumped to the JavaScript error console." error. I don't know where to look for the JavaScript error console and, to be honest, I'm not sure I'd be able to decipher it anyway…

I looked around a bit and noticed the idea of configuring the app to be a bigger instance. I tried to follow these instructions to and increase the instance size, but after the command:
shinyapps::configureApp("BasketSimulator", size="medium")
I get the following error message…
Error in lint(appDir) : Cancelling deployment: invalid project layout.
The project should have one of the following layouts:
1. 'shiny.R' and 'ui.R' in the application base directory,
2. 'shiny.R' and 'www/index.html' in the application base directory,
3. An R Markdown (.Rmd) document.

First, is changing the instance size a solution to the problem of the app crashing with multiple users? 
If so, can anyone point me to resources to help me figure out how do to configure the app size, given my problems with the configureApp command?

I don't really understand the "Error in lint(appDir)" message above.  I think my app *is* an .Rmd file that a) sources an .R script which defines a shinyApp function, and b) calls the function. Thus, my .Rmd file is basically…

```{r, echo=FALSE}
source("myscript.R")
myfunction()
```
In my shinyapp.io dashboard the app name is listed as "BasketSimulator", but am I missing something simple about the name of my app?


Thanks,

Aaron

PS. I just updated to shinyApps version 0.3.58 and have redeployed my app and still get the same behavior...

Joe Cheng

unread,
Sep 24, 2014, 4:49:08 AM9/24/14
to Aaron Swoboda, shiny-...@googlegroups.com, Andy Kipp
(cc Andy)

--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/250642ec-4ea0-481e-9737-a9e32fea8789%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yihui Xie

unread,
Sep 24, 2014, 12:57:01 PM9/24/14
to Aaron Swoboda, shiny-discuss
I'm not sure about the reason for crashing, but I guess you did not
set your working directory to the directory of your app before you
call shinyapps::configureApp(), e.g.

setwd('path/to/your/app/') # if in RStudio, Session->Working
dir->Source file...
list.files() # should see ui.R/server.R, or www/index.html, or *.Rmd
shinyapps::configureApp("BasketSimulator", size="medium")

If you do not setwd(), you will have to provide the path of your app
to the appDir argument of shinyapps::configureApp(), e.g.

shinyapps::configureApp("BasketSimulator",
appDir="path/to/your/app/", size="medium")

Regards,
Yihui

Aaron Swoboda

unread,
Sep 24, 2014, 9:35:26 PM9/24/14
to shiny-...@googlegroups.com, aaron....@gmail.com
Thanks Yihui. I set my working directory as you suggested and the configureApp() command worked as I expected (it redeployed my app). However, the crashing still persists. I'm able to open two different browsers and when I increase the simulation parameters the app crashes just like before… I think I should refine my app to limit the maximum number of replications in the simulation, but can anyone advise me on how to think about how much a given instance on shinyapps.io can handle if I have 20 simultaneous users?

Aaron

Andy Kipp

unread,
Sep 25, 2014, 10:41:35 PM9/25/14
to Aaron Swoboda, shiny-discuss
Aaron, If your application is memory intensive, you can try moving to an even large instance type (perhaps "large" or "xlarge"). If applicable, you can look into loading data globally rather then on a per session basis, as this will ease the memory required for each additional user of your app.

-Andy

--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages