Distributed task diagnosis method, device and storage medium

Through the distributed task diagnosis method, preset rules are used to process running status data and generate task processing information, which solves the problem of Flink task resource waste and automatic expansion, realizes intelligent diagnosis and resource optimization, and improves system stability and user experience.

CN113742117BActive Publication Date: 2024-09-20BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110018305.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-07
Publication Date
2024-09-20
Estimated Expiration
2041-01-07

AI Technical Summary

Technical Problem

In the process of distributed computing, the unreasonable parallelism settings of Flink tasks lead to a waste of resources, and the inability to automatically expand the capacity. The lack of a task health review mechanism makes problem location time-consuming and cannot accurately assess resource requirements, affecting system stability.

Method used

A distributed task diagnosis method is provided. By receiving the diagnosis start command, the running status data is obtained, the diagnosis result is generated according to the preset rule diagnosis processing, and the task processing information is generated for resource adjustment, realizing intelligent diagnosis and resource elastic expansion.

Benefits of technology

It realizes intelligent diagnosis of distributed tasks, optimizes resource utilization, automatically adjusts parallelism, ensures normal operation of tasks, reduces resource waste, and improves system stability and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113742117B
    Figure CN113742117B
Patent Text Reader

Abstract

This disclosure provides a distributed task diagnostic method, apparatus, and storage medium, relating to the field of computer technology. The method includes: receiving a distributed task diagnostic start command sent by a distributed task management device; acquiring the running status data of the distributed task corresponding to the distributed task diagnostic start command; performing diagnostic processing on the running status data according to preset task diagnostic rules to generate a distributed task diagnostic result; generating corresponding task processing information; and sending the task processing information to the distributed task management device so that the distributed task management device can perform corresponding operations based on the task processing information. The method, apparatus, and storage medium of this disclosure can provide intelligent diagnostic functions for distributed tasks, optimize distributed tasks based on diagnostic results, provide resource elastic scaling functions, ensure the normal operation of tasks and the effective utilization of resources, enable stable operation of distributed tasks, and improve user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a distributed task diagnosis method, device and storage medium. Background Art

[0002] In the distributed computing process, a job is usually decomposed into multiple distributed tasks, and multiple distributed tasks are assigned to multiple physical nodes for parallel computing. There can be many types of distributed tasks, such as Flink tasks. For distributed computing, multiple Flink tasks (subtasks) can be connected together to form a task, and each Flink task is executed by a thread. At present, there are problems such as unreasonable setting of Flink task parallelism, resulting in resource waste, and the inability to automatically expand the capacity when the task CPU and memory reach bottlenecks. Flink users can only check whether the status of the current task is normal, whether the task has fault recovery, and whether there is back pressure and abnormality through the Flink UI. Due to the lack of a task health review mechanism, the task status cannot be intelligently diagnosed, and it takes a long time to locate the problem and it is impossible to accurately locate the problem, so that users cannot accurately evaluate the resources required for their tasks, which may cause resource waste and affect the stability of system operation. Summary of the invention

[0003] In view of this, a technical problem to be solved by the present invention is to provide a distributed task diagnosis method, device and storage medium.

[0004] According to a first aspect of the present disclosure, a distributed task diagnosis method is provided, comprising: receiving a distributed task diagnosis start instruction sent by a distributed task management device, and obtaining operating status data of a distributed task corresponding to the distributed task diagnosis start instruction; performing diagnostic processing on the operating status data according to a preset task diagnosis rule to generate a distributed task diagnosis result; generating corresponding task processing information based on the distributed task diagnosis result, and sending the task processing information to the distributed task management device, so that the distributed task management device performs corresponding operations according to the task processing information.

[0005] Optionally, the information carried in the distributed task diagnostic start instruction includes: task ID, query address information, and operating indicator information; obtaining the operating status data of the distributed task corresponding to the distributed task diagnostic start instruction includes: obtaining the operating status data corresponding to the task ID according to the query address information; wherein the operating status data includes: task TOPO information, running time, restart information, task running information, and resource usage information.

[0006] Optionally, the diagnostic processing of the running status data according to the preset task diagnostic rules includes: judging whether the distributed task meets the preset running time condition based on the running time; judging whether the distributed task is in a restart situation based on the restart information; judging whether the distributed task is in a back pressure situation based on the task running information; judging whether the distributed task is in an over-resource allocation situation based on the task TOPO information and the resource usage information.

