Shiny Server stopping shiny apps over a certain memory usage limit?

1,722 views
Skip to first unread message

Brian Repko

unread,
Oct 26, 2014, 3:09:43 AM10/26/14
to shiny-...@googlegroups.com
We have a network visualization shiny app that runs fine with RStudio but when we deploy it to the open source version of Shiny Server it will not run.
It starts up ok but then it tries to load the network data and the process gets killed.
I've added the app_init_timeout and app_idle_timeout settings (set to 1800) but it gets killed after a few seconds only so that does not seem to be it.

Is there a memory limit on shiny apps hosted within the open source version of shiny server?
How can I get around this limit?

Thanks!

Brian Repko

unread,
Oct 26, 2014, 5:51:21 AM10/26/14
to shiny-...@googlegroups.com
Looking through the code for shiny-server I don't see anything related to memory limits.

I do see that the default init timeout is 60 seconds and the idle timeout is 5 seconds.
I'll have to look at the code to see but the loading of the network might be after a first request (and thus timed by idle vs init).
This could easily be an idle timeout and not a memory limit.

I'm having trouble understanding where to set the environment variables for logging level (is this for shiny-server - which is running as root for me - or for shiny user which is starting the app).  And then where the logging is done for shiny-server vs the shiny apps.

-brian

Brian Repko

unread,
Oct 29, 2014, 6:38:22 AM10/29/14
to shiny-...@googlegroups.com
After some investigating and code review - there is nothing in shiny-server that kills the job based on memory usage. We just had an application that grew bigger than the physical memory of the machine.

There is nothing that logs the setting of the app_init_timeout and app_idle_timeout but I could see their effect in that the shiny apps stayed alive longer.

Logging required adding to the upstart file (env and export directives) and then also the shiny users .bashrc file but I really didn't see any changes.

I did add "cat(<message>, file=syserr())" all over the place to see how far it got before dying.  When I realized it was not always the same place (and then took out various parts of the app) we then realized we were on a 1gb memory image and were using all of that for the app.

Issue resolved and I'm just adding details here for the next person that searches for this stuff...

--
You received this message because you are subscribed to a topic in the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/shiny-discuss/Zj9JfuIO-0o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/45f22ca7-8442-4939-a682-2e2e8e9c0bda%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Joe Cheng

unread,
Oct 29, 2014, 7:12:58 PM10/29/14
to Brian Repko, shiny-...@googlegroups.com
Glad you were able to figure it out. For future reference, if a process is getting killed by Linux's out-of-memory killer, you should be able to find evidence of that by executing "dmesg".

--
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/CAJ-XmVNZYPyx7%2BjD%2BxxSSBd5zAOujxpDcqrapjtQ-jJMR6vg%2Bw%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages