Prevent SSH connection restarts
Set a high idle timeout on the sshkit connection pool. This will reduce the incidence of re-connection storms when a deployment has been idle for a while (e.g. when waiting for a docker build). The default timeout was 30 seconds, so we'll enable keepalives at a 30s interval to match. This is to help prevent connections from being killed during long idle periods.
This commit is contained in:
@@ -143,6 +143,7 @@ class Mrsk::Commander
|
||||
private
|
||||
# Lazy setup of SSHKit
|
||||
def configure_sshkit_with(config)
|
||||
SSHKit::Backend::Netssh.pool.idle_timeout = config.sshkit_pool_idle_timeout
|
||||
SSHKit::Backend::Netssh.configure do |sshkit|
|
||||
sshkit.max_concurrent_starts = config.sshkit_max_concurrent_starts if config.sshkit_max_concurrent_starts
|
||||
sshkit.ssh_options = config.ssh_options
|
||||
|
||||
Reference in New Issue
Block a user