[0007] Optionally, judging whether the distributed task has a back pressure situation based on the task running information includes: obtaining a distributed back pressure task based on the task running information; wherein the waiting time of the distributed back pressure task for the task request exceeds a preset waiting time threshold; if the number of the distributed back pressure tasks is greater than a preset task number threshold, it is determined that a back pressure situation exists.

[0008] Optionally, after determining that a back pressure situation exists, the cause of the back pressure situation corresponding to the distributed back pressure task is determined based on the task TOPO information, the task running information and the resource usage information; wherein the cause of the back pressure situation includes: at least one of data skew, uneven distribution of task slots, slow instance running and insufficient resources.

[0009] Optionally, determining the cause of the back pressure situation corresponding to the distributed back pressure task includes: determining the operator corresponding to the distributed back pressure task based on the task TOPO information; obtaining the first data input amount of other tasks corresponding to the operator; obtaining the second data input amount of the distributed back pressure task based on the task running information; if the difference between the first data input amount and the second data input amount is greater than a data amount threshold, determining that the cause of the back pressure situation is data skew.

[0010] Optionally, determining the cause of the back pressure situation corresponding to the distributed back pressure task includes: determining the operator corresponding to the distributed back pressure task based on the task TOPO information; obtaining the task slot corresponding to the distributed back pressure task; obtaining other tasks corresponding to the operator and assigned the task slot; if the resources consumed by the other tasks exceed a preset resource threshold, or the resource occupancy ratio of the other tasks exceeds a preset ratio threshold, determining that the cause of the back pressure situation is uneven task slot allocation; wherein the resources include: CPU and memory.

[0011] Optionally, determining the cause of the back pressure situation corresponding to the distributed back pressure task includes: comparing the first data processing capability of the distributed back pressure task with the second data processing capability of other tasks, and determining whether the cause of the back pressure situation is that the instance runs slowly based on the comparison result.

[0012] Optionally, determining the reason for the back pressure situation corresponding to the distributed back pressure task includes: determining the physical node where the distributed back pressure task is deployed based on the task TOPO information; if it is determined that the resource usage of the physical node exceeds a preset first resource usage threshold, determining that the reason for the back pressure situation is insufficient resources; wherein the resources include: CPU and memory.

[0013] Optionally, judging whether there is excessive resource allocation for the distributed task based on the task TOPO information and the resource usage information includes: determining the physical node corresponding to the distributed back pressure task based on the task TOPO information; if it is determined that the resource usage of the physical node is lower than a preset second resource usage threshold, determining that there is excessive resource allocation for the distributed task; wherein the resources include: CPU and memory.

[0014] Optionally, generating corresponding task processing information based on the distributed task diagnosis result includes: generating the task processing information based on the cause of the back pressure situation and / or the excessive resource allocation of the distributed task; wherein the task processing information includes resource adjustment instructions and / or resource adjustment suggestion information.

[0015] Optionally, after receiving the resource adjustment instruction, the distributed task management device performs a corresponding resource adjustment operation according to the resource adjustment instruction; after receiving the resource adjustment suggestion information, the distributed task management device performs a prompt operation.

[0016] Optionally, the query address information includes: an operating status database address; obtaining the operating status data corresponding to the task ID according to the query address information includes: based on the operating status database address, obtaining the operating status data corresponding to the task ID from the operating status database; wherein the distributed task cluster periodically sends the operating status data to the operating status database.

[0017] Optionally, the distributed task includes: a Flink task.

[0018] According to a first aspect of the present disclosure, there is provided a distributed task diagnosis apparatus, comprising: a data acquisition module, for receiving a distributed task diagnosis start instruction sent by a distributed task management device, and acquiring running status data of a distributed task corresponding to the distributed task diagnosis start instruction; a task diagnosis module, for performing diagnostic processing on the running status data according to a preset task diagnosis rule, and generating a distributed task diagnosis result; and a task processing module, for generating corresponding task processing information based on the distributed task diagnosis result, and sending the task processing information to the distributed task management device, so that the distributed task management device performs corresponding operations according to the task processing information.

[0019] According to a third aspect of the present disclosure, there is provided a distributed task diagnosis apparatus, comprising: a memory; and a processor coupled to the memory, wherein the processor is configured to execute the method as described above based on instructions stored in the memory.

[0020] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the instructions are executed by a processor to implement the above distributed task diagnosis method.

[0021] The distributed task diagnosis method, device and storage medium disclosed in the present invention obtain the running status data of the distributed task corresponding to the distributed task diagnosis start instruction, diagnose and process the running status data according to the task diagnosis rules, generate the distributed task diagnosis results and generate the corresponding task processing information; can provide intelligent diagnosis function for the distributed tasks, and can optimize the distributed tasks according to the diagnosis results; provide resource elastic scaling function to ensure the normal operation of the tasks and the effective use of resources, so that the distributed tasks can run stably and improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0023] Figure 1 is a flow chart of an embodiment of a distributed task diagnosis method according to the present disclosure;

