缓慢加载闪亮的应用程序

Slow loading shiny apps

我已经在远程 Centos 服务器上安装了 shiny-server。 闪亮的配置如下所示:

# Instruct Shiny Server to run applications as the user "shiny"
run_as <user>;
# 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;
}
}

每当我将闪亮的应用程序文件放在 /srv/shiny-server 文件夹中时,它都能很好地加载。 但是我尝试创建一个文件夹,然后使用文件路径调用不同的应用程序,但它们需要很长时间才能加载。

为了使用路径在一台服务器上部署多个应用程序,是否缺少某些东西?

后来我发现更快的方法是在 /srv/shiny-server 中创建一个文件夹,然后添加一个符号 link 到:/opt/shiny-server/foldername 然后,您会将您的应用程序存储在第二个位置,并从第一个位置调用它们。 加载速度现在好一点。当然这也取决于你的代码的效率。