3

I have a shiny app with a downloadHandler built in and it works great for smaller datasets but when the file gets large (330 MB), it times out and I get an error.

I found this SO question (shiny downloadHandler timeout) which seems to address the answer although I don't know how to update the config file to take into account http_keepalive_timeout.

Below is my config file:

# Instruct Shiny Server to run applications as the user "shiny"
run_as shiny;


# Define a server that listens on port 3838
server {
  listen 3838;

  # Define a location at the base URL
  location / {

    # Host the directory of Shiny Apps stored in this directory
    site_dir /srv/shiny-server;

    # Log all Shiny output to files in this directory
    log_dir /var/log/shiny-server;

    # When a user visits the base URL rather than a particular application,
    # an index of the applications available in this directory will be shown.
    directory_index on;

  }
}
Kevin
  • 1,974
  • 1
  • 19
  • 51

1 Answers1

10

Fixed it using this SO answer User session is getting interrupted after approx. 45 seconds

I was putting the http_keepalive_timeout function in the wrong place. Please see below for the correct shiny-server.conf update:

# Instruct Shiny Server to run applications as the user "shiny"
run_as shiny;
http_keepalive_timeout 180;

# Define a server that listens on port 3838
server {
  listen 3838;

  # Define a location at the base URL
  location / {

    # Host the directory of Shiny Apps stored in this directory
    site_dir /srv/shiny-server;

    # Log all Shiny output to files in this directory
    log_dir /var/log/shiny-server;

    # When a user visits the base URL rather than a particular application,
    # an index of the applications available in this directory will be shown.
    directory_index on;

  }
}
Kevin
  • 1,974
  • 1
  • 19
  • 51
  • Hello, same problem... are you using shiny-server pro or open source version? – Ika8 Aug 07 '18 at 09:44
  • Using the open source version. Make sure you are putting the function in the right section of the configuration file. – Kevin Aug 09 '18 at 18:01