<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Understanding the KeepAlive and KeepAliveInterval Parameters in SQL Server in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/understanding-the-keepalive-and-keepaliveinterval-parameters-in-sql-server/qaa-p/12725467#M4775693</link>
    <description>&lt;P&gt;Below is the explanation about the parameters.&lt;/P&gt;
&lt;P&gt;Keep Alive:           How often TCP verifies that an idle connection is still intact.&lt;BR /&gt;Keep Alive Interval:  The retry interval for unresponsive TCP Keep Alive transmissions. The default is 1000ms.&lt;/P&gt;
&lt;P&gt;The number of Keep Alive messages sent is controlled by TCP/IP parameter TcpMaxDataRetransmissions(default: 5) .&lt;/P&gt;
&lt;P&gt;When KeepAlive is set to 30 seconds and KeepAliveInterval is set to 12 seconds, the TCP keep-alive mechanism works as follows:&lt;/P&gt;
&lt;P&gt;1. Assume that the TCP connection is idle for a period of time. After 30 seconds of idleness, the operating system sends the first keep-alive probe packet to the remote endpoint to verify if the connection is still active.&lt;BR /&gt;2. If the remote endpoint responds to the keep-alive probe packet, the connection remains open.&lt;BR /&gt;3. After 12 seconds, the operating system sends another keep-alive probe packet if there is no response from the remote endpoint.&lt;BR /&gt;4. Repeat step 3 until the maximum number of retries(which is controlled by the TCP/IP parameter TcpMaxDataRetransmissions).&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;Given the above configuration of SQL Server clients, Keep Alive messages must be responded to by a SQL Server in no more than 90 seconds(30+12*5=90) best case. &lt;/P&gt;
&lt;P&gt;dbs/mss/conn_opts = KeepAlive=30;KeepAliveInterval=12. &lt;BR /&gt;TcpMaxDataRetransmissions=5&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;If the configuration is changed to below, then it would allow 220s(120+20*5=220).&lt;/P&gt;
&lt;P&gt;dbs/mss/conn_opts = KeepAlive=120;KeepAliveInterval=20,&lt;BR /&gt;TcpMaxDataRetransmissions=5&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;A connection disconnect error will be reported if the keep-alive probe is lost due to a remote host or network failure, or if multiple probes (default 5 in this case) are sent without receiving a response.&lt;/P&gt;</description>
    <pubDate>Wed, 10 May 2023 06:35:09 GMT</pubDate>
    <dc:creator>SAPSupport</dc:creator>
    <dc:date>2023-05-10T06:35:09Z</dc:date>
    <item>
      <title>Understanding the KeepAlive and KeepAliveInterval Parameters in SQL Server</title>
      <link>https://community.sap.com/t5/technology-q-a/understanding-the-keepalive-and-keepaliveinterval-parameters-in-sql-server/qaq-p/12725466</link>
      <description>&lt;P&gt;I want to increase the TCP Keepalive duration in my SQL Server. &lt;BR /&gt;Currently, the setting is dbs/mss/conn_opts = KeepAlive=30;KeepAliveInterval=12. &lt;BR /&gt;If I change it to dbs/mss/conn_opts = KeepAlive=120;KeepAliveInterval=20, how will the behavior change?&lt;/P&gt;&lt;BR /&gt;------------------------------------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;&lt;B&gt;Learn more about the SAP Support user and program &lt;A href="https://blogs.sap.com/2021/09/20/maximizing-the-power-of-sap-community-at-product-support/" target="_blank"&gt;here&lt;/A&gt;.&lt;/B&gt;</description>
      <pubDate>Wed, 10 May 2023 06:35:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/understanding-the-keepalive-and-keepaliveinterval-parameters-in-sql-server/qaq-p/12725466</guid>
      <dc:creator>SAPSupport</dc:creator>
      <dc:date>2023-05-10T06:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding the KeepAlive and KeepAliveInterval Parameters in SQL Server</title>
      <link>https://community.sap.com/t5/technology-q-a/understanding-the-keepalive-and-keepaliveinterval-parameters-in-sql-server/qaa-p/12725467#M4775693</link>
      <description>&lt;P&gt;Below is the explanation about the parameters.&lt;/P&gt;
&lt;P&gt;Keep Alive:           How often TCP verifies that an idle connection is still intact.&lt;BR /&gt;Keep Alive Interval:  The retry interval for unresponsive TCP Keep Alive transmissions. The default is 1000ms.&lt;/P&gt;
&lt;P&gt;The number of Keep Alive messages sent is controlled by TCP/IP parameter TcpMaxDataRetransmissions(default: 5) .&lt;/P&gt;
&lt;P&gt;When KeepAlive is set to 30 seconds and KeepAliveInterval is set to 12 seconds, the TCP keep-alive mechanism works as follows:&lt;/P&gt;
&lt;P&gt;1. Assume that the TCP connection is idle for a period of time. After 30 seconds of idleness, the operating system sends the first keep-alive probe packet to the remote endpoint to verify if the connection is still active.&lt;BR /&gt;2. If the remote endpoint responds to the keep-alive probe packet, the connection remains open.&lt;BR /&gt;3. After 12 seconds, the operating system sends another keep-alive probe packet if there is no response from the remote endpoint.&lt;BR /&gt;4. Repeat step 3 until the maximum number of retries(which is controlled by the TCP/IP parameter TcpMaxDataRetransmissions).&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;Given the above configuration of SQL Server clients, Keep Alive messages must be responded to by a SQL Server in no more than 90 seconds(30+12*5=90) best case. &lt;/P&gt;
&lt;P&gt;dbs/mss/conn_opts = KeepAlive=30;KeepAliveInterval=12. &lt;BR /&gt;TcpMaxDataRetransmissions=5&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;If the configuration is changed to below, then it would allow 220s(120+20*5=220).&lt;/P&gt;
&lt;P&gt;dbs/mss/conn_opts = KeepAlive=120;KeepAliveInterval=20,&lt;BR /&gt;TcpMaxDataRetransmissions=5&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;A connection disconnect error will be reported if the keep-alive probe is lost due to a remote host or network failure, or if multiple probes (default 5 in this case) are sent without receiving a response.&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 06:35:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/understanding-the-keepalive-and-keepaliveinterval-parameters-in-sql-server/qaa-p/12725467#M4775693</guid>
      <dc:creator>SAPSupport</dc:creator>
      <dc:date>2023-05-10T06:35:09Z</dc:date>
    </item>
  </channel>
</rss>

