morningman commented on code in PR #639: URL: https://github.com/apache/doris-website/pull/639#discussion_r1597540457
########## i18n/zh-CN/docusaurus-plugin-content-docs/current/admin-manual/resource-admin/workload-system-table.md: ########## @@ -0,0 +1,230 @@ +--- +{ + "title": "Workload System Table", Review Comment: 用中文标题 ########## i18n/zh-CN/docusaurus-plugin-content-docs/current/admin-manual/resource-admin/workload-system-table.md: ########## @@ -0,0 +1,230 @@ +--- +{ + "title": "Workload System Table", + "language": "zh-CN" +} +--- + +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +## 背景 +Doris支持通过Workload系统表对运行中的工作负载的资源使用情况进行分析,常用于以下场景: + +1. 查看集群中Workload Group的资源用量,包括CPU和内存。 +2. 查看目前集群中目前资源用量最大的N个sql。 +3. 查看集群中Workload Group的排队情况 + +用户可以通过提交sql的方式查询这些信息,找出目前系统中资源占用比较高的Workload Group或者sql,并进行相应的处理。 + +## Workload系统表介绍 +目前系统表主要在```information_schema```库里。 +### active_queries +```active_queries```表记录了当前在FE上查询的执行信息,字段的详细信息如下: +* query_id,查询的id +* query_start_time,查询开始执行的时间;如果查询有排队的话,那么就代表排队结束之后开始执行的时间 +* query_time_ms,查询的耗时,单位是毫秒 +* workload_group_id,查询使用的workload group的id +* database,查询中的sql使用的database +* frontend_instance,查询所在FE的节点名称 +* queue_start_time,如果查询到来时进入了排队了逻辑,那么代表查询排队开始的时间点 +* queue_end_time,如果查询到来时进入了排队的逻辑,那么代表查询排队结束的时间点 +* query_status,查询目前的状态,目前主要有两个取值RUNNING和QUEUED,RUNNIG代表查询处于运行状态;QUEUED代表当前查询正在排队 +* sql,查询的sql文本 + +### backend_active_tasks +一个查询通常会被分成多个fragment在多个BE上执行,```backend_active_tasks```就代表了一个查询在单个BE上使用的CPU和内存资源的总量。如果这个查询在单BE上有多个并发和多个fragment,那么也会汇总成一行数据。 +字段详细信息如下: +* be_id,be的id +* fe_host,代表了这个查询是从哪个FE提交的 +* query_id,查询的id +* task_time_ms,查询在当前be上的执行时间,单位是毫秒 +* task_cpu_time_ms,查询在be上执行时的cpu时间,单位是毫秒 +* scan_rows,查询在当前be上扫描的行数,如果扫描了多个表,那么就是多个表的累加值 +* scan_bytes,查询在当前be上扫描的字节数,如果扫描了多个表,那么就是多个表的累加值 +* be_peak_memory_bytes,查询在当前be上使用的内存的峰值,单位是字节 +* current_used_memory_bytes,查询在当前be上使用中的内存量,单位是字节 +* shuffle_send_bytes,查询在当前节点作为shuffle客户端发送的字节数 +* shuffle_send_rows,查询在当前节点作为shuffle客户端发送的行数 + +## 基本用法 +1. 查看资源用量topN的sql +``` +select Review Comment: 序号标题后面的内容要缩进一级 下同 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@doris.apache.org For additional commands, e-mail: dev-h...@doris.apache.org