doc-exports/docs/dcs/umn/dcs-faq-0606002.html
Chen, Junjie ea05d1a734 DCS UMN Initial Version
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Chen, Junjie <chenjunjie@huawei.com>
Co-committed-by: Chen, Junjie <chenjunjie@huawei.com>
2022-12-12 14:07:56 +00:00

36 lines
4.8 KiB
HTML

<a name="dcs-faq-0606002"></a><a name="dcs-faq-0606002"></a>
<h1 class="topictitle1">How Do I Detect Big Keys and Hot Keys in Advance?</h1>
<div id="body0000001379547102">
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dcs-faq-0606002__table180183710324" frame="border" border="1" rules="all"><thead align="left"><tr id="dcs-faq-0606002__row178021637143215"><th align="left" class="cellrowborder" valign="top" width="34.96%" id="mcps1.3.1.1.3.1.1"><p id="dcs-faq-0606002__p12579129338">Method</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="65.03999999999999%" id="mcps1.3.1.1.3.1.2"><p id="dcs-faq-0606002__p625751214333">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dcs-faq-0606002__row1980212370326"><td class="cellrowborder" valign="top" width="34.96%" headers="mcps1.3.1.1.3.1.1 "><p id="dcs-faq-0606002__p1980293733210">Through <strong id="dcs-faq-0606002__b79321032553939">Big Key Analysis</strong> and <strong id="dcs-faq-0606002__b103292901953939">Hot Key Analysis</strong> on the DCS console</p>
</td>
<td class="cellrowborder" valign="top" width="65.03999999999999%" headers="mcps1.3.1.1.3.1.2 "><p id="dcs-faq-0606002__p1582215495119">See <a href="dcs-ug-190808001.html">Cache Analysis</a>.</p>
</td>
</tr>
<tr id="dcs-faq-0606002__row38022037183218"><td class="cellrowborder" valign="top" width="34.96%" headers="mcps1.3.1.1.3.1.1 "><p id="dcs-faq-0606002__p12802137113218">By using the <strong id="dcs-faq-0606002__b1859015253209">bigkeys</strong> and <strong id="dcs-faq-0606002__b1659014257208">hotkeys</strong> options on redis-cli</p>
</td>
<td class="cellrowborder" valign="top" width="65.03999999999999%" headers="mcps1.3.1.1.3.1.2 "><ul id="dcs-faq-0606002__ul8127320134911"><li id="dcs-faq-0606002__li181277206497">redis-cli uses the <strong id="dcs-faq-0606002__b101075574853939">bigkeys</strong> option to traverse all keys in a Redis instance and returns the overall key statistics and the biggest key of six data types: Strings, Lists, Hashes, Sets, Zsets, and Streams. The command is <strong id="dcs-faq-0606002__b121893929053939">redis-cli -h </strong><em id="dcs-faq-0606002__i190866199153939">&lt;Instance connection address&gt;</em><strong id="dcs-faq-0606002__b211779146253939"> -p </strong><em id="dcs-faq-0606002__i89825748553939">&lt;Port number&gt;</em><strong id="dcs-faq-0606002__b110034694353939"> -a </strong><em id="dcs-faq-0606002__i77687502053939">&lt;Password&gt;</em><strong id="dcs-faq-0606002__b12862540553939"> --bigkeys</strong>.</li><li id="dcs-faq-0606002__li10127172084912">In Redis 4.0 and later, you can use the <strong id="dcs-faq-0606002__b116132887053939">hotkeys</strong> option to quickly find hot keys in redis-cli. Run this command during service running to find hot keys: <strong id="dcs-faq-0606002__b139556488653939">redis-cli -h </strong><em id="dcs-faq-0606002__i91175973053939">&lt;Instance connection address&gt;</em><strong id="dcs-faq-0606002__b14872896153939"> -p </strong><em id="dcs-faq-0606002__i113591880953939">&lt;Port number&gt;</em><strong id="dcs-faq-0606002__b170646013653939"> -a </strong><em id="dcs-faq-0606002__i29057584553939">&lt;Password&gt;</em><strong id="dcs-faq-0606002__b192171473053939"> --hotkeys</strong>. The hot key details can be obtained from the summary part in the returned result.</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
<p id="dcs-faq-0606002__p520894814584">Hot key analysis is not supported by DCS Redis 3.0 instances. You can <a href="dcs-ug-190905001.html#dcs-ug-190905001__en-us_topic_0190235954_section1118571110427">configure alarms</a> to detect hot keys.</p>
<ul id="dcs-faq-0606002__ul13208164815815"><li id="dcs-faq-0606002__li0208114825812">Configure alarm rules for the <strong id="dcs-faq-0606002__b122081048195811">Memory Usage</strong> metric of the instance nodes.<p id="dcs-faq-0606002__p6208194845818">If a node has a big key, the memory usage of the node is much higher than that of other nodes. In this case, an alarm is triggered to help you find the potentially problematic key.</p>
</li></ul>
<ul id="dcs-faq-0606002__ul19208124805818"><li id="dcs-faq-0606002__li220864855812">Configure alarm rules for the <strong id="dcs-faq-0606002__b42324711217">Maximum Inbound Bandwidth</strong>, <strong id="dcs-faq-0606002__b15242047182116">Maximum Outbound Bandwidth</strong>, and <strong id="dcs-faq-0606002__b42484716213">CPU Usage</strong> metrics of the instance nodes.<p id="dcs-faq-0606002__p1120884855810">If a node has a hot key, the bandwidth and CPU usage of the node is much higher than that of other nodes. In this case, an alarm is triggered to help you find the potentially problematic key.</p>
</li></ul>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dcs-faq-0805001.html">Analysis of Big Keys and Hot Keys</a></div>
</div>
</div>