1

When running my ShinyApp locally, the webpage interactivity never shutdowns (turns grey and takes no user input). When running this same app in browser r-server RStudio, app shutdowns in a minute or so.

Any dummy server would do, but for example

library(shiny)
ui <- fluidPage(
  h1("Example"),
  inputPanel(
    actionButton("button", "This is button")
  )
  
)
server <- function(input, output){
  observeEvent(input$button,
                print("Button pressed.")
  )
}
shinyApp(ui=ui, server=server)

follows the described behavior.

How do I disable or bypass this?

vahvero
  • 525
  • 11
  • 24

1 Answers1

3

This might depend on your server - do you experience the same issue when publishing to shinyapps? If not, it could be an issue with the RStudio server setup.

Either way, take a look at the configuration reference:

3.3 Application Timeouts

app_idle_timeout -- Defines the amount of time (in seconds) an R process with no active connections should remain open. After the last connection disconnects from an R process, this timer will start and, after the specified number of seconds, if no new connections have been created, the R process will be killed. The default value for app_idle_timeout is 5 seconds. Setting app_idle_timeout to 0 will disable the app idle time out.

EDIT: In case it is your RStudio server, take a look at /etc/rstudio/rsession.conf - especially session-timeout-minutes=nn (Reference).

mhovd
  • 3,724
  • 2
  • 21
  • 47
  • I have no knowledge of anyone publishing from our system. It is a closed one. Do these timeouts apply to free version of R server? I assumed paid version to be but this might not be the case after-all. – vahvero Jul 06 '20 at 06:47