[0024] Figure 2 It is a flowchart of determining whether a distributed task has back pressure in one embodiment of the distributed task diagnosis method disclosed in the present invention;

[0025] Figure 3 It is a flowchart of determining whether data skew occurs in one embodiment of the distributed task diagnosis method according to the present disclosure;

[0026] Figure 4 It is a flowchart of determining whether uneven distribution of task slots occurs in one embodiment of the distributed task diagnosis method disclosed in the present invention;

[0027] Figure 5 A schematic diagram of the architecture of the distributed task diagnosis method disclosed in the present invention in practical application;

[0028] Figure 6 This is a schematic diagram of the information interaction sequence of the distributed task diagnosis method disclosed in the present invention in practical applications;

[0029] Figure 7 It is a module schematic diagram of an embodiment of a distributed task diagnosis device according to the present disclosure;

[0030] Figure 8 is a module schematic diagram of a task diagnosis module in one embodiment of a distributed task diagnosis device according to the present disclosure;

[0031] Fig. 9 It is a module schematic diagram of a task back pressure diagnosis unit in one embodiment of a distributed task diagnosis device according to the present disclosure;

[0032] Fig.10 It is a module diagram of another embodiment of a distributed task diagnosis device according to the present disclosure. DETAILED DESCRIPTION

[0033] The present disclosure is described more fully below with reference to the accompanying drawings, in which exemplary embodiments of the present disclosure are described. The technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure. The technical solutions of the present disclosure are described in many aspects below in conjunction with various figures and embodiments.

[0034] Figure 1 FIG. 1 is a flow chart of an embodiment of a distributed task diagnosis method according to the present disclosure, as shown in FIG. Figure 1 As shown:

[0035] Step 101: receiving a distributed task diagnosis start instruction sent by a distributed task management device, and acquiring running status data of a distributed task corresponding to the distributed task diagnosis start instruction.

[0036] In one embodiment, the distributed task may be a Flink task, etc. Flink is designed to run in all common cluster environments. Apache Flink is a framework and distributed processing engine for stateful computing of unbounded and bounded data streams. The Flink engine may be used to build a Flink task, and the Flink task may be submitted to a cluster for processing. The distributed task management device may be a Flink task management device, etc., for managing Flink tasks and Flink clusters.

[0037] Step 102: diagnose and process the running status data according to preset task diagnosis rules to generate distributed task diagnosis results.

[0038] Step 103: Generate corresponding task processing information based on the distributed task diagnosis result, and send the task processing information to the distributed task management device, so that the distributed task management device performs corresponding operations according to the task processing information.

[0039] In one embodiment, the information carried in the distributed task diagnosis start instruction includes: task ID, query address information, operation index information, etc.; the query address information includes: the address for obtaining operation index information, the address for obtaining task TOPO information, the address for obtaining historical diagnostic results, etc.; the operation indicators include running time, restart information, task operation, resource usage and other indicators.

[0040] For example, the query address information includes the address of the running status database, and based on the address of the running status database, the running status data corresponding to the task ID is obtained from the running status database. The distributed task cluster periodically sends the running status data to the running status database, and the distributed task cluster can be a Flink cluster, etc. The running status data includes task TOPO (topology) information, running time, restart information, task running information, resource usage information and other information. TOPO information includes information such as the physical node information of the Flink task deployment and the operator information corresponding to the Flink task; the task running information includes information such as the amount of data received by the task, the task processing time, and the task waiting time; the resource usage information includes information such as the CPU and memory used by the task.

[0041] In one embodiment, the task diagnosis rule may include multiple rules. For example, judging whether the distributed task meets the preset running time condition based on the running time, judging whether the distributed task is restarted based on the restart information, judging whether the distributed task is back-pressured based on the task running information, and judging whether the distributed task is over-allocated based on the task TOPO information and resource usage information.

[0042] The task processing information is generated based on the diagnosis results, including the running time of the distributed tasks, whether there is a restart, whether there is back pressure, whether there is excessive resource allocation, etc. The task processing information is stored in the database and sent to the distributed task management device, which can perform corresponding operations, for example, the distributed task management device adjusts the CPU, memory and other resources allocated to each distributed task.

[0043] Figure 2 FIG. 1 is a flow chart of determining whether a distributed task has back pressure in one embodiment of the distributed task diagnosis method disclosed in the present invention. Figure 2 As shown:

