forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: luhuayi <luhuayi@huawei.com> Co-committed-by: luhuayi <luhuayi@huawei.com>
51 lines
12 KiB
HTML
51 lines
12 KiB
HTML
<a name="EN-US_TOPIC_0000001811490701"></a><a name="EN-US_TOPIC_0000001811490701"></a>
|
|
|
|
|
|
<h1 class="topictitle1">User Resource Monitoring</h1>
|
|
|
|
<div id="body0000001721404474"><p id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_en-us_topic_0000001510283549_ab7a2234c948342cbb38eb4abd101dc13">In the multi-tenant management framework, you can query the real-time usage of all user resources (including the memory, number of CPU cores, storage space, temporary space, operator spilling space, and I/Os) in real time through the system views <a href="dws_04_0790.html">PG_TOTAL_USER_RESOURCE_INFO</a> and <a href="dws_04_1020.html">PGXC_TOTAL_USER_RESOURCE_INFO</a> and the function <strong id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_b687419971012">GS_WLM_USER_RESOURCE_INFO</strong>. You can also query the system catalog <a href="dws_04_0567.html">GS_WLM_USER_RESOURCE_HISTORY</a> and system view <a href="dws_04_1021.html">PGXC_WLM_USER_RESOURCE_HISTORY</a> for the historical usage of user resources.</p>
|
|
<div class="section" id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_section22721941181017"><h4 class="sectiontitle">Precautions</h4><ul id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_ul1315045071011"><li id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_li2341101952615">The CPU, I/O, and memory usage of all jobs on fast and slow lanes (simple jobs on fast lanes and complex jobs on slow lanes) can be monitored.</li><li id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_en-us_topic_0000001233883263_li383120481562">Currently, the memory and CPU usage of fast track jobs are not controlled. When the fast lane jobs occupy a large number of resources, the used resources may exceed the resource limit.</li><li id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_li16758131410313">In the DN monitoring view, I/O, memory, and CPU display the resource usage and limits of resource pools.</li><li id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_li39446209283">In the CN monitoring view, I/O, memory, and CPU display the total resource usage and limit of all DN resource pools in the cluster.</li><li id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_li10170826153511">The DN monitoring information is updated every 5 seconds. CNs collect monitoring information from DNs every 5 seconds. Because each instance updates or collects user monitoring information independently, the monitoring information update time on each instance may be different.</li><li id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_li71871981907">The auxiliary thread automatically invokes the persistence function every 30 seconds to persist user monitoring data. In normal cases, you do not need to do this.</li><li id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_li1296683363317">When there are a large number of users and a large cluster, querying such real-time views will cause network latency due to the real-time communication overhead between CNs and DNs.</li><li id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_li2808737133318">Resources are not monitored for an initial administrator.</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_en-us_topic_0000001510283549_s94c9533698194ccdad198448439a9aa4"><h4 class="sectiontitle">Procedure</h4><ul id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_en-us_topic_0000001510283549_ul11778104193915"><li id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_en-us_topic_0000001510283549_li1177811433911">Query all users' resource quotas and real-time resource usage.<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_en-us_topic_0000001510283549_sd8c93121e8bc4d41bc15666d44477a5f"><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="k">SELECT</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">PG_TOTAL_USER_RESOURCE_INFO</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_en-us_topic_0000001510283549_a22a51664352e4867951ae2fb0e745c21">The result view is as follows:</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_en-us_topic_0000001510283549_screen1669016192413">username | used_memory | total_memory | used_cpu | total_cpu | used_space | total_space | used_temp_space | total_temp_space | used_spill_space | total_spill_space | read_kbytes | write_kbytes | read_counts | write_counts | read_speed | write_speed | send_speed | recv_speed
|
|
-----------------------+-------------+--------------+----------+-----------+------------+-------------+-----------------+------------------+------------------+-------------------+-------------+--------------+-------------+--------------+------------+-------------+------------+------------
|
|
perfadm | 0 | 0 | 0 | 0 | 0 | -1 | 0 | -1 | 0 | -1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
|
|
usern | 0 | 17250 | 0 | 48 | 0 | -1 | 0 | -1 | 0 | -1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
|
|
(2 rows)</pre>
|
|
<p id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_en-us_topic_0000001510283549_p2214132131818">The I/O resource monitoring fields (<strong id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_b182411168031543">read_kbytes</strong>, <strong id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_b55137523631543">write_kbytes</strong>, <strong id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_b189864881031543">read_counts</strong>, <strong id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_b45669023631543">write_counts</strong>, <strong id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_b98582083931543">read_speed</strong>, and <strong id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_b188490369031543">write_speed</strong>) can be available only when the GUC parameter described in <a href="dws_04_0922.html#EN-US_TOPIC_0000001811490709__section827402723813">enable_user_metric_persistent</a> is enabled.</p>
|
|
<p id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_en-us_topic_0000001510283549_a1b0b7782d4b24c18834dc68ed177bf2e">For details about each column, see <a href="dws_04_0790.html">PG_TOTAL_USER_RESOURCE_INFO</a>.</p>
|
|
</li></ul>
|
|
<ul id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_en-us_topic_0000001510283549_ul440710812393"><li id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_en-us_topic_0000001510283549_li134070833918">Query a user's resource quota and real-time resource usage.<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_en-us_topic_0000001510283549_s585ab541b93a48fcb72f4139c2ca5ed3"><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="k">SELECT</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">GS_WLM_USER_RESOURCE_INFO</span><span class="p">(</span><span class="s1">'username'</span><span class="p">);</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_en-us_topic_0000001510283549_p17368833105817">The query result is as follows:</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_en-us_topic_0000001510283549_screen16553102284">userid | used_memory | total_memory | used_cpu | total_cpu | used_space | total_space | used_temp_space | total_temp_space | used_spill_space | total_spill_space | read_kbytes | write_kbytes | read_counts | write_counts | read_speed | write_speed | send_speed | recv_speed
|
|
--------+-------------+--------------+----------+-----------+------------+-------------+-----------------+------------------+------------------+-------------------+-------------+--------------+-------------+--------------+------------+-------------+------------+------------
|
|
16407 | 18 | 1655 | 6 | 19 | 13787176 | -1 | 0 | -1 | 0 | -1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
|
|
(1 row)</pre>
|
|
</li></ul>
|
|
<ul id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_en-us_topic_0000001510283549_ul10174171303915"><li id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_en-us_topic_0000001510283549_li13369339153613">Query all users' resource quotas and historical resource usage.<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_en-us_topic_0000001510283549_screen15593124715419"><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="k">SELECT</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">GS_WLM_USER_RESOURCE_HISTORY</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_en-us_topic_0000001510283549_p1832531563713">The query result is as follows:</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_en-us_topic_0000001510283549_screen1986417472284">username | timestamp | used_memory | total_memory | used_cpu | total_cpu | used_space | total_space | used_temp_space | total_temp_space | used_spill_space | total_spill_space | read_kbytes | write_kbytes | read_counts | write_counts | read_speed | write_speed | send_speed | recv_speed
|
|
-----------------------+-------------------------------+-------------+--------------+----------+-----------+------------+-------------+-----------------+------------------+------------------+-------------------+-------------+--------------+-------------+--------------+-------------+-------------+------------+------------
|
|
usern | 2020-01-08 22:56:06.456855+08 | 0 | 17250 | 0 | 48 | 0 | -1 | 0 | -1 | 88349078 | -1 | 45680 | 34 | 5710 | 8 | 320 | 0 | 0 | 0
|
|
userg | 2020-01-08 22:56:06.458659+08 | 0 | 15525 | 33.48 | 48 | 0 | -1 | 0 | -1 | 110169581 | -1 | 17648 | 23 | 2206 | 5 | 123 | 0 | 0 | 0
|
|
userg1 | 2020-01-08 22:56:06.460252+08 | 0 | 13972 | 33.48 | 48 | 0 | -1 | 0 | -1 | 136106277 | -1 | 17648 | 23 | 2206 | 5 | 123 | 0 | 0 | 0</pre>
|
|
<p id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_en-us_topic_0000001510283549_p873752710298">For the system catalog <a href="dws_04_0567.html">GS_WLM_USER_RESOURCE_HISTORY</a>, data in the <a href="dws_04_0790.html">PG_TOTAL_USER_RESOURCE_INFO</a> view is periodically saved to historical tables only when the GUC parameter <a href="dws_04_0922.html#EN-US_TOPIC_0000001811490709__section827402723813">enable_user_metric_persistent</a> is enabled.</p>
|
|
<p id="EN-US_TOPIC_0000001811490701__en-us_topic_0000001764650844_en-us_topic_0000001510283549_p051610447443">For details about each column, see <a href="dws_04_0567.html">GS_WLM_USER_RESOURCE_HISTORY</a>.</p>
|
|
</li></ul>
|
|
</div>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_04_0393.html">GaussDB(DWS) Resource Monitoring</a></div>
|
|
</div>
|
|
</div>
|
|
|