更新 Shiny Server Config 以更改超时错误

Posted

技术标签:

【中文标题】更新 Shiny Server Config 以更改超时错误【英文标题】:Updating Shiny Server Config to change timeout error 【发布时间】:2019-01-02 08:20:54 【问题描述】:

我有一个内置 downloadHandler 的闪亮应用程序,它适用于较小的数据集,但当文件变大 (330 MB) 时,它会超时并出现错误。

我发现了这个 SO question (shiny downloadHandler timeout),虽然我不知道如何更新配置文件以考虑到http_keepalive_timeout,但它似乎解决了答案。

下面是我的配置文件:

# 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】:

使用这个 SO 答案 User session is getting interrupted after approx. 45 seconds 修复它

我将http_keepalive_timeout 函数放在了错误的位置。请参阅下面的正确shiny-server.conf 更新:

# 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;

  

【讨论】:

您好,同样的问题...您使用的是shiny-server pro还是开源版本? 使用开源版本。确保将函数放在配置文件的正确部分。

以上是关于更新 Shiny Server Config 以更改超时错误的主要内容,如果未能解决你的问题,请参考以下文章

在不同于 3838 的端口上运行 Shiny-server

R Shiny服务器分段错误

通过 Shiny Server 将 Shiny 输入传递给 R markdown

没有定义 UI (shiny-server)

SHINY-SERVER R(sparkR)语言web解决方案 架设shiny服务器

shiny server SparkR web展示界面