大约过后,用户会话被打断. 45秒 [英] User session is getting interrupted after approx. 45 seconds
问题描述
我在Rshiny pro server(1.5.2)
上部署了闪亮的应用程序.
I have the shiny application deployed on the Rshiny pro server(1.5.2)
.
如果应用程序在大约45 seconds
之前完成,它会进行大量的计算并生成报告,而不会出现任何问题.
Application does some heavy computations and generates the report without any problem if it gets completed before approximately 45 seconds
.
如果计算和报告生成时间超过了大约45秒,则用户与服务器的会话/连接将被中断.然后,服务器几乎立即自动reconnecting
断开连接的用户. re-connection
几秒钟后,用户会话开始收起,并向用户显示不工作错误.
If the computation and report generation goes beyond approximately 45 seconds, user's session / connection to the server is getting interrupted. Then automatically server is reconnecting
the disconnected users almost immediately. After few seconds of re-connection
the user session is getting reaped and user is presented with the notwork error.
从上面的观察中我们知道服务器上的reconnect
标志是enabled
.
From above observations we know that the reconnect
flag is enabled
at the server.
我需要帮助来了解-
- 为什么每次大约在
45 seconds
左右用户会话都被中断. - 如何防止此会话中断?服务器或应用程序端是否有任何配置可以帮助我实现用户和服务器之间的不间断会话?
- Why the user session is getting interrupted around approximately
45 seconds
every single time. - How to prevent this session interruption? Is there any configuration at server or application side which will help me achieve uninterrupted session between user and server?
推荐答案
好吧,在搜索并尝试了不同的选项后,我能够找到问题的答案.
Well, after searching and trying out different options I was able to find the answers to my questions.
- 由于大约没有在
server configuration
中定义http_keepalive_timeout
参数,并且default value
的default value
参数是45 seconds
,因此用户会话每次大约被中断45秒. -
为防止会话在报告生成之前被占用,我在
top level
的shiny-server.conf
中添加了参数并将其值设置为120 seconds
如下所示.
- The user session was getting interrupted around approximately 45 seconds every single time because the
http_keepalive_timeout
parameter was not defined in theserver configuration
and thedefault value
forhttp_keepalive_timeout
parameter is45 seconds
. To prevent the session from getting reaped before the report generation, I added the
http_keepalive_timeout
parameter to theshiny-server.conf
at thetop level
and set it's value to120 seconds
as shown below.
http_keepalive_timeout 120;
http_keepalive_timeout 120;
您可以根据需要设置http_keepalive_timeout
值.我将其设置为120
,因为我的应用程序正在使用100-110 seconds
来生成报告.
You can set the http_keepalive_timeout
value as per your wish. I set it to 120
as my application is taking around 100-110 seconds
to generate the report.
参考:发光的服务器配置
这篇关于大约过后,用户会话被打断. 45秒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!