User session is getting interrupted after approx. 45 seconds

女生的网名这么多〃 提交于 2019-11-28 06:24:33

问题


I have the shiny application deployed on the Rshiny pro server(1.5.2).

Application does some heavy computations and generates the report without any problem if it gets completed before approximately 45 seconds.

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.

From above observations we know that the reconnect flag is enabled at the server.

I need help to understand-

  1. Why the user session is getting interrupted around approximately 45 seconds every single time.
  2. 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?

回答1:


Well, after searching and trying out different options I was able to find the answers to my questions.

  1. The user session was getting interrupted around approximately 45 seconds every single time because the http_keepalive_timeout parameter was not defined in the server configuration and the default value for http_keepalive_timeout parameter is 45 seconds.
  2. To prevent the session from getting reaped before the report generation, I added the http_keepalive_timeout parameter to the shiny-server.conf at the top level and set it's value to 120 seconds as shown below.

    http_keepalive_timeout 120;

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.

Reference: shiny server configuration



来源:https://stackoverflow.com/questions/45300285/user-session-is-getting-interrupted-after-approx-45-seconds

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