[0044] Step 201, obtaining a distributed back pressure task based on task running information; wherein the waiting time of the distributed back pressure task for the task request exceeds a preset waiting time threshold.

[0045] In one embodiment, the distributed back pressure task may be a Flink back pressure task, etc., and the Flink back pressure task is a Flink task that is blocked. For example, if the waiting time of a Flink task for a task request exceeds a preset waiting time threshold, it is determined that the Flink task is blocked, and the Flink task is determined to be a Flink back pressure task.

[0046] Step 202: If the number of distributed backpressure tasks is greater than a preset task number threshold, it is determined that a backpressure situation exists. The task number threshold can be set, for example, the task number threshold is 5, 6, etc.

[0047] Step 203, after determining that there is back pressure, determine the reason for the back pressure corresponding to the distributed back pressure task based on task TOPO information, task running information and resource usage information. The reasons for the back pressure include data skew, uneven task slot allocation, slow instance operation and insufficient resources.

[0048] Figure 3 FIG. 1 is a flow chart of determining whether data skew occurs in one embodiment of the distributed task diagnosis method disclosed herein. Figure 3 As shown:

[0049] Step 301: Determine the operator corresponding to the distributed backpressure task based on the task TOPO information.

[0050] In one embodiment, the operator can be any of the existing operators. The entire data processing flow of Flink is composed of multiple operators. An operator has one or more operator subtasks, and an operator subtask is a Flink task. The operator corresponding to the Flink task is determined based on the acquired task TOPO information.

[0051] Step 302: Obtain the first data input quantity of other tasks corresponding to the operator.

[0052] In one embodiment, all other tasks corresponding to the operator are obtained, and the other tasks may be other Flink tasks, etc. The first data input amount of other Flink tasks, that is, the data input amount corresponding to the other Flink tasks, is obtained.

[0053] Step 303: Obtain the second data input amount of the distributed back pressure task based on the task running information. For example, obtain the second data input amount of the Flink task, that is, the data input amount corresponding to the Flink task.

[0054] Step 304: If the difference between the first data input amount and the second data input amount is greater than a data amount threshold, it is determined that the reason for the back pressure is data skew, wherein the data amount threshold can be set.

[0055] In one embodiment, data skew refers to a phenomenon in which a portion of tasks has a lot of input data, while another portion of tasks has very little input data. The topology information at runtime is obtained, and based on the topology information, the operator corresponding to the Flink backpressure task causing the backpressure is obtained, all tasks of this operator are obtained, and the input data of all tasks is queried.

[0056] Determine whether there is an order of magnitude difference between the input data volume of the Flink backpressure task that currently generates backpressure and that of other tasks. For example, if the second input data volume of the task that currently generates backpressure is 100M, while the first input data volume of other tasks is 10M, then the cause of the backpressure is determined to be data skew.

[0057] Figure 4 FIG. 1 is a flow chart of determining whether uneven task slot allocation occurs in one embodiment of the distributed task diagnosis method disclosed herein. Figure 4 As shown:

[0058] Step 401: Determine the operator corresponding to the distributed backpressure task based on the task TOPO information.

[0059] Step 402: Obtain the task slot corresponding to the distributed back pressure task.

[0060] Step 403: Obtain other tasks corresponding to the operator and to which task slots are assigned.

[0061] Step 404, if the resources consumed by other tasks exceed the preset resource threshold, or the resource occupancy ratio of other tasks exceeds the preset ratio threshold, it is determined that the reason for the back pressure is uneven distribution of task slots; wherein the resources include: CPU and memory, etc.

[0062] For example, the resource threshold is 60% and the ratio threshold is 3 / 4; if the CPU and memory consumed by other tasks exceed 60%, or the resource occupancy ratio of other tasks exceeds 3 / 4, it is determined that the reason for the back pressure is uneven distribution of task slots.

[0063] In one embodiment, Flink defines execution resources through task slots. Each TaskManager has one or more task slots, and each task slot can execute tasks in parallel. Operators are executed in the slots of TaskManager, and one operator is executed in one slot.

[0064] Get the topology information at runtime, get the operator corresponding to the Flink backpressure task that causes backpressure based on the topology information, get all the tasks of this operator, and determine whether the CPU load and GC of other tasks exceed the threshold. If so, determine that the cause of the backpressure is uneven distribution of task slots. Alternatively, if the resource occupancy ratio of other tasks exceeds the preset ratio threshold, determine that the cause of the backpressure is uneven distribution of task slots.

