s-u / Rserve

Fast, flexible and powerful server providing access to R from many languages and systems
http://RForge.net/Rserve
Other
282 stars 65 forks source link

SO_KEEPALIVE apparently not activated although set in Rserv.conf #165

Closed sli-speers closed 3 years ago

sli-speers commented 3 years ago

Dear Simon,

I face an issue on Rserve running on a GCP Linux instance. I know that GCP denies traffic from inactive connections using a timeout of 600s. That can be avoided/customized when the SO_KEEPALIVE variable is set and system control tcp settings are customized accordingly in /etc/sysctl.conf. I also activated the settings. In order to set the tcp.keepalive active, I need to add the follwing line in Rserve.conf: keep.alive enable

The Problem occurs when a client connects to Rserve via TCP. Request get valid responses unless the processing time exceeds the GCP limit of 600s. Above that, it fails.

When running netstat -tnope I see the follwing (excerpt) Proto Recv-Q Send-Q Local Address Foreign Address State User Inode PID/Program name Timer tcp 0 0 xx.xxx.x.x.:30120 xx.xx.xxx.xxx:56988 ESTABLISHED 0 1274377 - off (0.00/0/0) tcp 0 0 xx.xxx.x.x:41876 xxx.xxx.xxx.xxx:80 ESTABLISHED 0 358273 - keepalive (1.71/0/0)

The first line is my client connection as I recognize it from the foreign address (I run Rserve on port 30120). The Timer column indicates keepalive is apparently not activated for the connection. But Rserve should be started with the option since it is stated in the Rserve.conf which is also used (checked it with the --RS-settings option when starting Rserve in the command line). But basically keepalive is possible as the other line shows.

I would be happy, if you can give me any advise how to solve that issue.

Best regards from Switzerland Stefan Lieder

sli-speers commented 3 years ago

Update: having all the configurations made in Rserve.conf I needed to start Rserve additionally with the option --RS-set keep.alive=enable Then it workes.