doc-exports/docs/dws/dev/dws_04_0889.html
Lu, Huayi e6fa411af0 DWS DEV 830.201 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2024-05-16 07:24:04 +00:00

46 lines
10 KiB
HTML

<a name="EN-US_TOPIC_0000001188482316"></a><a name="EN-US_TOPIC_0000001188482316"></a>
<h1 class="topictitle1">Connection Settings</h1>
<div id="body8662426"><p id="EN-US_TOPIC_0000001188482316__en-us_topic_0059777636_p69637310112">This section describes parameters related to the connection mode between the client and server.</p>
<div class="section" id="EN-US_TOPIC_0000001188482316__s2d671f584b5647a19255e7c6a3d116aa"><a name="EN-US_TOPIC_0000001188482316__s2d671f584b5647a19255e7c6a3d116aa"></a><a name="s2d671f584b5647a19255e7c6a3d116aa"></a><h4 class="sectiontitle">max_connections</h4><p id="EN-US_TOPIC_0000001188482316__ab16a7d2206574058af94fc0babfc9b1f"><strong id="EN-US_TOPIC_0000001188482316__en-us_topic_0059777636_en-us_topic_0058967724_b47196620">Parameter description</strong>: Specifies the maximum number of allowed parallel connections to the database. This parameter influences the concurrent processing capability of the cluster.</p>
<p id="EN-US_TOPIC_0000001188482316__p251615331917"><strong id="EN-US_TOPIC_0000001188482316__b1979991434417">Type</strong>: POSTMASTER</p>
<p id="EN-US_TOPIC_0000001188482316__a033c8330e03f412884a1742780878208"><strong id="EN-US_TOPIC_0000001188482316__b10860327208">Value range</strong>: an integer. For CNs, the ranges from 1 to 16384. For DNs, the value ranges from 1 to 262143. Because there are internal connections in the cluster, the maximum value is rarely reached. If <strong id="EN-US_TOPIC_0000001188482316__b15480194712915">invalid value for parameter "max_connections"</strong> is displayed in the log, you need to decrease the <strong id="EN-US_TOPIC_0000001188482316__b191029547308">max_connections</strong> value for DNs.</p>
<p id="EN-US_TOPIC_0000001188482316__a6484ecbf671a458e9a42c04454e43c13"><strong id="EN-US_TOPIC_0000001188482316__b921920118155">Default value</strong>: <strong id="EN-US_TOPIC_0000001188482316__b113751017161512">800</strong> for CNs and <strong id="EN-US_TOPIC_0000001188482316__b16256203151">5000</strong> for DNs. If the default value is greater than the maximum value supported by kernel (determined when the <strong id="EN-US_TOPIC_0000001188482316__b172191611121517">gs_initdb</strong> command is executed), an error message will be displayed.</p>
<p id="EN-US_TOPIC_0000001188482316__ae4c883e2202045a4bb9b28ed591664f9"><strong id="EN-US_TOPIC_0000001188482316__en-us_topic_0059777636_b2809270516346">Setting suggestions</strong>:</p>
<p id="EN-US_TOPIC_0000001188482316__p452615084415">Retain the default value of this parameter on CNs. On a DN, the value of this parameter is calculated as follows:</p>
<p id="EN-US_TOPIC_0000001188482316__p1360914569443">dop_limit x 20 x 6 + 24: <strong id="EN-US_TOPIC_0000001188482316__b1645312717397">dop_limit</strong> indicates the number of CPUs of each DN in the cluster. It is calculated as follows: <strong id="EN-US_TOPIC_0000001188482316__b1445319278393">dop_limit</strong> = Number of logical CPU cores of a single server/Number of DNs of a single server.</p>
<p id="EN-US_TOPIC_0000001188482316__p6610826174512">The minimum value is 5000.</p>
<p id="EN-US_TOPIC_0000001188482316__a8efe0f70507c49cbb33c51a772b37b6a">If the parameter is set to a large value, <span id="EN-US_TOPIC_0000001188482316__text2034046385">GaussDB(DWS)</span> requires more SystemV shared memories or semaphores, which may exceed the maximum default configuration of the OS. In this case, modify the value as needed.</p>
<div class="notice" id="EN-US_TOPIC_0000001188482316__note51821344104916"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001188482316__p7182154416496">The value of <strong id="EN-US_TOPIC_0000001188482316__b183671349093">max_connections</strong> is related to <a href="dws_04_0893.html#EN-US_TOPIC_0000001188163786__s7f44489cfdce4bbea287150fb7333b9e">max_prepared_transactions</a>. Before setting <strong id="EN-US_TOPIC_0000001188482316__b4358142916109">max_connections</strong>, ensure that the value of <strong id="EN-US_TOPIC_0000001188482316__b9768541131019">max_prepared_transactions</strong> is greater than or equal to that of <strong id="EN-US_TOPIC_0000001188482316__b1721635171119">max_connections</strong>. In this way, each session has a prepared transaction in the waiting state.</p>
</div></div>
</div>
<div class="section" id="EN-US_TOPIC_0000001188482316__s3c7b3697f6a748f0baf5754e3c4b5d19"><h4 class="sectiontitle">sysadmin_reserved_connections</h4><p id="EN-US_TOPIC_0000001188482316__a8db7e896c45c42d2b5db52e5c5d1cf92"><strong id="EN-US_TOPIC_0000001188482316__en-us_topic_0059777636_a4b31a78195104adf92b9eed83bdbcd10">Parameter description</strong>: Specifies the minimum number of connections reserved for administrators.</p>
<p id="EN-US_TOPIC_0000001188482316__p733324718917"><strong id="EN-US_TOPIC_0000001188482316__b1997610149441">Type</strong>: POSTMASTER</p>
<p id="EN-US_TOPIC_0000001188482316__a6186f83bbb8144a69a55c8242f481fdc"><strong id="EN-US_TOPIC_0000001188482316__en-us_topic_0059777487_en-us_topic_0058967566_b6696864">Value range</strong>: an integer ranging from 0 to 262143</p>
<p id="EN-US_TOPIC_0000001188482316__a26b5925222734322a475d763ec44953c"><strong id="EN-US_TOPIC_0000001188482316__b842352706185015">Default value</strong>: <strong id="EN-US_TOPIC_0000001188482316__b842352706185018">3</strong></p>
</div>
<div class="section" id="EN-US_TOPIC_0000001188482316__sb9319017186d42d3bb1352d83a3c8b79"><h4 class="sectiontitle">application_name</h4><p id="EN-US_TOPIC_0000001188482316__ae39b72730bb945799b082fcf0b231f5d"><strong id="EN-US_TOPIC_0000001188482316__en-us_topic_0059777636_a256c2bab538d4586b07e2db0ba045933">Parameter description</strong>: Specifies the name of the client program connecting to the database.</p>
<p id="EN-US_TOPIC_0000001188482316__p1727443129"><strong id="EN-US_TOPIC_0000001188482316__b612055616446">Type</strong>: USERSET</p>
<p id="EN-US_TOPIC_0000001188482316__a76b2373b366e484f8a7ffc17a9e5c14d"><strong id="EN-US_TOPIC_0000001188482316__en-us_topic_0059777636_a0569bf5cd0fd491c8868b390ab1eed54">Value range</strong>: a string</p>
<p id="EN-US_TOPIC_0000001188482316__a341a9547ac924967a40f75d151e44b80"><strong id="EN-US_TOPIC_0000001188482316__en-us_topic_0059777636_a0bdfce78fa494bdd8c2c0156c1a0393d">Default value</strong>: <strong id="EN-US_TOPIC_0000001188482316__b842352706202555">gsql</strong></p>
</div>
<div class="section" id="EN-US_TOPIC_0000001188482316__section4834457114318"><a name="EN-US_TOPIC_0000001188482316__section4834457114318"></a><a name="section4834457114318"></a><h4 class="sectiontitle">connection_info</h4><p id="EN-US_TOPIC_0000001188482316__p209712583437"><strong id="EN-US_TOPIC_0000001188482316__b550332111816">Parameter description</strong>: Specifies the database connection information, including the driver type, driver version, driver deployment path, and process owner. (This is an O&amp;M parameter. Do not configure it by yourself.)</p>
<p id="EN-US_TOPIC_0000001188482316__p727782016135"><strong id="EN-US_TOPIC_0000001188482316__b15716105614419">Type</strong>: USERSET</p>
<p id="EN-US_TOPIC_0000001188482316__p1697185824318"><strong id="EN-US_TOPIC_0000001188482316__b920319251182">Value range</strong>: a string</p>
<p id="EN-US_TOPIC_0000001188482316__p7971145894312"><strong id="EN-US_TOPIC_0000001188482316__b1334182615182">Default value</strong>: an empty string</p>
<div class="note" id="EN-US_TOPIC_0000001188482316__note11998020131414"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001188482316__ul5214929175810"><li id="EN-US_TOPIC_0000001188482316__li1221452917581">An empty string indicates that the driver connected to the database does not support automatic setting of the <strong id="EN-US_TOPIC_0000001188482316__b124851628181817">connection_info</strong> parameter or the parameter is not set by users in applications.</li><li id="EN-US_TOPIC_0000001188482316__li421462916588">The following is an example of the concatenated value of <strong id="EN-US_TOPIC_0000001188482316__b7810143041810">connection_info</strong>:<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188482316__screen36131149104519"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="err">{</span><span class="ss">&quot;driver_name&quot;</span><span class="p">:</span><span class="ss">&quot;ODBC&quot;</span><span class="p">,</span><span class="ss">&quot;driver_version&quot;</span><span class="p">:</span><span class="w"> </span><span class="ss">&quot;(GaussDB 8.1.3 build 39137c2d) compiled at 2022-04-01 15:43:11 commit 3629 last mr 5138 debug&quot;</span><span class="p">,</span><span class="ss">&quot;driver_path&quot;</span><span class="p">:</span><span class="ss">&quot;/usr/local/lib/psqlodbcw.so&quot;</span><span class="p">,</span><span class="ss">&quot;os_user&quot;</span><span class="p">:</span><span class="ss">&quot;dbadmin&quot;</span><span class="err">}</span>
</pre></div></td></tr></table></div>
</div>
<p id="EN-US_TOPIC_0000001188482316__p14858414192914">For ODBC, JDBC, and GSQL connections, <strong id="EN-US_TOPIC_0000001188482316__b1167610324316">driver_name</strong>, <strong id="EN-US_TOPIC_0000001188482316__b177710720439">driver_version</strong>, <strong id="EN-US_TOPIC_0000001188482316__b109171010184317">driver_path</strong>, and <strong id="EN-US_TOPIC_0000001188482316__b19871914114316">os_user</strong> are displayed by default. For other interface connections, <strong id="EN-US_TOPIC_0000001188482316__b1775692464315">driver_name</strong> and <strong id="EN-US_TOPIC_0000001188482316__b1575511279430">driver_version</strong> are displayed by default. The display of <strong id="EN-US_TOPIC_0000001188482316__b1860224219434">driver_path</strong> and <strong id="EN-US_TOPIC_0000001188482316__b1411474610434">os_user</strong> is specified by users.</p>
</li></ul>
</div></div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_04_0888.html">Connection and Authentication</a></div>
</div>
</div>