Disconnected from the (shiny) server: cause of large Plotly R heatmaps

*爱你&永不变心* 提交于 2021-02-20 19:11:47

问题


I'm developing quite a complex shiny app that runs on a private shinyserver. Only the pages that contains large plotly heatmaps (50-70Mb) are not working online (but the pages are working perfectly on my local machine). What I get is the usual message "Disconnected from the server Reload". When this error message is shown no log file is produced in /var/log.

What I tried to do is:

  • check if it's a missing packages problem, it's not;

  • check if it's a wrong paths problem, it's not;

  • modify the shiny-server.conf file contained in /etc/shiny-server/ adding the top lines: http_keepalive_timeout 300; sockjs_heartbeat_delay 300;

So I'm led to believe that the problem is related to the size of the plots. How to face that problem? Unfortunately due to the size of the shiny app is not easy to exhibit a reproducible example of my case here.


回答1:


I have run into the same problem using the heatmaply package which depends on the dendextend package. The dendextend package relies on a recursive expression which can easily exceed the number of nested expressions allowed by the version of R running on your server. See this issue: https://github.com/talgalili/dendextend/issues/53.

You can try setting the expressions limit well above the default 5000 and see if this helps (max allowed is 500,000).

options(expressions = 500000)


来源:https://stackoverflow.com/questions/58119865/disconnected-from-the-shiny-server-cause-of-large-plotly-r-heatmaps

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