Files
doc-exports/docs/dws/dev/dws_04_0933.html
luhuayi 177cd61a57 DWS DEVG 910.211 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: luhuayi <luhuayi@huawei.com>
Co-committed-by: luhuayi <luhuayi@huawei.com>
2025-05-05 07:44:03 +00:00

47 lines
11 KiB
HTML

<a name="EN-US_TOPIC_0000001811610209"></a><a name="EN-US_TOPIC_0000001811610209"></a>
<h1 class="topictitle1">Connection Pool Parameters</h1>
<div id="body8662426"><p id="EN-US_TOPIC_0000001811610209__a1cadae29bdd84e19ac3b9bae49d0759f">When a connection pool is used to access the database, database connections are established and then stored in the memory as objects during system running. When you need to access the database, no new connection is established. Instead, an existing idle connection is selected from the connection pool. After you finish accessing the database, the database does not disable the connection but puts it back into the connection pool. The connection can be used for the next access request.</p>
<div class="section" id="EN-US_TOPIC_0000001811610209__sc9c97fb885594225a376d39f91845fee"><h4 class="sectiontitle">max_pool_size</h4><p id="EN-US_TOPIC_0000001811610209__a3b121f3339d3491b80ee2aa00f66992e"><strong id="EN-US_TOPIC_0000001811610209__en-us_topic_0059778940_a1ca253ddce2441cf8b8d6f82d17c7f9e">Parameter description</strong>: Specifies the maximum number of connections between a CN's connection pool and another CN/DN.</p>
<p id="EN-US_TOPIC_0000001811610209__p1885114228172"><strong id="EN-US_TOPIC_0000001811610209__b382382015282">Type</strong>: POSTMASTER</p>
<p id="EN-US_TOPIC_0000001811610209__a986b627362984189a31ab73966eb2898"><strong id="EN-US_TOPIC_0000001811610209__en-us_topic_0059778940_ada726e79b9c74f56ba3626fe5f5b1677">Value range</strong>: an integer ranging from 1 to 65535</p>
<p id="EN-US_TOPIC_0000001811610209__af243e3971ca441089644847a6aee996f"><strong id="EN-US_TOPIC_0000001811610209__b1967920595297">Default value</strong>: <strong id="EN-US_TOPIC_0000001811610209__b1068555912299">800</strong> for CNs and <strong id="EN-US_TOPIC_0000001811610209__b868525915297">5000</strong> for DNs</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001811610209__s54b4d54e64cf428a9252ba49d1cdd764"><h4 class="sectiontitle">persistent_datanode_connections</h4><p id="EN-US_TOPIC_0000001811610209__a738cbfaa6cb54465baa34876da91e104"><strong id="EN-US_TOPIC_0000001811610209__en-us_topic_0059778940_ad21f6468a3c6461996f0aab15ae85e27">Parameter description</strong>: Specifies whether to release the connection for the current session.</p>
<p id="EN-US_TOPIC_0000001811610209__p3484113092116"><strong id="EN-US_TOPIC_0000001811610209__b35453211280">Type</strong>: USERSET</p>
<p id="EN-US_TOPIC_0000001811610209__a0a6616daa1be461395783884efb042d4"><strong id="EN-US_TOPIC_0000001811610209__en-us_topic_0059778940_a5ec3a68435cc432eaa6db4762412b487">Value range</strong>: Boolean</p>
<ul id="EN-US_TOPIC_0000001811610209__u2cd2d2836d4c49d8a7a64fdf1722fa3c"><li id="EN-US_TOPIC_0000001811610209__l57ee25a767f94ab8b9f7331d9bb93b42"><strong id="EN-US_TOPIC_0000001811610209__b8423527061141">off</strong> indicates that the connection for the current session will be released.</li><li id="EN-US_TOPIC_0000001811610209__l4e85a05db83545b0a04a8c11c1029bf1"><strong id="EN-US_TOPIC_0000001811610209__b84235270611425">on</strong> indicates that the connection for the current session will not be released.<div class="notice" id="EN-US_TOPIC_0000001811610209__naf35617accbd4929904bc019b87774ec"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001811610209__af187cf68aade4c78bb7f8b8d8152c7e6">After this function is enabled, a session may hold a connection but does not run a query. As a result, other query requests fail to be connected. To fix this problem, the number of sessions must be less than or equal to <strong id="EN-US_TOPIC_0000001811610209__b84235270616156">max_active_statements</strong>.</p>
</div></div>
</li></ul>
<p id="EN-US_TOPIC_0000001811610209__ae4423ac5b2604a1587cb37f47148c777"><strong id="EN-US_TOPIC_0000001811610209__b55233292105553">Default value</strong>: <strong id="EN-US_TOPIC_0000001811610209__b842352706172155">off</strong></p>
</div>
<div class="section" id="EN-US_TOPIC_0000001811610209__se03ee3f924314e70b9a42e77ef722221"><h4 class="sectiontitle">cache_connection</h4><p id="EN-US_TOPIC_0000001811610209__aba07f9d3fe5e4d4e913daf534b825849"><strong id="EN-US_TOPIC_0000001811610209__en-us_topic_0059778940_aff31e1628fc84fc88d7d478bcc5a657f">Parameter description</strong>: Specifies whether to reclaim the connections of a connection pool.</p>
<p id="EN-US_TOPIC_0000001811610209__p1486312190189"><strong id="EN-US_TOPIC_0000001811610209__b174767532432">Type</strong>: USERSET</p>
<p id="EN-US_TOPIC_0000001811610209__aec932c9fb0054788987d117a372b5abe"><strong id="EN-US_TOPIC_0000001811610209__en-us_topic_0059778940_aeececbe0666644ef9dae29b4d7cbb3fe">Value range</strong>: Boolean</p>
<ul id="EN-US_TOPIC_0000001811610209__ue0e25b0236b845f6aec7ca32ac3d059f"><li id="EN-US_TOPIC_0000001811610209__l513e16ab830448ab8a463f1b81fbd22c"><strong id="EN-US_TOPIC_0000001811610209__b84235270611753">on</strong> indicates that the connections of a connection pool will be reclaimed.</li><li id="EN-US_TOPIC_0000001811610209__l647543f14ba94cabb816c7be6c37b1de"><strong id="EN-US_TOPIC_0000001811610209__b478517890">off</strong> indicates that the connections of a connection pool will not be reclaimed.</li></ul>
<p id="EN-US_TOPIC_0000001811610209__a6dce22e3e6ac48a2b760790759faf143"><strong id="EN-US_TOPIC_0000001811610209__en-us_topic_0059778346_a30e99140fb09438ab2bb77f75bd21bb4">Default value</strong>: <strong id="EN-US_TOPIC_0000001811610209__en-us_topic_0059778346_en-us_topic_0058967649_b842352706195040">on</strong></p>
</div>
<div class="section" id="EN-US_TOPIC_0000001811610209__section201924413346"><h4 class="sectiontitle">enable_force_reuse_connections <strong id="EN-US_TOPIC_0000001811610209__b419219483419"></strong></h4><p id="EN-US_TOPIC_0000001811610209__p94501445375"><strong id="EN-US_TOPIC_0000001811610209__b19777112310596">Parameter description</strong>: Specifies whether a session forcibly reuses a new connection.</p>
<p id="EN-US_TOPIC_0000001811610209__p6945105582016"><strong id="EN-US_TOPIC_0000001811610209__b12669155194311">Type</strong>: USERSET</p>
<p id="EN-US_TOPIC_0000001811610209__p845074415371"><strong id="EN-US_TOPIC_0000001811610209__b1494045465813">Value range</strong>: Boolean</p>
<ul id="EN-US_TOPIC_0000001811610209__ul19450144493715"><li id="EN-US_TOPIC_0000001811610209__li1345014443719"><strong id="EN-US_TOPIC_0000001811610209__b676725912591">on</strong> indicates that the new connection is forcibly used.</li><li id="EN-US_TOPIC_0000001811610209__li14960351175814"><strong id="EN-US_TOPIC_0000001811610209__b202226187016">off</strong> indicates that the current connection is used.</li></ul>
<p id="EN-US_TOPIC_0000001811610209__p1567854435615"><strong id="EN-US_TOPIC_0000001811610209__b17265194125912">Default value</strong>: <strong id="EN-US_TOPIC_0000001811610209__b4266164115918">off</strong></p>
</div>
<div class="section" id="EN-US_TOPIC_0000001811610209__section1519981815319"><h4 class="sectiontitle">syscache_clean_policy</h4><p id="EN-US_TOPIC_0000001811610209__p920018181313"><strong id="EN-US_TOPIC_0000001811610209__b8241552104019">Parameter description</strong>: Specifies the policy for clearing the memory and number of idle DN connections. This is supported only by clusters of version 9.1.0.100 or later.</p>
<p id="EN-US_TOPIC_0000001811610209__p2020081819317"><strong id="EN-US_TOPIC_0000001811610209__b67118116275">Type</strong>: SIGHUP</p>
<p id="EN-US_TOPIC_0000001811610209__p2587195320392"><strong id="EN-US_TOPIC_0000001811610209__b7436567946730">Value range</strong>: a string</p>
<p id="EN-US_TOPIC_0000001811610209__p1372554412483">This parameter policy consists of three values:</p>
<ol id="EN-US_TOPIC_0000001811610209__ol165263020497"><li id="EN-US_TOPIC_0000001811610209__li1526120184913">The first value ranges from 0 to 1 and represents the percentage of total available memory used by DNs. When the percentage of used memory reaches this value, 1/4 of the stream threads will be cleared, and the second value will be evaluated.</li><li id="EN-US_TOPIC_0000001811610209__li1552610010491">The second value ranges from 0 to 1 and represents the percentage of total available memory used by syscache on DNs. When the percentage of syscache memory usage reaches this value, the third value will be evaluated.</li><li id="EN-US_TOPIC_0000001811610209__li1252618018497">The third value ranges from 0 to INT_MAX and is measured in MB. It represents the size of syscache memory used by idle threads. When the syscache memory usage of an idle thread reaches this value, the syscache used by that thread will be cleared.</li></ol>
<p id="EN-US_TOPIC_0000001811610209__p32009182311"><strong id="EN-US_TOPIC_0000001811610209__b64421954205319">Default value</strong>: 0.8,0.3,64</p>
<div class="notice" id="EN-US_TOPIC_0000001811610209__note8200618163120"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><ul id="EN-US_TOPIC_0000001811610209__ul161616322537"><li id="EN-US_TOPIC_0000001811610209__li14161153213537">Before setting this parameter, evaluate the memory usage using views <a href="dws_04_0852.html">PV_SESSION_MEMORY_DETAIL</a> and <a href="dws_04_0855.html">PV_TOTAL_MEMORY_DETAIL</a>.</li><li id="EN-US_TOPIC_0000001811610209__li5161163219533">When setting this parameter, follow the specified format, ensuring that the three values are separated by commas without spaces.</li><li id="EN-US_TOPIC_0000001811610209__li7161143265312">If the parameter is not set according to the specified format and the setting fails, a WARNING log will be generated in the log, and the parameter value displayed when using the SHOW command to query the parameter will be the last successfully set value. If the setting fails and the system is restarted, the parameter will be set to the default value.</li><li id="EN-US_TOPIC_0000001811610209__li780341917115">During the Readcommand phase, if a thread on CN times out after 30 seconds, it will clear DNs if syscache is greater than 256 MB. There are two operations:<ol id="EN-US_TOPIC_0000001811610209__ol185909516113"><li id="EN-US_TOPIC_0000001811610209__li11590851141113">If the overall memory usage reaches 80%, an auxiliary thread will monitor the memory usage and clear 1/4 of the stream threads. It will also check if syscache usage exceeds 30% of the total memory usage. If it does, it will clear the syscache of Readcommand phase pg threads greater than 64 MB.</li><li id="EN-US_TOPIC_0000001811610209__li659014515111">If a stream thread is idle for more than 30 seconds and syscache usage is greater than 64 MB, it will clear the syscache.</li></ol>
</li></ul>
</div></div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_04_0883.html">GUC Parameters of the GaussDB(DWS) Database</a></div>
</div>
</div>