Updating Shiny Server Config to change timeout error

风流意气都作罢 提交于 2019-12-24 11:01:18

问题


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;

  }
}

回答1:


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;

  }
}


来源:https://stackoverflow.com/questions/51520166/updating-shiny-server-config-to-change-timeout-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!