[0065] In one embodiment, the first data processing capability of the distributed back pressure task is compared with the second data processing capability of other tasks, and whether the reason for the back pressure situation is that the instance runs slowly is determined based on the comparison result. For example, if the second data processing capability of the Flink back pressure task is significantly lower than the first data processing capability of other tasks when the input data is the same, it is determined that the reason for the back pressure situation is that the instance runs slowly.

[0066] The physical node where the distributed back pressure task is deployed is determined based on the task TOPO information. If it is determined that the resource usage of the physical node exceeds a preset first resource usage threshold, it is determined that the reason for the back pressure situation is insufficient resources, and the resources include CPU and memory, etc. For example, if the CPU load or GC exceeds the threshold, it is determined that the reason for the back pressure situation is insufficient resources.

[0067] In one embodiment, the physical node where the Flink back pressure task is deployed in the Flink cluster is determined based on the task TOPO information. If it is determined that the usage of the CPU and memory, etc. of this physical node exceeds a first resource usage threshold, which may be 60%, 70%, etc., then it is determined that the reason for the back pressure situation is insufficient resources.

[0068] The physical node corresponding to the distributed back pressure task is determined based on the task TOPO information, and if it is determined that the resource usage of the physical node is lower than the preset second resource usage threshold, it is determined that the distributed task has excessive resource allocation. For example, the physical node where the Flink task is deployed in the Flink cluster is determined based on the task TOPO information, and if it is determined that the CPU and memory usage of this physical node are lower than the second resource usage threshold, the second resource usage threshold may be 30%, 40%, etc., it is determined that there is excessive resource allocation.

[0069] In one embodiment, based on the existence of a back pressure situation and / or the existence of excessive resource allocation in a distributed task, task processing information is generated, and the task processing information includes resource adjustment instructions and / or resource adjustment suggestion information.

[0070] After receiving the resource adjustment instruction, the distributed task management device performs the corresponding resource adjustment operation according to the resource adjustment instruction. For example, the resource adjustment operation performed by the Flink management device includes allocating new physical nodes to Flink tasks, allocating more CPU and memory resources, and providing resource elastic scaling functions. After receiving the resource adjustment suggestion information, the Flink management device performs prompt operations including providing optimization solutions to users.

[0071] The distributed task diagnosis method disclosed in the present invention can provide intelligent diagnosis functions for Flink tasks, and users can optimize Flink tasks according to the diagnosis results; it provides resource elastic scaling function. When it is diagnosed that there is resource waste in the task, it automatically shrinks the capacity to save resources; when it is diagnosed that the task resources are insufficient, it automatically expands the capacity and adjusts the task parallelism to ensure the normal operation of the task and the effective use of resources.

[0072] In one embodiment, Figure 5 As shown in the figure, the Flink product end is the Flink task management device, the diagnostic device is a distributed task diagnostic device, and the Flink task is deployed in the Flink Cluster for operation. The Flink cluster periodically sends the operation status data to the operation status database Metric Storage database.

[0073] The Flink product side is used to publish, start and stop Flink tasks. The Metric Storage database stores the real-time running status data of Flink tasks. The Metric puller queries the metric indicators (running status data) from the Metric Storage database. The diagnostics customize various task diagnostic rules, perform diagnostic processing, and adjust strategies.

[0074] like Figure 6 As shown, the task management device is the Flink product side, which sends an intelligent diagnosis switch instruction. The information carried in the instruction includes task ID, multiple query address information, operation indicator information, etc., which is used to enable intelligent diagnosis. The distributed task diagnosis device regularly diagnoses based on metrics and provides corresponding solutions. If resource scaling is required, it cooperates with the Flink product side to adjust the task parallelism. The distributed task diagnosis device and JRC (JD Real-time Computing Platform) work together. The JRC platform includes the Flink product side, provides the function of turning on and off the diagnosis, and provides the task information that needs to be diagnosed. The distributed task diagnosis device generates corresponding task processing information based on the diagnosis results and sends the task processing information to the Flink product side.

[0075] The distributed task diagnosis device performs diagnostic processing based on diagnostic rules, including: whether the task running time meets the conditions, whether the task needs to be restarted, whether the task has back pressure, whether there is resource waste, etc.; for the situation where the task has back pressure, it is necessary to judge: whether there is data skew, whether there is uneven distribution, whether there are slow instances, whether there is insufficient resources, etc.

[0076] In one embodiment, Figure 7 As shown, the present disclosure provides a distributed task diagnosis device, including a data acquisition module 71, a task diagnosis module 72 and a task processing module 73. The data acquisition module 71 receives a distributed task diagnosis start instruction sent by a distributed task management device, and acquires the running status data of the distributed task corresponding to the distributed task diagnosis start instruction.

