Rethinkdb google-compute-engine shuts down

Hi, I ran rethinkdb setup on google-compute-engine instance.

I mainly use change files (socket connections) to db and connect to them from my local computer or applications.

For this, I use the npm rethinkdb-websocket-server and client packages.

It works fine, although I am experiencing disconnect connections. It works for about 10 minutes, after which the connection drops and starts again.

I did not notice anything special in the google-compute-engine instance other than some botnet trying to log in, I saw them in the serial console. Could this be the cause of the disconnection, and in this case how to prevent it?

it works fine, if I run setup on my localhost instead, then there is no disconnect at all.

The rethinkdb magazine doesn't say anything about any issues.

Anyone who has an idea of ​​what might be causing something like this, I don’t even know where to start looking, so any suggestions are welcome.

+4
source share
1 answer

Connections with an instance of the Compute Engine instance after 10 minutes of inactivity. To keep live unused connections alive, you need to change the keepalive TCP protocol by doing the following:

# Display the current tcp_keepalive_time value.
$ cat /proc/sys/net/ipv4/tcp_keepalive_time

# Set tcp_keepalive_time to 60 seconds and make it permanent across reboots.
$ echo 'net.ipv4.tcp_keepalive_time = 60' | sudo tee -a /etc/sysctl.conf

# Apply the change.
$ sudo /sbin/sysctl --load=/etc/sysctl.conf

# Display the tcp_keepalive_time value to verify the change was applied.
$ cat /proc/sys/net/ipv4/tcp_keepalive_time
+4
source

Source: https://habr.com/ru/post/1619495/


All Articles