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-
45 seconds
every single time.Well, after searching and trying out different options I was able to find the answers to my questions.
http_keepalive_timeout
parameter was not defined in the server configuration
and the default value
for http_keepalive_timeout
parameter is 45 seconds
.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