[0077] The task diagnosis module 72 performs diagnostic processing on the operation status data according to the preset task diagnosis rules to generate a distributed task diagnosis result. The task processing module 73 generates corresponding task processing information based on the distributed task diagnosis result and sends the task processing information to the distributed task management device so that the distributed task management device performs corresponding operations according to the task processing information.

[0078] In one embodiment, the information carried in the distributed task diagnosis start instruction includes: task ID, query address information, operation index information, etc. The data acquisition module 71 acquires the operation status data corresponding to the task ID according to the query address information; wherein the operation status data includes: task TOPO information, operation time, restart information, task operation information, resource usage information, etc.

[0079] For example, the query address information includes the operation status database address, and the data acquisition module 71 acquires the operation status data corresponding to the task ID from the operation status database based on the operation status database address; wherein the distributed task cluster periodically sends the operation status data to the operation status database.

[0080] like Figure 8 As shown, the task diagnosis module 72 includes: a task duration diagnosis unit 721, a task restart diagnosis unit 722, a task back pressure diagnosis unit 723 and a task resource diagnosis unit 724. The task duration diagnosis unit 721 determines whether the distributed task meets the preset runtime condition based on the runtime. The task restart diagnosis unit 722 determines whether the distributed task is restarted based on the restart information. The task back pressure diagnosis unit 723 determines whether the distributed task is back pressured based on the task running information. The task resource diagnosis unit 724 determines whether the distributed task has excessive resource allocation based on the task TOPO information and resource usage information.

[0081] The task backpressure diagnosis unit 723 obtains the distributed backpressure task based on the task running information, wherein the waiting time of the distributed backpressure task for the task request exceeds the preset waiting time threshold. If the number of distributed backpressure tasks is greater than the preset task number threshold, the task backpressure diagnosis unit 723 determines that there is a backpressure situation.

[0082] After determining that there is a backpressure situation, the task backpressure diagnosis unit 723 determines the cause of the backpressure situation corresponding to the distributed backpressure task based on the task TOPO information, task running information and resource usage information, where the causes of the backpressure situation include: data skew, uneven distribution of task slots, slow instance operation and insufficient resources, etc.

[0083] like Fig. 9As shown, the task backpressure diagnostic unit 723 includes: a data skew diagnostic unit 7231, a first allocation diagnostic unit 7232, an instance operation diagnostic unit 7233, and a second allocation diagnostic unit 7234. The data skew diagnostic unit 7231 determines the operator corresponding to the distributed backpressure task based on the task TOPO information. The data skew diagnostic unit 7231 obtains the first data input amount of other tasks corresponding to the operator. The second data input amount of the distributed backpressure task is obtained based on the task operation information. If the difference between the first data input amount and the second data input amount is greater than the data amount threshold, the data skew diagnostic unit 7231 determines that the cause of the backpressure situation is data skew.

[0084] The first allocation diagnostic unit 7232 determines the operator corresponding to the distributed back pressure task based on the task TOPO information. The first allocation diagnostic unit 7232 obtains the task slot corresponding to the distributed back pressure task, and obtains other tasks corresponding to the operator to which the task slot is allocated. If the resources consumed by other tasks exceed the preset resource threshold, or the resource occupancy ratio of other tasks exceeds the preset ratio threshold, the first allocation diagnostic unit 7232 determines that the reason for the back pressure situation is uneven distribution of task slots, where the resources include: CPU and memory, etc.

[0085] The instance operation diagnosis unit 7233 compares the first data processing capability of the distributed back pressure task with the second data processing capability of other tasks. The instance operation diagnosis unit 7233 determines whether the cause of the back pressure situation is the slow operation of the instance based on the comparison result.

[0086] The second allocation diagnosis unit 7234 determines the physical node deployed with the distributed back pressure task based on the task TOPO information. If it is determined that the resource usage of the physical node exceeds the preset first resource usage threshold, the second allocation diagnosis unit 7234 determines that the reason for the back pressure situation is insufficient resources, where the resources include CPU and memory, etc.

[0087] The task resource diagnosis unit 724 determines the physical node corresponding to the distributed back pressure task based on the task TOPO information. If the resource usage of the physical node is determined to be lower than the preset second resource usage threshold, the task resource diagnosis unit 724 determines that the distributed task has excessive resource allocation.

