R Shiny at IQSS
  • Introduction
  • Getting started
    • Determining your resource requirements
    • Applying for an account
  • Deploying
    • Setup your environment
    • Deploying an example Shiny app
    • Bootstrapping a new Shiny app or migrating a pre-existing Shiny application
    • Developing locally with RStudio
    • Developing locally using Docker
    • Speeding up deployments with Packrat
  • Configuration
    • Setting up a custom domain for your Shiny app
    • Installing additional system-level packages
    • Limiting the number of R Threads
  • Best Practices
    • File storage
    • Using promises
    • Adding routes
  • Troubleshooting
    • Resolving Application Error screen
    • Viewing app logs
    • Viewing resource consumption
    • Configuring Shiny session auto-reconnect
    • Getting support
Powered by GitBook
On this page
  1. Troubleshooting

Configuring Shiny session auto-reconnect

You may have noticed that your application greys out after a short period of time. This is by design - as R is single threaded and uses a persistent websocket to communicate with the R process, the developers of the R programming language wanted to limit resource consumption by severing the connections of idle users.

Using allowReconnect

Adding this inside your server function will allow auto-reconnect:

server = function(input, output, session) {
   ...
   session$allowReconnect("force")
}

Your R session will still disconnect after idling, but, will reconnect in 5 seconds. This is our prefferred method because it will still utilize Heroku's load balancing functionality if one of your dynos is under heavy use.

PreviousViewing resource consumptionNextGetting support

Last updated 5 years ago