title: Keep connection alive using --sysctl with Docker run
body: <p>I currently have a container that is running node services. There code running creates a subscription to the Salesforce Change data capture event bus using CometD. This has been working well but after some time the service will stop receiving events from the Salesforce. </p>
  
  <p>I am thinking this is happening because the alpine Linux container could be marking the connection as broken after data is not received after a while. I have verified that the CometD libraries are creating a connection with keep alive set as true.</p>
  
  <p>Right now I am trying to increase the keep-alive time by running the container with the command:</p>
  
  <pre><code>docker run --sysctl net.ipv4.tcp_keepalive_time=10800 --sysctl net.ipv4.tcp_keepalive_intvl=60 --sysctl net.ipv4.tcp_keepalive_probes=20  -p 80:3000 &lt;imageid&gt;
  </code></pre>
  
  <p>My thinking behind this is:</p>
  
  <pre><code>net.ipv4.tcp_keepalive_time=10800 
  This means that the keepalive routines wait for three hours (1080 secs) 
  before sending the first keepalive probe
  
  net.ipv4.tcp_keepalive_intvl=60
  Resend the prob every 60 seconds
  
  net.ipv4.tcp_keepalive_probes=20
  If no ACK response is received for 20 consecutive times, the connection is 
  marked as broken.
  </code></pre>
  
  <p>I guess what I am asking is if this is the correct way to go about running the docker container so that sysctl will run with the settings I have passed in.</p>
  
  <p>I am new to docker, so, I'm sure I did something that doesn't make sense. Thank you for any suggestions.</p>