[0088] In one embodiment, the task processing module 73 generates task processing information based on the reason for the back pressure and / or the excessive resource allocation of the distributed task; wherein the task processing information includes resource adjustment instructions and / or resource adjustment suggestion information. After receiving the resource adjustment instruction, the distributed task management device performs corresponding resource adjustment operations according to the resource adjustment instruction. After receiving the resource adjustment suggestion information, the distributed task management device performs a prompt operation.

[0089] In one embodiment, Fig.10 FIG. 1 is a schematic diagram of a module of another embodiment of a distributed task diagnosis device according to the present disclosure. Fig.10 As shown, the apparatus may include a memory 1001, a processor 1002, a communication interface 1003 and a bus 1004. The memory 1001 is used to store instructions, the processor 1002 is coupled to the memory 1001, and the processor 1002 is configured to execute the above-mentioned distributed task diagnosis method based on the instructions stored in the memory 1001.

[0090] The memory 1001 may be a high-speed RAM memory, a non-volatile memory, etc. The memory 1001 may also be a memory array. The memory 1001 may also be divided into blocks, and the blocks may be combined into virtual volumes according to certain rules. The processor 1002 may be a central processing unit CPU, or an application-specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the distributed task diagnosis method disclosed in the present invention.

[0091] In one embodiment, the present disclosure provides a computer-readable storage medium storing computer instructions, which implement the distributed task diagnosis method in any of the above embodiments when executed by a processor.

[0092] The distributed task diagnosis method, device and storage medium provided in the above-mentioned embodiments obtain the running status data of the distributed task corresponding to the distributed task diagnosis start instruction, diagnose and process the running status data according to the task diagnosis rules, generate a distributed task diagnosis result and generate corresponding task processing information; can provide intelligent diagnosis functions for distributed tasks, and can optimize distributed tasks according to the diagnosis results; provide resource elastic scaling function, when it is diagnosed that there is resource waste in the task, it can automatically shrink the capacity to save resources; when it is diagnosed that the task resources are insufficient, it can automatically expand the capacity and adjust the task parallelism to ensure the normal operation of the task and the effective use of resources; it can make the distributed tasks run stably and improve the user experience.

[0093] The method and system of the present disclosure may be implemented in many ways. For example, the method and system of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above, unless otherwise specifically stated. In addition, in some embodiments, the present disclosure may also be implemented as a program recorded in a recording medium, which includes machine-readable instructions for implementing the method according to the present disclosure. Therefore, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.

[0094] The description of the present disclosure is given for the purpose of illustration and description, and is not intended to be exhaustive or to limit the present disclosure to the disclosed form. Many modifications and variations will be apparent to those of ordinary skill in the art. The embodiments are selected and described in order to better illustrate the principles and practical applications of the present disclosure, and to enable those of ordinary skill in the art to understand the present disclosure and thereby design various embodiments with various modifications suitable for specific uses.

Claims

1. A distributed task diagnosis method, comprising: Receiving a distributed task diagnosis start instruction sent by a distributed task management device, and acquiring running status data of the distributed task corresponding to the distributed task diagnosis start instruction; The information carried in the distributed task diagnosis start instruction includes: task ID, query address information, and operation index information; the operation status data corresponding to the task ID is obtained according to the query address information, and the operation status data includes: task TOPO information, operation time, restart information, task operation information, and resource usage information; Performing diagnostic processing on the operating status data according to preset task diagnostic rules to generate distributed task diagnostic results; Among them, judging whether the distributed task meets the preset running time condition based on the running time; judging whether the distributed task is restarted based on the restart information; judging whether the distributed task is back-pressured based on the task running information; judging whether the distributed task is over-allocated in resources based on the task TOPO information and the resource usage information; Corresponding task processing information is generated based on the distributed task diagnosis result, and the task processing information is sent to the distributed task management device, so that the distributed task management device performs corresponding operations according to the task processing information.

2. The method according to claim 1, wherein judging whether the distributed task has back pressure based on the task running information comprises: Obtaining a distributed back pressure task based on the task running information; wherein the waiting time of the distributed back pressure task for the task request exceeds a preset waiting time threshold; If the number of the distributed backpressure tasks is greater than a preset task number threshold, it is determined that a backpressure situation exists.

3. The method of claim 2, further comprising: After determining that a back pressure situation exists, determining a reason for the existence of the back pressure situation corresponding to the distributed back pressure task based on the task TOPO information, the task running information and the resource usage information; The reasons for the back pressure situation include: at least one of data skew, uneven distribution of task slots, slow instance operation and insufficient resources.

