{"id":15723,"date":"2024-02-07T18:36:34","date_gmt":"2024-02-08T02:36:34","guid":{"rendered":"https:\/\/www.pingcap.com\/?p=15723"},"modified":"2024-03-18T07:01:13","modified_gmt":"2024-03-18T14:01:13","slug":"enhancing-database-stability-tidb-runaway-query-management","status":"publish","type":"post","link":"https:\/\/www.pingcap.com\/ko\/blog\/enhancing-database-stability-tidb-runaway-query-management\/","title":{"rendered":"Enhancing Database Stability in TiDB with Runaway Query Management"},"content":{"rendered":"<p>Maintaining database stability is paramount for any business, as unexpected dips in performance for critical systems can cause substantial losses. By streamlining change testing processes or employing new technologies, you can limit unforeseen incidents within a certain range. However, sudden SQL performance issues, such as drastic data volume changes, increasingly complicated queries, and partially validated SQLs, may still take you by surprise occasionally.<\/p>\n\n\n\n<p>These incidents can have severe consequences for latency-sensitive applications that are hard to mitigate. As a solution, <a href=\"https:\/\/www.pingcap.com\/ko\/tidb\/\">\ud2f0DB<\/a> 7.2 introduced <a href=\"https:\/\/docs-archive.pingcap.com\/tidb\/v7.2\/tidb-resource-control#manage-queries-that-consume-more-resources-than-expected-runaway-queries\">runaway query management<\/a> to manage unexpected queries and address these issues systematically.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_are_Runaway_Queries\"><\/span>What are Runaway Queries?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Runaway queries are queries that exceed expected execution times or resource usage. Runaway query management provides an efficient, controllable, and automated resource management mechanism. By mitigating the adverse effects of unexpected SQL performance issues it enhances TiDB&#8217;s <a href=\"https:\/\/www.pingcap.com\/ko\/blog\/why-distributed-sql-databases-elevate-modern-app-dev\/\">stability<\/a> in complex workload scenarios.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_are_the_Use_Cases_of_Runaway_Query_Management\"><\/span>What are the Use Cases of Runaway Query Management?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Runaway query management is useful in situations where:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>It&#8217;s essential for automatically identifying and addressing abnormal SQL performance issues to preserve the service quality of crucial systems<\/li>\n\n\n\n<li>Sudden SQL performance issues may occur with no immediate and effective fixes available<\/li>\n\n\n\n<li>It&#8217;s necessary to blacklist or rate-limit specific SQLs known to have security or performance concerns<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_Does_Runaway_Query_Management_Work\"><\/span>How Does Runaway Query Management Work?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Runaway query management\u2019s magic lies in two essential capabilities: identifying and handling queries.&nbsp;&nbsp;&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Identifying Runaway Queries<\/h3>\n\n\n\n<p>TiDB&#8217;s <a href=\"https:\/\/www.pingcap.com\/ko\/blog\/tidb-resource-control-workload-consolidation-transactional-apps\/\">resource control<\/a> module provides two identification methods: Dynamic Identification and Static Identification.&nbsp;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Dynamic Identification<\/h4>\n\n\n\n<p>Dynamic Identification identifies runaway queries automatically based on real-time performance metrics defined in resource groups. Currently, this method uses the <code>EXEC_ELAPSED <\/code>setting to determine the actual execution time of the SQL commands. If a query takes longer than the limit specified by <code>EXEC_ELAPSED<\/code>, it is identified as a runaway query.&nbsp;&nbsp;<\/p>\n\n\n\n<p>In the following SQL command, any query in the \u201cdefault&#8221; resource group that takes over 5 seconds to execute will be marked as a runaway query.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\nALTER RESOURCE GROUP default \nQUERY_LIMIT=(EXEC_ELAPSED='5s', ACTION=KILL);\n<\/code><\/pre>\n\n\n\n<p>Once there is an identified runaway query, you can configure WATCH rules in the resource group to watch for SQL traits of the identified query within a specified time frame. This approach allows for direct recognition of runaway queries based on SQL traits, eliminating the wait for rule-based identification.<\/p>\n\n\n\n<p>In the following example, we added a WATCH rule to monitor queries with similar traits to the identified runaway query within a ten-minute time frame. Therefore, in the next ten minutes, the system will identify runaway queries directly without executing the five-second rule. After the specified duration, if the query performance becomes normal, the watch rule expires.&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\nALTER RESOURCE GROUP default \nQUERY_LIMIT=(EXEC_ELAPSED='5s', ACTION=KILL, WATCH=SIMILAR DURATION='10m');<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Static Identification<\/h4>\n\n\n\n<p>Automated rules cannot flag all problematic queries precisely, so we introduced a manual approach &#8211; Static Identification<strong> <\/strong>&#8211; that recognizes queries by distinct SQL traits. Administrators can use the <code>QUERY WATCH<\/code> command to define rules for identifying and handling specific SQL traits. This essentially creates a blacklist for database queries. The static identification methods include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>SQL Text<\/strong>: This involves exact matches based on the SQL text itself.<\/li>\n\n\n\n<li><strong>SQL Digest<\/strong>: This method matches queries with the same SQL digest, identifying queries with similar structures but minor differences. For example, <code>select c from t1<\/code> where a=1 and <code>select c from t1 <\/code>where a=2 have the same digest values.&nbsp;<\/li>\n\n\n\n<li><strong>Plan Digest<\/strong>: This method matches queries that share identical execution plans, targeting specific plans that are often behind performance issues.<\/li>\n<\/ul>\n\n\n\n<p>You can collect SQL traits through slow queries. For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\nSELECT count(1)\nFROM  sbtest.sbtest1 AS S\n,sbtest.sbtest2 AS S2        \n,sbtest.sbtest3 AS S3  WHERE S1.c=S2.c AND S1.c=S3.c;\n# Time: 2023-09-19T17:16:56.640436+08:00\n...\n# Digest: d3c7846bb8f6b817ae395db30eadedec57af08f7983466f68db93d9ce1ac5872\n...\n# Plan_digest: 41fee801f07e06aa4aba4c0142ce4c624e8dc932c9e14d49854b8ce57366b443\n<\/code><\/pre>\n\n\n\n<p>You can select one of the recognition methods based on your experience. The following example below uses the <code>SQL DIGEST<\/code> clause to add similar queries to the monitoring queue.&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\nmysql&gt; QUERY WATCH ADD ACTION KILL SQL DIGEST 'd3c7846bb8f6b817ae395db30eadedec57af08f7983466f68db93d9ce1ac5872';\nQuery OK, 0 rows affected (0.01 sec)\n\nmysql&gt; SELECT * FROM INFORMATION_SCHEMA.RUNAWAY_WATCHES ORDER BY id\\G\n*************************** 1. row ***************************\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ID: 54\nRESOURCE_GROUP_NAME: default\n&nbsp; &nbsp; &nbsp; &nbsp; START_TIME: 2023-09-20 01:59:14\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; END_TIME: UNLIMITED\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WATCH: Similar\n&nbsp; &nbsp; &nbsp; &nbsp; WATCH_TEXT: d3c7846bb8f6b817ae395db30eadedec57af08f7983466f68db93d9ce1ac5872\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SOURCE: manual\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ACTION: Kill\n1 row in set (0.04 sec)<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Handling Runaway Queries&nbsp;<\/h3>\n\n\n\n<p>Handling refers to the methods to manage identified runaway queries. The supported methods include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>DRYRUN<\/strong>: Identifies issues without any action and displays the findings in logs and views. It&#8217;s useful for initial testing to detect false positives.<\/li>\n\n\n\n<li><strong>COOLDOWN<\/strong>: Reduces the priority of the identified query within the resource group, slowing its processing.<\/li>\n\n\n\n<li><strong>KILL<\/strong>: Terminates the identified query to protect database performance.<\/li>\n<\/ul>\n\n\n\n<p>In TiDB 7.5, <strong>COOLDOWN<\/strong> in complex situations is limited. We recommend using <strong>KILL<\/strong> to maintain high service quality.<\/p>\n\n\n\n<p>In the following sample scenario, runaway queries are automatically terminated upon detection.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\nALTER RESOURCE GROUP default QUERY_LIMIT=(EXEC_ELAPSED='5s', ACTION=KILL, WATCH=SIMILAR DURATION='10m');<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Logging and Observability<\/h3>\n\n\n\n<p>TiDB provides a series of system tables to log and access all previously mentioned settings and historical data related to the identification and management of issues:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>INFORMATION_SCHEMA.RESOURCE_GROUPS<\/strong>: This table outlines the definitions of resource groups, including the rules for runaway query identification and their corresponding handling settings.<\/li>\n\n\n\n<li>INFORMATION_SCHEMA.RUNAWAY_WATCHES: This table lists the rules established in the monitoring queue.<\/li>\n\n\n\n<li><strong>MYSQL.TIDB_RUNAWAY_QUERIES<\/strong>: This table maintains a log of the historical instances of runaway queries detected and addressed.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Runaway_Query_Management_in_Action\"><\/span>Runaway Query Management in Action<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Let\u2019s look at how Runaway Query Management works in the following simulated scenarios:&nbsp;&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>Phase<\/td><td>Workload<\/td><td>Resource Group Setting&nbsp;<\/td><td>QPS<\/td><td>P99<\/td><\/tr><tr><td>1<\/td><td>Normal<\/td><td>N\/A<\/td><td>11K<\/td><td>50ms<\/td><\/tr><tr><td>2<\/td><td>Normal + Continuous highly-consuming query<\/td><td>N\/A<\/td><td>3K<\/td><td>200ms<\/td><\/tr><tr><td>3<\/td><td>Normal + Continuous highly-consuming query<\/td><td>QUERY_LIMIT=(EXEC_ELAPSED=&#8217;1s&#8217;, ACTION=KILL)<\/td><td>7.5K<\/td><td>70ms ~ 80ms<\/td><\/tr><tr><td>4<\/td><td>Normal + Continuous highly-consuming query<\/td><td>QUERY_LIMIT=(EXEC_ELAPSED=&#8217;1s&#8217;, ACTION=KILL, WATCH=EXACT DURATION=&#8217;5m&#8217;)<\/td><td>11K<\/td><td>50ms<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>&nbsp;Here is what happened through the phases:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1180\" height=\"1600\" src=\"https:\/\/static.pingcap.com\/files\/2024\/02\/07182951\/image-14.png\" alt=\"\" class=\"wp-image-15747\" srcset=\"https:\/\/static.pingcap.com\/files\/2024\/02\/07182951\/image-14.png 1180w, https:\/\/static.pingcap.com\/files\/2024\/02\/07182951\/image-14-221x300.png 221w, https:\/\/static.pingcap.com\/files\/2024\/02\/07182951\/image-14-755x1024.png 755w, https:\/\/static.pingcap.com\/files\/2024\/02\/07182951\/image-14-768x1041.png 768w, https:\/\/static.pingcap.com\/files\/2024\/02\/07182951\/image-14-1133x1536.png 1133w\" sizes=\"auto, (max-width: 1180px) 100vw, 1180px\" \/><\/figure>\n\n\n\n<ol class=\"wp-block-list\">\n<li>As the initial state, phase 1 started with a normal load scenario. The overall QPS is nearly 11k, with a P999 latency of approximately 50ms.&nbsp;<\/li>\n\n\n\n<li>As we submitted an anomalous query in phase 2 once every second for 3 to 8 seconds, there was a drastic QPS reduction from 11k to around 3k and an increase in P999 latency from 60ms to 200ms.<\/li>\n\n\n\n<li>To address this issue, we implemented a runaway query identification rule in the default resource group to terminate queries exceeding a 1-second execution time. This adjustment improves the QPS to 7.5k, and the P999 latency decreases.\n<pre class=\"wp-block-code\"><code>\nmysql&gt; alter resource group default QUERY_LIMIT=(EXEC_ELAPSED='1s', ACTION=KILL);\n<\/code><\/pre><p>To observe the status, you can query the <code>MYSQL.TIDB_RUNAWAY_QUERIES<\/code> system table. As shown below, the runaway query management system started to involve actively and consistently identifying and handling problematic SQL queries.\n<\/p><pre class=\"wp-block-code\"><code>\nmysql&gt; select * from mysql.tidb_runaway_queries limit 1 \\G\n*************************** 1. row ***********************\nresource_group_name: default\n               time: 2023-09-19 15:18:10\n         match_type: identify\n             action: kill\n       original_sql: SELECT count(1)\n  FROM  sbtest.sbtest1 AS S1\n       ,sbtest.sbtest2 AS S2\n       ,sbtest.sbtest3 AS S3\n WHERE S1.c=S2.c\n    AND S1.c=S3.c\n        plan_digest: 41fee801f07e06aa4aba4c0142ce4c624e8dc932c9e14d49854b8ce57366b443\n        tidb_server: 127.0.0.1:4000\n\n\nmysql&gt; select count(*) from mysql.tidb_runaway_queries;\n+----------+\n| count(*) |\n+----------+\n|       56 |\n+----------+\n1 row in set (0.02 sec)<\/code><\/pre><p>However, the QPS hadn\u2019t recovered to its original state because, even though the queries lasting over one second were terminated, they still occupied the system for that duration.<\/p><\/li>\n\n\n\n<li>In phase 4, we added the Watch rule in the resource group to include the texts of queries that match the runaway criteria in the monitoring list for five minutes. Consequently, queries matching the runaway criteria are instantly terminated, eliminating the one-second wait. TiDB will reassess the query performance after 5 minutes and remove restrictions If the performance is restored. At this time, the system&#8217;s QPS and P999 will revert to their initial stage levels.<pre class=\"wp-block-code\"><code> mysql&gt; alter resource group default QUERY_LIMIT=(EXEC_ELAPSED='1s', ACTION=KILL, WATCH=EXACT DURATION='5m'); <\/code><\/pre><p>We can get the WATCH rule by querying the <code>INFORMATION_SCHEMA.RUNAWAY_WATCHES<\/code> table:<\/p> <pre class=\"wp-block-code\"><code>\nmysql&gt; SELECT * FROM INFORMATION_SCHEMA.RUNAWAY_WATCHES ORDER BY id\\G\n***************** 1. row ****************\n                 ID: 50\nRESOURCE_GROUP_NAME: default\n         START_TIME: 2023-09-19 16:58:20\n           END_TIME: 2023-09-19 17:03:20\n              WATCH: Exact\n         WATCH_TEXT: SELECT count(1)\n  FROM  sbtest.sbtest1 AS S1\n       ,sbtest.sbtest2 AS S2\n       ,sbtest.sbtest3 AS S3\n WHERE S1.c=S2.c\n    AND S1.c=S3.c\n             SOURCE: 127.0.0.1:4000\n             ACTION: Kill\n1 row in set (0.01 sec)\n<\/code><\/pre><\/li>\n<\/ol>\n\n\n\n<p>So far, you should have a basic understanding of how runaway query nanagement limits resource consumption of individual SQL queries and mitigates their impact on the overall performance.<\/p>\n\n\n\n<p><strong>NOTE<\/strong>: In the given demos above, we can address performance issues by identifying problematic queries using &#8220;slow logs&#8221; or system tables even if resource groups don&#8217;t automatically detect queries. These queries can then be manually added to a monitoring list with <code>QUERY WATCH<\/code>, effectively creating a blacklist.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>A key benefit of TiDB&#8217;s runaway query management lies in improved user experience.&nbsp;<\/p>\n\n\n\n<p>Users can effortlessly monitor and manage runaway queries within the database through automated and manual approaches, thus minimizing their interference with regular business operations.<\/p>\n\n\n\n<p>Moving forward, we will continue to iterate this feature with more sophisticated identification rules, diverse processing strategies, and enhanced observability. In addition, we plan to introduce graphical management to elevate the user experience further, advancing TiDB as a top-tier enterprise database platform.&nbsp;<\/p>\n\n\n\n<p>You can try runaway query management by <a href=\"https:\/\/www.pingcap.com\/ko\/download\/\">downloading our latest production-ready release, TiDB 7.5<\/a>. And don\u2019t forget to join the <a href=\"https:\/\/slack.tidb.io\/invite?team=tidb-community&amp;channel=everyone\">TiDB Slack Community<\/a> for interactions with other TiDB practitioners, as well as real-time discussions with our engineering teams.<\/p>","protected":false},"excerpt":{"rendered":"<p>Maintaining database stability is paramount for any business, as unexpected dips in performance for critical systems can cause substantial losses. By streamlining change testing processes or employing new technologies, you can limit unforeseen incidents within a certain range. However, sudden SQL performance issues, such as drastic data volume changes, increasingly complicated queries, and partially validated [&hellip;]<\/p>\n","protected":false},"author":261,"featured_media":15725,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ub_ctt_via":"","footnotes":""},"categories":[13],"tags":[245,192,261],"class_list":["post-15723","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-product","tag-query-performance","tag-reliability","tag-stability"],"acf":[],"featured_image_src":"https:\/\/static.pingcap.com\/files\/2024\/02\/07011432\/runaway-query-mgmt_banner.jpeg","author_info":{"display_name":"Roger Song","author_link":"https:\/\/www.pingcap.com\/ko\/blog\/author\/roger-song\/"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Runaway Query Management: Enhancing Stability in TiDB<\/title>\n<meta name=\"description\" content=\"Discover how runaway query management in TiDB can handle problematic queries and enhance overall database stability.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pingcap.com\/ko\/blog\/enhancing-database-stability-tidb-runaway-query-management\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Runaway Query Management: Enhancing Stability in TiDB\" \/>\n<meta property=\"og:description\" content=\"Discover how runaway query management in TiDB can handle problematic queries and enhance overall database stability.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pingcap.com\/ko\/blog\/enhancing-database-stability-tidb-runaway-query-management\/\" \/>\n<meta property=\"og:site_name\" content=\"TiDB\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/pingcap2015\" \/>\n<meta property=\"article:published_time\" content=\"2024-02-08T02:36:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-18T14:01:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/static.pingcap.com\/files\/2024\/02\/07012328\/runaway-query-mgmt_social.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"1875\" \/>\n\t<meta property=\"og:image:height\" content=\"937\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Roger Song\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/static.pingcap.com\/files\/2024\/02\/07012328\/runaway-query-mgmt_social.jpeg\" \/>\n<meta name=\"twitter:creator\" content=\"@PingCAP\" \/>\n<meta name=\"twitter:site\" content=\"@PingCAP\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Roger Song\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.pingcap.com\/blog\/enhancing-database-stability-tidb-runaway-query-management\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/enhancing-database-stability-tidb-runaway-query-management\/\"},\"author\":{\"name\":\"Roger Song\",\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/person\/2c15dfa5c1001589a8eee81137017ee4\"},\"headline\":\"Enhancing Database Stability in TiDB with Runaway Query Management\",\"datePublished\":\"2024-02-08T02:36:34+00:00\",\"dateModified\":\"2024-03-18T14:01:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/enhancing-database-stability-tidb-runaway-query-management\/\"},\"wordCount\":1295,\"publisher\":{\"@id\":\"https:\/\/www.pingcap.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/enhancing-database-stability-tidb-runaway-query-management\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/static.pingcap.com\/files\/2024\/02\/07011432\/runaway-query-mgmt_banner.jpeg\",\"keywords\":[\"Query Performance\",\"Reliability\",\"Stability\"],\"articleSection\":[\"Product\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.pingcap.com\/blog\/enhancing-database-stability-tidb-runaway-query-management\/\",\"url\":\"https:\/\/www.pingcap.com\/blog\/enhancing-database-stability-tidb-runaway-query-management\/\",\"name\":\"Runaway Query Management: Enhancing Stability in TiDB\",\"isPartOf\":{\"@id\":\"https:\/\/www.pingcap.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/enhancing-database-stability-tidb-runaway-query-management\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/enhancing-database-stability-tidb-runaway-query-management\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/static.pingcap.com\/files\/2024\/02\/07011432\/runaway-query-mgmt_banner.jpeg\",\"datePublished\":\"2024-02-08T02:36:34+00:00\",\"dateModified\":\"2024-03-18T14:01:13+00:00\",\"description\":\"Discover how runaway query management in TiDB can handle problematic queries and enhance overall database stability.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/enhancing-database-stability-tidb-runaway-query-management\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.pingcap.com\/blog\/enhancing-database-stability-tidb-runaway-query-management\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.pingcap.com\/blog\/enhancing-database-stability-tidb-runaway-query-management\/#primaryimage\",\"url\":\"https:\/\/static.pingcap.com\/files\/2024\/02\/07011432\/runaway-query-mgmt_banner.jpeg\",\"contentUrl\":\"https:\/\/static.pingcap.com\/files\/2024\/02\/07011432\/runaway-query-mgmt_banner.jpeg\",\"width\":1875,\"height\":625},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.pingcap.com\/blog\/enhancing-database-stability-tidb-runaway-query-management\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.pingcap.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Enhancing Database Stability in TiDB with Runaway Query Management\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.pingcap.com\/#website\",\"url\":\"https:\/\/www.pingcap.com\/\",\"name\":\"TiDB\",\"description\":\"TiDB | SQL at Scale\",\"publisher\":{\"@id\":\"https:\/\/www.pingcap.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.pingcap.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.pingcap.com\/#organization\",\"name\":\"PingCAP\",\"url\":\"https:\/\/www.pingcap.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/static.pingcap.com\/files\/2021\/11\/pingcap-logo.png\",\"contentUrl\":\"https:\/\/static.pingcap.com\/files\/2021\/11\/pingcap-logo.png\",\"width\":811,\"height\":232,\"caption\":\"PingCAP\"},\"image\":{\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/facebook.com\/pingcap2015\",\"https:\/\/x.com\/PingCAP\",\"https:\/\/linkedin.com\/company\/pingcap\",\"https:\/\/youtube.com\/channel\/UCuq4puT32DzHKT5rU1IZpIA\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/person\/2c15dfa5c1001589a8eee81137017ee4\",\"name\":\"Roger Song\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/static.pingcap.com\/files\/2024\/02\/07174739\/roger-song-150x150.jpeg\",\"contentUrl\":\"https:\/\/static.pingcap.com\/files\/2024\/02\/07174739\/roger-song-150x150.jpeg\",\"caption\":\"Roger Song\"},\"description\":\"TiDB Product Manager\",\"url\":\"https:\/\/www.pingcap.com\/ko\/blog\/author\/roger-song\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Runaway Query Management: Enhancing Stability in TiDB","description":"Discover how runaway query management in TiDB can handle problematic queries and enhance overall database stability.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.pingcap.com\/ko\/blog\/enhancing-database-stability-tidb-runaway-query-management\/","og_locale":"ko_KR","og_type":"article","og_title":"Runaway Query Management: Enhancing Stability in TiDB","og_description":"Discover how runaway query management in TiDB can handle problematic queries and enhance overall database stability.","og_url":"https:\/\/www.pingcap.com\/ko\/blog\/enhancing-database-stability-tidb-runaway-query-management\/","og_site_name":"TiDB","article_publisher":"https:\/\/facebook.com\/pingcap2015","article_published_time":"2024-02-08T02:36:34+00:00","article_modified_time":"2024-03-18T14:01:13+00:00","og_image":[{"width":1875,"height":937,"url":"https:\/\/static.pingcap.com\/files\/2024\/02\/07012328\/runaway-query-mgmt_social.jpeg","type":"image\/jpeg"}],"author":"Roger Song","twitter_card":"summary_large_image","twitter_image":"https:\/\/static.pingcap.com\/files\/2024\/02\/07012328\/runaway-query-mgmt_social.jpeg","twitter_creator":"@PingCAP","twitter_site":"@PingCAP","twitter_misc":{"Written by":"Roger Song","Est. reading time":"9\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pingcap.com\/blog\/enhancing-database-stability-tidb-runaway-query-management\/#article","isPartOf":{"@id":"https:\/\/www.pingcap.com\/blog\/enhancing-database-stability-tidb-runaway-query-management\/"},"author":{"name":"Roger Song","@id":"https:\/\/www.pingcap.com\/#\/schema\/person\/2c15dfa5c1001589a8eee81137017ee4"},"headline":"Enhancing Database Stability in TiDB with Runaway Query Management","datePublished":"2024-02-08T02:36:34+00:00","dateModified":"2024-03-18T14:01:13+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pingcap.com\/blog\/enhancing-database-stability-tidb-runaway-query-management\/"},"wordCount":1295,"publisher":{"@id":"https:\/\/www.pingcap.com\/#organization"},"image":{"@id":"https:\/\/www.pingcap.com\/blog\/enhancing-database-stability-tidb-runaway-query-management\/#primaryimage"},"thumbnailUrl":"https:\/\/static.pingcap.com\/files\/2024\/02\/07011432\/runaway-query-mgmt_banner.jpeg","keywords":["Query Performance","Reliability","Stability"],"articleSection":["Product"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/www.pingcap.com\/blog\/enhancing-database-stability-tidb-runaway-query-management\/","url":"https:\/\/www.pingcap.com\/blog\/enhancing-database-stability-tidb-runaway-query-management\/","name":"Runaway Query Management: Enhancing Stability in TiDB","isPartOf":{"@id":"https:\/\/www.pingcap.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pingcap.com\/blog\/enhancing-database-stability-tidb-runaway-query-management\/#primaryimage"},"image":{"@id":"https:\/\/www.pingcap.com\/blog\/enhancing-database-stability-tidb-runaway-query-management\/#primaryimage"},"thumbnailUrl":"https:\/\/static.pingcap.com\/files\/2024\/02\/07011432\/runaway-query-mgmt_banner.jpeg","datePublished":"2024-02-08T02:36:34+00:00","dateModified":"2024-03-18T14:01:13+00:00","description":"Discover how runaway query management in TiDB can handle problematic queries and enhance overall database stability.","breadcrumb":{"@id":"https:\/\/www.pingcap.com\/blog\/enhancing-database-stability-tidb-runaway-query-management\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pingcap.com\/blog\/enhancing-database-stability-tidb-runaway-query-management\/"]}]},{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.pingcap.com\/blog\/enhancing-database-stability-tidb-runaway-query-management\/#primaryimage","url":"https:\/\/static.pingcap.com\/files\/2024\/02\/07011432\/runaway-query-mgmt_banner.jpeg","contentUrl":"https:\/\/static.pingcap.com\/files\/2024\/02\/07011432\/runaway-query-mgmt_banner.jpeg","width":1875,"height":625},{"@type":"BreadcrumbList","@id":"https:\/\/www.pingcap.com\/blog\/enhancing-database-stability-tidb-runaway-query-management\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pingcap.com\/"},{"@type":"ListItem","position":2,"name":"Enhancing Database Stability in TiDB with Runaway Query Management"}]},{"@type":"WebSite","@id":"https:\/\/www.pingcap.com\/#website","url":"https:\/\/www.pingcap.com\/","name":"\ud2f0DB","description":"TiDB | SQL at Scale","publisher":{"@id":"https:\/\/www.pingcap.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pingcap.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/www.pingcap.com\/#organization","name":"PingCAP","url":"https:\/\/www.pingcap.com\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.pingcap.com\/#\/schema\/logo\/image\/","url":"https:\/\/static.pingcap.com\/files\/2021\/11\/pingcap-logo.png","contentUrl":"https:\/\/static.pingcap.com\/files\/2021\/11\/pingcap-logo.png","width":811,"height":232,"caption":"PingCAP"},"image":{"@id":"https:\/\/www.pingcap.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/facebook.com\/pingcap2015","https:\/\/x.com\/PingCAP","https:\/\/linkedin.com\/company\/pingcap","https:\/\/youtube.com\/channel\/UCuq4puT32DzHKT5rU1IZpIA"]},{"@type":"Person","@id":"https:\/\/www.pingcap.com\/#\/schema\/person\/2c15dfa5c1001589a8eee81137017ee4","name":"Roger Song","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.pingcap.com\/#\/schema\/person\/image\/","url":"https:\/\/static.pingcap.com\/files\/2024\/02\/07174739\/roger-song-150x150.jpeg","contentUrl":"https:\/\/static.pingcap.com\/files\/2024\/02\/07174739\/roger-song-150x150.jpeg","caption":"Roger Song"},"description":"TiDB Product Manager","url":"https:\/\/www.pingcap.com\/ko\/blog\/author\/roger-song\/"}]}},"grav_blocks":false,"card_markup":"<a class=\"card-resource bg-white\" href=\"https:\/\/www.pingcap.com\/ko\/blog\/enhancing-database-stability-tidb-runaway-query-management\/\"><div class=\"card-resource__image-container\"><img class=\"card-resource__image\" alt=\"runaway query mgmt_banner\" src=\"https:\/\/static.pingcap.com\/files\/2024\/02\/07011432\/runaway-query-mgmt_banner.jpeg\" loading=\"lazy\" width=1875 height=625 \/><\/div><div class=\"card-resource__content-container\"><div class=\"card-resource__content-head\"><div class=\"card-resource__category\">Product<\/div><\/div><h5 class=\"card-resource__title\">Enhancing Database Stability in TiDB with Runaway Query Management<\/h5><\/div><\/a>","_links":{"self":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/posts\/15723","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/users\/261"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/comments?post=15723"}],"version-history":[{"count":19,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/posts\/15723\/revisions"}],"predecessor-version":[{"id":16056,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/posts\/15723\/revisions\/16056"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/media\/15725"}],"wp:attachment":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/media?parent=15723"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/categories?post=15723"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/tags?post=15723"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}