4. The method of claim 3, wherein determining the reason for the existence of the back pressure situation corresponding to the distributed back pressure task comprises: Determine an operator corresponding to the distributed backpressure task based on the task TOPO information; Acquire a first data input quantity of other tasks corresponding to the operator; Acquire a second data input amount of the distributed back pressure task based on the task running information; If the difference between the first data input amount and the second data input amount is greater than a data amount threshold, it is determined that the reason for the existence of the back pressure situation is data skew.

5. The method of claim 3, wherein determining a reason for the existence of a back pressure situation corresponding to the distributed back pressure task comprises: Determine an operator corresponding to the distributed backpressure task based on the task TOPO information; Obtain a task slot corresponding to the distributed back pressure task; Obtaining other tasks corresponding to the operator and to which the task slot is assigned; If the resources consumed by the other tasks exceed a preset resource threshold, or the resource occupancy ratio of the other tasks exceeds a preset ratio threshold, it is determined that the cause of the back pressure is uneven distribution of task slots; wherein the resources include: CPU and memory.

6. The method of claim 3, wherein determining a reason for the existence of a back pressure situation corresponding to the distributed back pressure task comprises: The first data processing capability of the distributed back pressure task is compared with the second data processing capability of other tasks, and based on the comparison result, it is determined whether the reason for the back pressure situation is that the instance runs slowly.

7. The method of claim 3, wherein determining a reason for the existence of a back pressure situation corresponding to the distributed back pressure task comprises: Determine the physical node where the distributed back pressure task is deployed based on the task TOPO information; If it is determined that the resource usage of the physical node exceeds a preset first resource usage threshold, it is determined that the reason for the back pressure situation is insufficient resources; wherein the resources include: CPU and memory.

8. The method according to claim 3, wherein judging whether the distributed task has excessive resource allocation based on the task TOPO information and the resource usage information comprises: Determine a physical node corresponding to the distributed back pressure task based on the task TOPO information; If it is determined that the resource usage of the physical node is lower than a preset second resource usage threshold, it is determined that there is an over-resource allocation situation in the distributed task; wherein the resources include: CPU and memory.

9. The diagnostic method according to claim 8, wherein generating corresponding task processing information based on the distributed task diagnostic result comprises: The task processing information is generated based on the reason for the back pressure and / or the excessive resource allocation of the distributed task; wherein the task processing information includes resource adjustment instructions and / or resource adjustment suggestion information.

10. The diagnostic method according to claim 9, wherein: After receiving the resource adjustment instruction, the distributed task management device performs a corresponding resource adjustment operation according to the resource adjustment instruction; After receiving the resource adjustment suggestion information, the distributed task management device performs a prompting operation.

11. The method according to claim 1, wherein the querying of address information comprises: Operation status database address; The acquiring the running status data corresponding to the task ID according to the query address information comprises: Based on the operation status database address, acquiring the operation status data corresponding to the task ID from the operation status database; Wherein, the distributed task cluster periodically sends the running status data to the running status database.

12. The method according to any one of claims 1 to 11, wherein: The distributed tasks include: Flink tasks.

13. A distributed task diagnosis device, comprising: A data acquisition module is used to receive a distributed task diagnosis start instruction sent by a distributed task management device, and obtain the running status data of the distributed task corresponding to the distributed task diagnosis start instruction; wherein the information carried in the distributed task diagnosis start instruction includes: task ID, query address information, and running indicator information; the data acquisition module is specifically used to obtain the running status data corresponding to the task ID according to the query address information, and the running status data includes: task TOPO information, running time, restart information, task running information, and resource usage information; A task diagnosis module, used to perform diagnosis processing on the operation status data according to preset task diagnosis rules and generate distributed task diagnosis results; Wherein, the task diagnosis module includes: A task duration diagnosis unit, used to determine whether the distributed task meets a preset runtime condition based on the runtime; A task restart diagnosis unit, used for determining whether the distributed task has been restarted based on the restart information; A task backpressure diagnosis unit, used for determining whether the distributed task has a backpressure situation based on the task running information; A task resource diagnosis unit, configured to determine whether the distributed task has excessive resource allocation based on the task TOPO information and the resource usage information; The task processing module is used to generate corresponding task processing information based on the distributed task diagnosis result, and send the task processing information to the distributed task management device so that the distributed task management device performs corresponding operations according to the task processing information.

14. A distributed task diagnosis device, comprising: Memory; and a processor coupled to the memory, the processor being configured to execute the method according to any one of claims 1 to 12 based on instructions stored in the memory. 15 . A computer-readable storage medium, wherein the computer-readable storage medium non-transitorily stores computer instructions, wherein the instructions are executed by a processor to perform the method according to claim 1 .