[go: up one dir, main page]

CN116483578A - Link time consumption analysis method and device, storage medium and electronic equipment - Google Patents

Link time consumption analysis method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN116483578A
CN116483578A CN202310512305.XA CN202310512305A CN116483578A CN 116483578 A CN116483578 A CN 116483578A CN 202310512305 A CN202310512305 A CN 202310512305A CN 116483578 A CN116483578 A CN 116483578A
Authority
CN
China
Prior art keywords
time
target
data
storage device
queue
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310512305.XA
Other languages
Chinese (zh)
Inventor
胡东旭
陈存利
赵鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Du Xiaoman Technology Beijing Co Ltd
Original Assignee
Du Xiaoman Technology Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Du Xiaoman Technology Beijing Co Ltd filed Critical Du Xiaoman Technology Beijing Co Ltd
Priority to CN202310512305.XA priority Critical patent/CN116483578A/en
Publication of CN116483578A publication Critical patent/CN116483578A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a method and a device for analyzing time consumption of a link, a storage medium and electronic equipment, wherein the method comprises the following steps: when a data access request sent by a target client is received, adding the data access request into a first queue, and determining the enqueue time when the data access request is added into the first queue; transmitting the data access request to target storage equipment included in the storage equipment cluster through the first queue so that the target storage equipment executes the data access request to obtain a target request result of the data access request; receiving a target request result returned by the target storage device, adding the target request result into a second queue, and determining the dequeue time when the target request result comes out of the second queue to be sent to the target client; and determining the middle layer time-consuming result of the data access request by adopting the enqueue time and the dequeue time. The embodiment of the invention can construct a storage system supporting the link time consumption analysis so as to realize the requested link time consumption analysis.

Description

链路耗时分析方法、装置、存储介质及电子设备Link time-consuming analysis method, device, storage medium and electronic equipment

技术领域technical field

本发明涉及计算机技术领域,尤其涉及一种链路耗时分析方法、装置、存储介质及电子设备。The invention relates to the field of computer technology, in particular to a link time-consuming analysis method, device, storage medium and electronic equipment.

背景技术Background technique

目前,由存储设备集群中的各个存储设备所构成的存储系统已被广泛应用,其中,存储设备可以是内存对象缓存系统(Memcache)和Gridstore(一种可根据需要来增加存储块的存储设备)等,且Memcache是一套高性能内存对象缓存系统,一般用于动态web(WorldWide Web,万维网)应用来减轻数据库的负载,可通过在内存中缓存数据和对象,来减少读取数据库的次数,从而提高动态访问数据库的能力。以存储设备为内存对象缓存系统为例进行说明,内存对象缓存系统不具备慢查询日志记录功能,现有存储系统仅能通过memcache-top(memcache的辅助工具)获取整个存储设备集群的缓存(cache)命中率、各类命令的QPS(Query Per Second,每秒查询率)以及耗时均值,而无法提供各个请求的详细耗时信息;可见,在现有技术中,存储系统对链路耗时分析的能力不足。基于此,如何构建一个支持链路耗时分析的存储系统,以实现对请求的链路耗时分析成为一个研究热点。At present, a storage system composed of various storage devices in a storage device cluster has been widely used. Among them, the storage device can be a memory object cache system (Memcache) and Gridstore (a storage device that can increase storage blocks according to needs), etc., and Memcache is a set of high-performance memory object cache system, which is generally used in dynamic web (World Wide Web, World Wide Web) applications to reduce the load on the database. By caching data and objects in memory, the number of times to read the database can be reduced, thereby improving the ability to dynamically access the database. Taking the storage device as the memory object cache system as an example, the memory object cache system does not have the slow query logging function. The existing storage system can only obtain the cache (cache) hit rate of the entire storage device cluster, the QPS (Query Per Second, query rate per second) and the average time consumption of various commands through memcache-top (an auxiliary tool for memcache), but cannot provide detailed time-consuming information of each request. It can be seen that in the existing technology, the storage system has insufficient ability to analyze the time consumption of links. Based on this, how to build a storage system that supports link time-consuming analysis to realize link time-consuming analysis of requests has become a research hotspot.

发明内容Contents of the invention

有鉴于此,本发明实施例提供了一种链路耗时分析方法、装置、存储介质及电子设备,以解决现有存储系统不支持对请求的链路耗时分析的问题,也就是说,本发明实施例可构建一个支持链路耗时分析的存储系统,以实现对请求的链路耗时分析。In view of this, embodiments of the present invention provide a link time-consuming analysis method, device, storage medium, and electronic equipment to solve the problem that existing storage systems do not support link time-consuming analysis of requests, that is, embodiments of the present invention can build a storage system that supports link time-consuming analysis, so as to implement link time-consuming analysis of requests.

根据本发明的一方面,提供了一种链路耗时分析方法,所述方法应用于存储系统中的中间代理设备,所述存储系统包括至少一个客户端、所述中间代理设备以及所述中间代理设备管理的存储设备集群;所述方法包括:According to one aspect of the present invention, a method for analyzing link time consumption is provided, the method is applied to an intermediate proxy device in a storage system, and the storage system includes at least one client, the intermediate proxy device, and a storage device cluster managed by the intermediate proxy device; the method includes:

在接收到目标客户端发送的数据访问请求时,将所述数据访问请求添加至第一队列中,并确定所述数据访问请求被添加至所述第一队列的入队时间,所述第一队列用于存放从客户端接收到的请求;When receiving the data access request sent by the target client, adding the data access request to the first queue, and determining the enqueue time when the data access request is added to the first queue, the first queue is used to store requests received from the client;

通过所述第一队列,将所述数据访问请求发送至所述存储设备集群包括的目标存储设备中,以使所述目标存储设备执行所述数据访问请求,得到所述数据访问请求的目标请求结果,所述目标存储设备为所述存储设备集群中的任一存储设备;Send the data access request to a target storage device included in the storage device cluster through the first queue, so that the target storage device executes the data access request to obtain a target request result of the data access request, and the target storage device is any storage device in the storage device cluster;

接收所述目标存储设备返回的所述目标请求结果,将所述目标请求结果添加至第二队列中,并确定所述目标请求结果从所述第二队列中出来以被发送至所述目标客户端的出队时间,所述第二队列用于存放待发送至客户端的请求结果;receiving the target request result returned by the target storage device, adding the target request result to a second queue, and determining the dequeue time for the target request result to come out of the second queue to be sent to the target client, and the second queue is used to store the request result to be sent to the client;

采用所述入队时间和所述出队时间,确定所述数据访问请求的中间层耗时结果。Using the enqueue time and the dequeue time, determine the time-consuming result of the middle layer of the data access request.

根据本发明的另一方面,提供了另一种链路耗时分析方法,所述方法应用于存储系统中的目标实例代理设备,所述存储系统包括至少一个客户端、中间代理设备、所述中间代理设备管理的存储设备集群以及所述存储设备集群中各个存储设备对应的实例代理设备,所述目标实例代理设备支持监听捕获所述中间代理设备的信息,以用于检测目标存储设备所接收以及发出的报文,所述目标存储设备为所述存储设备集群中与所述目标实例代理设备相对应的存储设备;所述方法包括:According to another aspect of the present invention, another link time-consuming analysis method is provided. The method is applied to a target instance proxy device in a storage system. The storage system includes at least one client, an intermediate proxy device, a storage device cluster managed by the intermediate proxy device, and an instance proxy device corresponding to each storage device in the storage device cluster. The target instance proxy device supports monitoring and capturing information of the intermediate proxy device for detecting messages received and sent by the target storage device. The target storage device is a storage device corresponding to the target instance proxy device in the storage device cluster; the method includes:

在检测到所述目标存储设备接收到数据访问请求中的第一报文数据时,记录所述第一报文数据的接收时间,所述数据访问请求包括至少一个报文数据,且所述第一报文数据的接收时间,早于所述至少一个报文数据中除所述第一报文数据以外的任一报文数据的接收时间;When it is detected that the target storage device receives the first message data in the data access request, record the receiving time of the first message data, the data access request includes at least one message data, and the receiving time of the first message data is earlier than the receiving time of any message data in the at least one message data except the first message data;

在检测到所述至少一个报文数据中各个报文数据的响应报文被发出时,记录所述各个报文数据的响应报文被发出的发出时间,一个报文数据的响应报文为存储设备对相应报文数据的执行结果;When it is detected that the response message of each message data in the at least one message data is sent, record the sending time of the response message of each message data, and the response message of one message data is the execution result of the corresponding message data by the storage device;

采用所述第一报文数据的接收时间,以及第二报文数据的响应报文被发出的发出时间,确定所述数据访问请求的实例层耗时结果,所述第二报文数据的响应报文被发出的发出时间,晚于所述至少一个报文数据中其他报文数据的响应报文被发出的发出时间。Using the receiving time of the first message data and the sending time of the response message of the second message data to determine the time-consuming result of the instance layer of the data access request, the sending time of the response message of the second message data is later than the sending time of the response messages of other message data in the at least one message data.

根据本发明的另一方面,提供了一种链路耗时分析装置,所述装置运行于存储系统中的中间代理设备,所述存储系统包括至少一个客户端、所述中间代理设备以及所述中间代理设备管理的存储设备集群;所述装置包括:According to another aspect of the present invention, a link time-consuming analysis device is provided, the device runs on an intermediate proxy device in a storage system, and the storage system includes at least one client, the intermediate proxy device, and a storage device cluster managed by the intermediate proxy device; the device includes:

处理单元,用于在接收到目标客户端发送的数据访问请求时,将所述数据访问请求添加至第一队列中,并确定所述数据访问请求被添加至所述第一队列的入队时间,所述第一队列用于存放从客户端接收到的请求;The processing unit is configured to add the data access request to the first queue when receiving the data access request sent by the target client, and determine the enqueue time when the data access request is added to the first queue, and the first queue is used to store requests received from the client;

发送单元,用于通过所述第一队列,将所述数据访问请求发送至所述存储设备集群包括的目标存储设备中,以使所述目标存储设备执行所述数据访问请求,得到所述数据访问请求的目标请求结果,所述目标存储设备为所述存储设备集群中的任一存储设备;A sending unit, configured to send the data access request to a target storage device included in the storage device cluster through the first queue, so that the target storage device executes the data access request to obtain a target request result of the data access request, and the target storage device is any storage device in the storage device cluster;

接收单元,用于接收所述目标存储设备返回的所述目标请求结果;a receiving unit, configured to receive the target request result returned by the target storage device;

所述处理单元,还用于将所述目标请求结果添加至第二队列中,并确定所述目标请求结果从所述第二队列中出来以被发送至所述目标客户端的出队时间,所述第二队列用于存放待发送至客户端的请求结果;The processing unit is further configured to add the target request result to a second queue, and determine the dequeue time for the target request result to come out of the second queue to be sent to the target client, and the second queue is used to store the request result to be sent to the client;

所述处理单元,还用于采用所述入队时间和所述出队时间,确定所述数据访问请求的中间层耗时结果。The processing unit is further configured to use the enqueue time and the dequeue time to determine the time-consuming result of the middle layer of the data access request.

根据本发明的另一方面,提供了另一种链路耗时分析装置,所述装置运行于存储系统中的目标实例代理设备,所述存储系统包括至少一个客户端、中间代理设备、所述中间代理设备管理的存储设备集群以及所述存储设备集群中各个存储设备对应的实例代理设备,所述目标实例代理设备支持监听捕获所述中间代理设备的信息,以用于检测目标存储设备所接收以及发出的报文,所述目标存储设备为所述存储设备集群中与所述目标实例代理设备相对应的存储设备;所述装置包括:According to another aspect of the present invention, another link time-consuming analysis device is provided. The device runs on a target instance proxy device in a storage system. The storage system includes at least one client, an intermediate proxy device, a storage device cluster managed by the intermediate proxy device, and an instance proxy device corresponding to each storage device in the storage device cluster. The target instance proxy device supports monitoring and capturing information of the intermediate proxy device for detecting messages received and sent by the target storage device. The target storage device is a storage device corresponding to the target instance proxy device in the storage device cluster; the device includes:

处理单元,用于在检测到所述目标存储设备接收到数据访问请求中的第一报文数据时,记录所述第一报文数据的接收时间,所述数据访问请求包括至少一个报文数据,且所述第一报文数据的接收时间,早于所述至少一个报文数据中除所述第一报文数据以外的任一报文数据的接收时间;A processing unit, configured to record the receiving time of the first message data when detecting that the target storage device receives the first message data in the data access request, the data access request includes at least one message data, and the receiving time of the first message data is earlier than the receiving time of any message data in the at least one message data except the first message data;

所述处理单元,还用于在检测到所述至少一个报文数据中各个报文数据的响应报文被发出时,记录所述各个报文数据的响应报文被发出的发出时间,一个报文数据的响应报文为存储设备对相应报文数据的执行结果;The processing unit is further configured to record the sending time of the response message of each message data when detecting that the response message of each message data in the at least one message data is sent, and the response message of one message data is the execution result of the corresponding message data by the storage device;

所述处理单元,还用于采用所述第一报文数据的接收时间,以及第二报文数据的响应报文被发出的发出时间,确定所述数据访问请求的实例层耗时结果,所述第二报文数据的响应报文被发出的发出时间,晚于所述至少一个报文数据中其他报文数据的响应报文被发出的发出时间。The processing unit is further configured to use the receiving time of the first message data and the sending time of the response message of the second message data to determine the time-consuming result of the instance layer of the data access request, and the sending time of the response message of the second message data is later than the sending time of the response messages of other message data in the at least one message data.

根据本发明的另一方面,提供了一种电子设备,所述电子设备包括处理器、以及存储程序的存储器,其中,所述程序包括指令,所述指令在由所述处理器执行时使所述处理器执行上述所提及的方法。According to another aspect of the present invention, an electronic device is provided, and the electronic device includes a processor and a memory storing a program, wherein the program includes instructions, and the instructions cause the processor to perform the above-mentioned method when executed by the processor.

根据本发明的另一方面,提供了一种存储有计算机指令的非瞬时计算机可读存储介质,所述计算机指令用于使计算机执行上述所提及的方法。According to another aspect of the present invention, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the above-mentioned method.

本发明实施例可在中间代理设备接收到目标客户端发送的数据访问请求时,将数据访问请求添加至第一队列中,并确定数据访问请求被添加至第一队列的入队时间;然后,中间代理设备可通过第一队列将数据访问请求发送至目标存储设备中,以使目标存储设备执行数据访问请求,得到数据访问请求的目标请求结果;基于此,在中间代理设备接收到目标存储设备返回的目标请求结果时,可将目标请求结果添加至第二队列中,并确定目标请求结果从第二队列中出来以被发送至目标客户端的出队时间,从而采用入队时间和出队时间,确定数据访问请求的中间层耗时结果,使得基于中间代理设备构建的存储系统能够支持链路耗时分析。相应的,构建的存储系统还可包括存储设备集群中各个存储设备对应的实例代理设备,针对目标实例代理设备,目标实例代理设备可在检测到目标存储设备接收到数据访问请求中的第一报文数据时,记录第一报文数据的接收时间,数据访问请求包括至少一个报文数据,且第一报文数据的接收时间,早于至少一个报文数据中除第一报文数据以外的任一报文数据的接收时间;并且,在检测到至少一个报文数据中各个报文数据的响应报文被发出时,记录各个报文数据的响应报文被发出的发出时间,从而采用第一报文数据的接收时间,以及第二报文数据的响应报文被发出的发出时间,确定数据访问请求的实例层耗时结果,从而获取到精确性更高的耗时结果。可见,本发明实施例可构建一个支持链路耗时分析的存储系统,以从至少一个方面实现对请求的链路耗时分析,尤其是存储设备为内存对象缓存系统时,可实现对访问内存对象缓存系统的请求的链路耗时分析,以解决内存对象缓存系统不支持对相应请求的链路耗时分析的问题,从而解决包含内存对象缓存系统的存储系统所涉及的问题定位较慢,且分析手段能力不足等问题。In the embodiment of the present invention, when the intermediate proxy device receives the data access request sent by the target client, it can add the data access request to the first queue, and determine the enqueue time when the data access request is added to the first queue; then, the intermediate proxy device can send the data access request to the target storage device through the first queue, so that the target storage device executes the data access request, and obtains the target request result of the data access request; The dequeue time sent to the target client is used to determine the time-consuming result of the middle layer of the data access request by using the queue-entry time and the dequeue time, so that the storage system based on the intermediate proxy device can support link time-consuming analysis. Correspondingly, the constructed storage system may further include an instance agent device corresponding to each storage device in the storage device cluster. For the target instance agent device, the target instance agent device may record the receiving time of the first message data when detecting that the target storage device receives the first message data in the data access request. When the file is sent, record the sending time of the response message of each message data, so as to use the receiving time of the first message data and the sending time of the response message of the second message data to determine the time-consuming result of the instance layer of the data access request, so as to obtain a more accurate time-consuming result. It can be seen that the embodiment of the present invention can build a storage system that supports link time-consuming analysis, so as to realize link time-consuming analysis of requests from at least one aspect, especially when the storage device is a memory object caching system, it can implement link time-consuming analysis of requests for accessing the memory object caching system, so as to solve the problem that the memory object caching system does not support link time-consuming analysis of corresponding requests, thereby solving problems related to the storage system including the memory object caching system.

附图说明Description of drawings

在下面结合附图对于示例性实施例的描述中,本发明的更多细节、特征和优点被公开,在附图中:Further details, features and advantages of the invention are disclosed in the following description of exemplary embodiments with reference to the accompanying drawings in which:

图1a示出了根据本发明示例性实施例的一种存储系统的结构示意图;Figure 1a shows a schematic structural diagram of a storage system according to an exemplary embodiment of the present invention;

图1b示出了根据本发明示例性实施例的另一种存储系统的结构示意图;Figure 1b shows a schematic structural diagram of another storage system according to an exemplary embodiment of the present invention;

图2示出了根据本发明示例性实施例的一种链路耗时分析方法的流程示意图;Fig. 2 shows a schematic flowchart of a link time consumption analysis method according to an exemplary embodiment of the present invention;

图3a示出了根据本发明示例性实施例的又一种存储系统的结构示意图;Fig. 3a shows a schematic structural diagram of another storage system according to an exemplary embodiment of the present invention;

图3b示出了根据本发明示例性实施例的再一种存储系统的结构示意图;Fig. 3b shows a schematic structural diagram of another storage system according to an exemplary embodiment of the present invention;

图4示出了根据本发明示例性实施例的另一种链路耗时分析方法的流程示意图;FIG. 4 shows a schematic flowchart of another link time consumption analysis method according to an exemplary embodiment of the present invention;

图5示出了根据本发明示例性实施例的一种通信的示意图;Fig. 5 shows a schematic diagram of communication according to an exemplary embodiment of the present invention;

图6示出了根据本发明示例性实施例的又一种链路耗时分析方法的流程示意图;FIG. 6 shows a schematic flowchart of another method for link time consumption analysis according to an exemplary embodiment of the present invention;

图7a示出了根据本发明示例性实施例的一种链路耗时分析装置的示意性框图;Fig. 7a shows a schematic block diagram of a link time consumption analysis device according to an exemplary embodiment of the present invention;

图7b示出了根据本发明示例性实施例的另一种链路耗时分析装置的示意性框图;Fig. 7b shows a schematic block diagram of another link time consumption analysis device according to an exemplary embodiment of the present invention;

图8示出了能够用于实现本发明的实施例的示例性电子设备的结构框图。FIG. 8 shows a structural block diagram of an exemplary electronic device that can be used to implement the embodiments of the present invention.

具体实施方式Detailed ways

下面将参照附图更详细地描述本发明的实施例。虽然附图中显示了本发明的某些实施例,然而应当理解的是,本发明可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例,相反提供这些实施例是为了更加透彻和完整地理解本发明。应当理解的是,本发明的附图及实施例仅用于示例性作用,并非用于限制本发明的保护范围。Embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the invention are shown in the drawings, it should be understood that the invention may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the invention. It should be understood that the drawings and embodiments of the present invention are for exemplary purposes only, and are not intended to limit the protection scope of the present invention.

应当理解,本发明的方法实施方式中记载的各个步骤可以按照不同的顺序执行,和/或并行执行。此外,方法实施方式可以包括附加的步骤和/或省略执行示出的步骤。本发明的范围在此方面不受限制。It should be understood that the various steps described in the method implementation manners of the present invention may be executed in different orders, and/or executed in parallel. Additionally, method embodiments may include additional steps and/or omit performing illustrated steps. The scope of the invention is not limited in this regard.

本文使用的术语“包括”及其变形是开放性包括,即“包括但不限于”。术语“基于”是“至少部分地基于”。术语“一个实施例”表示“至少一个实施例”;术语“另一实施例”表示“至少一个另外的实施例”;术语“一些实施例”表示“至少一些实施例”。其他术语的相关定义将在下文描述中给出。需要注意,本发明中提及的“第一”、“第二”等概念仅用于对不同的装置、模块或单元进行区分,并非用于限定这些装置、模块或单元所执行的功能的顺序或者相互依存关系。As used herein, the term "comprise" and its variations are open-ended, ie "including but not limited to". The term "based on" is "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one further embodiment"; the term "some embodiments" means "at least some embodiments." Relevant definitions of other terms will be given in the description below. It should be noted that concepts such as "first" and "second" mentioned in the present invention are only used to distinguish different devices, modules or units, and are not used to limit the sequence or interdependence of the functions performed by these devices, modules or units.

需要注意,本发明中提及的“一个”、“多个”的修饰是示意性而非限制性的,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。It should be noted that the modifications of "one" and "multiple" mentioned in the present invention are illustrative and not restrictive, and those skilled in the art should understand that unless the context clearly indicates otherwise, it should be understood as "one or more".

本发明实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。The names of messages or information exchanged between multiple devices in the embodiments of the present invention are used for illustrative purposes only, and are not used to limit the scope of these messages or information.

在本发明实施例中,如图1a所示,涉及一种支持链路耗时分析的存储系统,该存储系统包括至少一个客户端(即终端)101、中间代理设备(Router-server)102以及至少一个存储设备103,至少一个存储设备103构成存储系统中的存储设备集群,且中间代理设备102也可称为中间代理层;也就是说,存储系统的底层对应了至少一个不同的存储设备103,可通过中间代理设备102做负载均衡策略,并将至少一个存储设备103串成一个分布式集群,从而突破单个存储设备的内存瓶颈,并避免用户侧(即客户端101)自行维护存储设备列表的代价。其中,存储设备103可为内存对象缓存系统(即内存对象缓存系统实例)或NAS(Network Attached Storage,网络附属存储)等,本发明对此不作限定;当存储设备103为内存对象缓存系统时,本发明实施例也可将存储系统称为内存对象缓存系统集群。相应的,中间代理设备102可以是终端(即客户端),也可以是服务器,本发明对此不作限定。In an embodiment of the present invention, as shown in FIG. 1a, it relates to a storage system that supports link time-consuming analysis. The storage system includes at least one client (i.e., a terminal) 101, an intermediate proxy device (Router-server) 102, and at least one storage device 103. At least one storage device 103 constitutes a storage device cluster in the storage system, and the intermediate proxy device 102 can also be called an intermediate proxy layer; At least one storage device 103 is strung together to form a distributed cluster, thereby breaking through the memory bottleneck of a single storage device, and avoiding the cost of maintaining the storage device list on the user side (ie, the client 101 ). Wherein, the storage device 103 may be a memory object cache system (ie, a memory object cache system instance) or a NAS (Network Attached Storage, network attached storage), etc., which is not limited in the present invention; when the storage device 103 is a memory object cache system, the embodiment of the present invention may also refer to the storage system as a memory object cache system cluster. Correspondingly, the intermediate proxy device 102 may be a terminal (that is, a client) or a server, which is not limited in the present invention.

具体的,中间代理设备102可接收任一客户端101发送的请求(如数据访问请求),并将接收到的请求发送至相应存储设备103中;基于此,接收到请求的存储设备103可对相应请求进行执行,得到请求结果,并将该请求结果发送至中间代理设备102中;进一步的,中间代理设备102可将请求结果发送至相应客户端101中。可见,中间代理设备102属于存储设备103的中间件代理,使得任一客户端101的每次请求,都会通过中间代理设备102进行转发,并把存储设备103的请求结果,返回给相应客户端101。Specifically, the intermediate proxy device 102 can receive a request (such as a data access request) sent by any client 101, and send the received request to the corresponding storage device 103; based on this, the storage device 103 that receives the request can execute the corresponding request, obtain the request result, and send the request result to the intermediate proxy device 102; further, the intermediate proxy device 102 can send the request result to the corresponding client 101. It can be seen that the intermediate proxy device 102 belongs to the middleware proxy of the storage device 103, so that each request of any client 101 will be forwarded by the intermediate proxy device 102, and the request result of the storage device 103 will be returned to the corresponding client 101.

需要说明的是,如图1b所示,存储系统还可包括各个存储设备103对应的实例代理设备104,一个实例代理设备104可支持监听捕获中间代理设备102的信息,以用于检测相应存储设备103所接收以及发出的报文。其中,实例代理设备104可以是终端,也可以是服务器,本发明对此不作限定。It should be noted that, as shown in FIG. 1b, the storage system may also include instance proxy devices 104 corresponding to each storage device 103, and one instance proxy device 104 may support monitoring and capturing information of the intermediate proxy device 102, so as to detect messages received and sent by the corresponding storage device 103. Wherein, the example proxy device 104 may be a terminal or a server, which is not limited in the present invention.

需要说明的是,此处所提及的终端可以包括但不限于:智能手机、平板电脑、笔记本电脑、台式计算机、智能手表、智能语音交互设备、智能家电、车载终端、飞行器,等等。此处所提及的服务器可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算(cloud computing)、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、CDN(Content DeliveryNetwork,内容分发网络)、以及大数据和人工智能平台等基础云计算服务的云服务器,等等。It should be noted that the terminals mentioned here may include, but are not limited to: smart phones, tablet computers, notebook computers, desktop computers, smart watches, smart voice interaction devices, smart home appliances, vehicle-mounted terminals, aircraft, and so on. The server mentioned here can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network, content distribution network), and big data and artificial intelligence platforms.

基于上述描述,本发明实施例提出一种链路耗时分析方法,该链路耗时分析方法可以由存储系统中的中间代理设备执行,该存储系统包括至少一个客户端、中间代理设备以及中间代理设备管理的存储设备集群;如图2所示,该链路耗时分析方法可包括以下步骤S201-S204:Based on the above description, an embodiment of the present invention proposes a link time-consuming analysis method. The link time-consuming analysis method may be executed by an intermediate proxy device in a storage system. The storage system includes at least one client, an intermediate proxy device, and a storage device cluster managed by the intermediate proxy device; as shown in FIG. 2, the link time-consuming analysis method may include the following steps S201-S204:

S201,在接收到目标客户端发送的数据访问请求时,将数据访问请求添加至第一队列中,并确定数据访问请求被添加至第一队列的入队时间,第一队列用于存放从客户端接收到的请求。S201. When receiving the data access request sent by the target client, add the data access request to the first queue, and determine the enqueue time when the data access request is added to the first queue, and the first queue is used to store requests received from the client.

其中,目标客户端为上述至少一个客户端中的任一客户端;应当理解的是,中间代理设备可接收至少一个客户端中各个客户端发送的请求,此处所提及的请求可以是读请求,也可以是写请求,本发明实施例对此不作限定。Wherein, the target client is any client in the above at least one client; it should be understood that the intermediate proxy device can receive the request sent by each client in the at least one client, and the request mentioned here can be a read request or a write request, which is not limited in the embodiment of the present invention.

相应的,上述目标客户端可向中间代理设备发送至少一个请求,那么上述数据访问请求为该至少一个请求中的任一请求。Correspondingly, the above-mentioned target client may send at least one request to the intermediate proxy device, then the above-mentioned data access request is any request in the at least one request.

S202,通过第一队列,将数据访问请求发送至存储设备集群包括的目标存储设备中,以使目标存储设备执行数据访问请求,得到数据访问请求的目标请求结果。S202. Send the data access request to the target storage device included in the storage device cluster through the first queue, so that the target storage device executes the data access request, and obtains a target request result of the data access request.

其中,目标存储设备为存储设备集群中的任一存储设备。应当理解的是,存储设备集群可包括至少一个分片,每个分片由一个存储设备组成,如图3a所示;基于此,中间代理设备可将数据访问请求发送至目标存储设备所组成的分片中。在一种具体实现中,存储设备可为内存对象缓存系统,在此种情况下,每个分片可由一个内存对象缓存系统实例组成。Wherein, the target storage device is any storage device in the storage device cluster. It should be understood that the storage device cluster may include at least one shard, and each shard is composed of a storage device, as shown in FIG. 3a; based on this, the intermediate proxy device may send a data access request to the shard formed by the target storage device. In a specific implementation, the storage device may be an in-memory object cache system, in this case, each slice may consist of one in-memory object cache system instance.

在本发明实施例中,中间代理设备可按照数据访问请求中的key(关键字)的哈希值,来映射转发到对应的存储设备;也就是说,数据访问请求可携带有关键字,那么中间代理设备可基于该关键字的哈希值,将数据访问请求映射转发到对应的存储设备(即目标存储设备)。在此种情况下,中间代理设备可将该关键字的哈希值所指示的存储设备,作为目标存储设备。可见,中间代理设备可将接收到的请求按照key进行hash(哈希)映射到不同的存储设备进行处理。In the embodiment of the present invention, the intermediate proxy device can map and forward the data access request to the corresponding storage device according to the hash value of the key (keyword) in the data access request; In this case, the intermediate proxy device may use the storage device indicated by the hash value of the keyword as the target storage device. It can be seen that the intermediate proxy device can hash (hash) map the received request to different storage devices according to the key for processing.

在其他实施例中,数据访问请求也可携带有存储设备标识,那么中间代理设备可从数据访问请求中确定出存储设备标识,并将确定出的存储设备标识所指示的存储设备作为目标存储设备,进而将数据访问请求发送至目标存储设备中。其中,存储设备标识可以是数字标识,也可以是字符标识等,本发明对此不作限定。In other embodiments, the data access request may also carry a storage device identifier, then the intermediate proxy device may determine the storage device identifier from the data access request, and use the storage device indicated by the determined storage device identifier as the target storage device, and then send the data access request to the target storage device. Wherein, the storage device identifier may be a digital identifier or a character identifier, which is not limited in the present invention.

在一种具体的实现中,中间代理设备可通过第一队列,将数据访问请求发送至第三队列中,第三队列用于存放待发送至存储设备的请求;进一步的,中间代理设备可采用第三队列,将数据访问请求发送至存储设备集群包括的目标存储设备中。其中,第一队列和第三队列之间可通过QDT(Queue-Dealer-Thread,内部队列处理线程)进行交互,该QDT可用于处理不同队列之间数据搬运的工作。In a specific implementation, the intermediate proxy device can send the data access request to the third queue through the first queue, and the third queue is used to store requests to be sent to the storage device; further, the intermediate proxy device can use the third queue to send the data access request to the target storage device included in the storage device cluster. Among them, the first queue and the third queue can interact through QDT (Queue-Dealer-Thread, internal queue processing thread), and the QDT can be used to handle the work of data transfer between different queues.

S203,接收目标存储设备返回的目标请求结果,将目标请求结果添加至第二队列中,并确定目标请求结果从第二队列中出来以被发送至目标客户端的出队时间,第二队列用于存放待发送至客户端的请求结果。S203. Receive the target request result returned by the target storage device, add the target request result to the second queue, and determine the dequeue time for the target request result to come out of the second queue to be sent to the target client, and the second queue is used to store the request result to be sent to the client.

需要说明的是,在中间代理设备与客户端交互的过程中,中间代理设备可通过CDT(Client-Dealer-Thread,客户端交互线程)与客户端进行交互,也就是说,该CDT可用于处理中间代理设备和用户请求交互部分的操作;具体的,中间代理设备可通过CDT接收客户端发送的请求(如接收目标客户端发送的数据访问请求),且中间代理设备可通过CDT将请求结果发送至客户端(如将目标请求结果发送至目标客户端)。It should be noted that, in the process of interaction between the intermediate proxy device and the client, the intermediate proxy device can interact with the client through CDT (Client-Dealer-Thread, client-side interactive thread), that is, the CDT can be used to process the operation of the interaction part between the intermediate proxy device and the user request; specifically, the intermediate proxy device can receive the request sent by the client through the CDT (such as receiving the data access request sent by the target client), and the intermediate proxy device can send the request result to the client through the CDT (such as sending the target request result to the target client).

相应的,在中间代理设备与存储设备交互的过程中,中间代理设备可通过SDT(Server-Dealer-Thread,服务端交互线程)与存储设备进行交互,也就是说,该SDT可用于处理中间代理设备和存储设备交互部分的操作;具体的,中间代理设备可通过SDT向存储设备发送请求(如向目标存储设备发送数据访问请求),且中间代理设备可通过SDT接收存储设备发送的请求结果(如接收目标存储设备发送的目标请求结果)。Correspondingly, in the process of interaction between the intermediate proxy device and the storage device, the intermediate proxy device can interact with the storage device through SDT (Server-Dealer-Thread, server-side interactive thread), that is, the SDT can be used to process the operation of the interaction between the intermediate proxy device and the storage device; specifically, the intermediate proxy device can send a request to the storage device through the SDT (such as sending a data access request to the target storage device), and the intermediate proxy device can receive the request result sent by the storage device through the SDT (such as receiving the target request result sent by the target storage device).

需要说明的是,存储设备包括的中间代理设备的数量可为至少一个,在此种情况下,每个中间代理设备均可通过CDT与存储系统中的各个客户端进行交互,且每个中间代理设备均可通过SDT与存储系统中的各个存储设备进行交互。为了便于阐述,后续均以存储系统包括一个中间代理设备为例进行说明。It should be noted that the storage device may include at least one intermediate proxy device. In this case, each intermediate proxy device can interact with each client in the storage system through the CDT, and each intermediate proxy device can interact with each storage device in the storage system through the SDT. For ease of illustration, the following descriptions will be made by taking the storage system including an intermediate proxy device as an example.

在一种具体的实现中,在将目标请求结果添加至第二队列中时,中间代理设备可将目标请求结果添加至第四队列中,第四队列用于存放从存储设备接收到的请求结果;进一步的,可通过第四队列,将目标请求结果发送至第二队列中,以使目标请求结果被添加至第二队列中。In a specific implementation, when adding the target request result to the second queue, the intermediate proxy device may add the target request result to the fourth queue, and the fourth queue is used to store the request result received from the storage device; further, the target request result may be sent to the second queue through the fourth queue, so that the target request result is added to the second queue.

基于此,用户发送的请求可被CDT接收,并进入到中间代理设备中的第一队列进行排队,该第一队列也可称为queue-1(队列-1);然后,中间代理设备可通过QDT取出第一队列中队头的请求,然后插入到第三队列的队尾,第三队列也可称为queue-2;相应的,中间代理设备可将第三队列队头出队的请求通过SDT转发到相应的存储设备,使得存储设备对接收到的请求进行处理,得到相应的请求结果,那么中间代理设备可通过SDT从存储设备接收请求结果(即存储设备处理的返回结果),并插入到第四队列的队尾,第四队列也可称为queue-3;基于此,中间代理设备可取出第四队列队头的请求结果并将其由QDT处理进入到第二队列的队尾,从而通过CDT将第二队列队头出来的请求结果返回给客户端,第二队列也可称为queue-4。应当理解的是,中间代理设备通过上述四个队列分别存放与一个设备(如客户端或存储设备)进行交互的数据,如第一队列用于存储中间代理设备与客户端之间的交互所涉及的请求,第三队列用于存储中间代理设备与存储设备之间的交互所涉及的请求,可避免请求的发送者与接收者之间的耦合关系,从而使得中间代理设备与客户端之间的交互过程,与中间代理设备与存储设备之间的交互过程互不影响,进而节约传输时间。Based on this, the request sent by the user can be received by CDT, and enter the first queue in the intermediate proxy device for queuing. The first queue can also be called queue-1 (queue-1); then, the intermediate proxy device can take out the request of the head of the first queue through QDT, and then insert it into the tail of the third queue. , then the intermediate proxy device can receive the request result from the storage device (i.e. the return result processed by the storage device) through SDT, and insert it into the tail of the fourth queue, which can also be called queue-3; based on this, the intermediate proxy device can take out the request result from the head of the fourth queue and process it into the tail of the second queue, so that the request result from the head of the second queue can be returned to the client through CDT, and the second queue can also be called queue-4. It should be understood that the intermediate proxy device respectively stores data interacting with a device (such as a client or a storage device) through the above four queues. For example, the first queue is used to store requests involved in the interaction between the intermediate proxy device and the client, and the third queue is used to store requests involved in the interaction between the intermediate proxy device and the storage device, which can avoid the coupling relationship between the sender and the receiver of the request, so that the interaction process between the intermediate proxy device and the client and the interaction process between the intermediate proxy device and the storage device do not affect each other, thereby saving transmission time.

基于此,中间代理设备在接收到目标客户端发送的数据访问请求后,可将数据访问请求添加至第一队列中,并通过第一队列,将数据访问请求发送至第三队列中,并采用第三队列,将数据访问请求发送至存储设备集群包括的目标存储设备中;进一步的,中间代理设备可将目标存储设备返回的目标请求结果添加至第四队列中,并通过第四队列,将目标请求结果发送至第二队列中,从而通过第二队列,将目标请求结果发送至目标客户端。Based on this, after receiving the data access request sent by the target client, the intermediate proxy device can add the data access request to the first queue, and send the data access request to the third queue through the first queue, and use the third queue to send the data access request to the target storage device included in the storage device cluster; further, the intermediate proxy device can add the target request result returned by the target storage device to the fourth queue, and send the target request result to the second queue through the fourth queue, so as to send the target request result to the target client through the second queue.

S204,采用入队时间和出队时间,确定数据访问请求的中间层耗时结果。S204. Determine the time-consuming result of the middle layer of the data access request by using the queue entry time and the queue exit time.

在一种具体的实现中,中间代理设备可对入队时间和出队时间进行差值运算,得到差值运算结果,并将差值运算结果作为数据访问请求的中间层耗时结果,即中间代理设备可将出队时间与入队时间之间的差值,作为中间层耗时结果;在此种情况下,任一请求的中间层耗时结果是指:中间代理设备从接收到该任一请求起,到接收到该任一请求的请求结果为止所需的耗时时长。另一种具体的实现中,中间代理设备可将上述入队时间和出队时间,作为数据访问请求的中间层耗时结果,在此种情况下,中间层耗时结果可包括入队时间和出队时间,从而通过入队时间和出队时间来反映数据访问请求的耗时时长,等等。In a specific implementation, the intermediate agent device can perform a difference operation on the queue-entry time and the queue-exit time to obtain the difference operation result, and use the difference operation result as the intermediate layer time-consuming result of the data access request, that is, the intermediate agent device can use the difference between the queue-out time and the queue-entry time as the intermediate layer time-consuming result; In another specific implementation, the intermediate proxy device may use the above enqueue time and dequeue time as the time-consuming result of the intermediate layer for the data access request. In this case, the intermediate layer time-consuming result may include the enqueue time and the dequeue time, so that the time-consuming data access request is reflected by the enqueue time and the dequeue time, and so on.

在本发明实施例中,中间代理设备可包括M个队列组,M为正整数,一个队列组对应一个处理池(即池子,pool),也可称为池,且一个请求所涉及的数据均通过同一队列组中的各个队列进行传输(即一个请求所涉及的数据仅在同一处理池中进行处理),则第一队列和第二队列均为目标队列组中的队列,目标队列组为M个队列组中的任一队列组。应当理解的是,当第一队列和第二队列均为目标队列组中的队列时,与第一队列进行数据传输的第三队列,以及与第二队列进行数据传输的第四队列也为目标队列组中的队列。In the embodiment of the present invention, the intermediate proxy device may include M queue groups, where M is a positive integer, and a queue group corresponds to a processing pool (i.e., a pool), which may also be referred to as a pool, and the data involved in a request is transmitted through each queue in the same queue group (that is, the data involved in a request is only processed in the same processing pool), then the first queue and the second queue are both queues in the target queue group, and the target queue group is any queue group in the M queue groups. It should be understood that when both the first queue and the second queue are queues in the target queue group, the third queue that performs data transmission with the first queue and the fourth queue that performs data transmission with the second queue are also queues in the target queue group.

基于此,中间代理设备可接收多个请求,并将多个请求分发至M个队列组中的N个队列组对应的处理池,N为小于或等于M的正整数;相应的,可通过N个队列组中的各个队列组,对各个队列组中的请求进行并行处理,以通过相应存储设备并行地获取到多个请求的请求结果和中间层耗时结果。可见,本发明实施例可将多个请求尽可能拆分到不同队列组,从而充分利用多线程的处理优势,减少排队时长,并提高请求效率。Based on this, the intermediate proxy device can receive multiple requests and distribute the multiple requests to the processing pools corresponding to the N queue groups in the M queue groups, where N is a positive integer less than or equal to M; correspondingly, the requests in each queue group can be processed in parallel through each of the N queue groups, so that the request results of multiple requests and the time-consuming results of the intermediate layer can be obtained in parallel through the corresponding storage devices. It can be seen that the embodiment of the present invention can split multiple requests into different queue groups as much as possible, thereby making full use of the advantages of multi-thread processing, reducing the queuing time, and improving request efficiency.

示例性的,如图3b所示,中间代理设备与客户端或存储设备的交互,将被拆分成不同的池子(如池1、池2……池M),每个处理池可拆分为多个队列(如上述4个队列);其中,处理池的拆分逻辑可与中间代理设备所部署的配置参数有关,该配置参数可以为CPU(Central Processing Unit,中央处理器)核心或内存大小等,本发明对此不作限定。例如,若配置参数为4核/8GB,则可分配1个处理池;若配置参数为8核/16GB,则可分配2个处理池,等等。Exemplarily, as shown in Figure 3b, the interaction between the intermediate proxy device and the client or storage device will be split into different pools (such as pool 1, pool 2...pool M), and each processing pool can be split into multiple queues (such as the above-mentioned 4 queues); wherein, the splitting logic of the processing pool can be related to the configuration parameters deployed by the intermediate proxy device, and the configuration parameters can be CPU (Central Processing Unit, central processing unit) core or memory size, etc. For example, if the configuration parameter is 4 cores/8GB, 1 processing pool can be allocated; if the configuration parameter is 8 cores/16GB, 2 processing pools can be allocated, and so on.

本发明实施例可在中间代理设备接收到目标客户端发送的数据访问请求时,将数据访问请求添加至第一队列中,并确定数据访问请求被添加至第一队列的入队时间,第一队列用于存放从客户端接收到的请求;然后,中间代理设备可通过第一队列,将数据访问请求发送至存储设备集群包括的目标存储设备中,以使目标存储设备执行数据访问请求,得到数据访问请求的目标请求结果;基于此,中间代理设备在接收到目标存储设备返回的目标请求结果时,可将目标请求结果添加至第二队列中,并确定目标请求结果从第二队列中出来以被发送至目标客户端的出队时间,第二队列用于存放待发送至客户端的请求结果,从而采用入队时间和出队时间,确定数据访问请求的中间层耗时结果,使得基于中间代理设备构建的存储系统能够支持链路耗时分析。可见,本发明实施例可通过构建一个支持链路耗时分析的存储系统,以通过中间代理设备提供请求的链路耗时分析功能,即可实现对请求的链路耗时分析;并且,尤其是存储系统包括的存储设备为内存对象缓存系统时,可实现对访问存储系统中任一内存对象缓存系统的请求的链路耗时分析,以解决内存对象缓存系统不支持对相应请求的链路耗时分析的问题,从而解决包含内存对象缓存系统的存储系统所涉及的问题定位较慢,且分析手段能力不足等问题。In the embodiment of the present invention, when the intermediate proxy device receives the data access request sent by the target client, it can add the data access request to the first queue, and determine the enqueue time when the data access request is added to the first queue. The request result is added to the second queue, and the dequeue time for the target request result to be sent from the second queue to be sent to the target client is determined. The second queue is used to store the request result to be sent to the client, thereby using the enqueue time and dequeue time to determine the time-consuming result of the middle layer of the data access request, so that the storage system built based on the intermediate proxy device can support link time-consuming analysis. It can be seen that in the embodiment of the present invention, a storage system that supports link time-consuming analysis can be constructed to provide the requested link time-consuming analysis function through an intermediate proxy device, so that the requested link time-consuming analysis can be realized; and, especially when the storage device included in the storage system is a memory object caching system, link time-consuming analysis of requests to access any memory object caching system in the storage system can be implemented, so as to solve the problem that the memory object caching system does not support the link time-consuming analysis of the corresponding request, thereby solving the problems involved in the storage system that includes the memory object caching system. Insufficiency and other issues.

基于上述描述,本发明实施例还提出一种更为具体的链路耗时分析方法,该链路耗时分析方法可以由上述所提及的存储系统中的中间代理设备执行,存储系统包括至少一个客户端、中间代理设备以及中间代理设备管理的存储设备集群;请参见图4,该链路耗时分析方法可包括以下步骤S401-S404:Based on the above description, the embodiment of the present invention also proposes a more specific link time-consuming analysis method. The link time-consuming analysis method may be executed by the intermediate agent device in the storage system mentioned above. The storage system includes at least one client, the intermediate agent device and a storage device cluster managed by the intermediate agent device; please refer to FIG. 4, the link time-consuming analysis method may include the following steps S401-S404:

S401,在接收到目标客户端发送的数据访问请求时,将数据访问请求添加至第一队列中,并确定数据访问请求被添加至第一队列的入队时间,第一队列用于存放从客户端接收到的请求。S401. When receiving the data access request sent by the target client, add the data access request to the first queue, and determine the enqueue time when the data access request is added to the first queue, and the first queue is used to store requests received from the client.

在本发明实施例中,目标存储设备可包括至少一个探针组,任一探针组包括一个起始探针和至少一个终止探针,且在一次链路执行过程中,任一探针组中仅存在一个起始探针和一个终止探针被执行;其中,一个探针中设置有相应的探针标识,该探针标识可以是文本标识,也可以是数字标识(即特定参数),本发明对此不作限定。In the embodiment of the present invention, the target storage device may include at least one probe group, any probe group includes a start probe and at least one end probe, and during a link execution process, only one start probe and one end probe are executed in any probe group; wherein, a probe is provided with a corresponding probe identifier, and the probe identifier may be a text identifier or a digital identifier (that is, a specific parameter), which is not limited in the present invention.

S402,通过第一队列,将数据访问请求发送至存储设备集群包括的目标存储设备中,以使目标存储设备按照相应链路对数据访问请求进行执行,并在执行到至少一个探针组中的目标探针组时,对目标探针组中被执行到的目标起始探针中的探针标识,以及目标探针组中被执行到的目标终止探针中的探针标识进行打印。S402. Send the data access request to the target storage device included in the storage device cluster through the first queue, so that the target storage device executes the data access request according to the corresponding link, and when executing the target probe group in at least one probe group, print the probe ID of the target start probe executed in the target probe group and the probe ID of the target end probe executed in the target probe group.

其中,目标起始探针中的探针标识的打印时间和目标终止探针中的探针标识的打印时间用于:确定数据访问请求被按照目标探针组所监测的链路进行执行时的局部耗时结果。Wherein, the printing time of the probe ID in the target starting probe and the printing time of the probe ID in the target ending probe are used to determine the local time-consuming result when the data access request is executed according to the link monitored by the target probe group.

应当理解的是,当上述第一队列所在的目标队列组包括第三队列时,中间代理设备可通过第一队列,将数据访问请求发送至第三队列;进一步的,通过第三队列,将数据访问请求发送至存储设备集群包括的目标存储设备中,以使目标存储设备按照相应链路对数据访问请求进行执行,并在执行到至少一个探针组中的目标探针组时,对目标探针组中被执行到的目标起始探针中的探针标识,以及目标探针组中被执行到的目标终止探针中的探针标识进行打印。It should be understood that when the target queue group where the first queue is located includes the third queue, the intermediate proxy device can send the data access request to the third queue through the first queue; further, through the third queue, send the data access request to the target storage device included in the storage device cluster, so that the target storage device executes the data access request according to the corresponding link, and when executing the target probe group in at least one probe group, identify the probes in the target start probes executed in the target probe group and the probes in the target termination probes executed in the target probe group to print.

需要说明的是,每条用户命令(即请求)在存储设备内部的处理过程实际是分为多个过程,该过程包括但不限于:发送命令、解析命令、执行命令以及返回结果,等等;因此,当慢查询请求(即慢查询,slowlog)出现时,通常不能有效定位原因,仅能感知到存储设备的响应时长增大,如无法确认是连接处理不过来,还是请求解析耗时变大、命令阻塞或者性能不足等原因。其中,当存储系统处理请求的速度慢到一定程度的时候,会成为慢查询,拖慢整个存储系统的处理速度。It should be noted that the processing process of each user command (that is, request) inside the storage device is actually divided into multiple processes, which include but are not limited to: sending commands, parsing commands, executing commands, and returning results, etc.; therefore, when slow query requests (ie slow queries, slowlog) appear, usually the cause cannot be effectively located, and the response time of the storage device can only be sensed. Among them, when the processing speed of the storage system is slow to a certain extent, it will become a slow query, slowing down the processing speed of the entire storage system.

基于此,需要在各个阶段内都能获取到具体耗时;在本发明实施例中,存储设备被进行了二次开发改造,即存储系统中的存储设备可为定制化开发后的存储设备。相应的,可通过eBPF(Extended Berkeley Packet Filter,一种在内核事件和用户程序事件发生时安全注入代码的机制的扩展)技术在核心关键链路设置USDT(Userland Statically DefinedTracing)探针(一种基于eBPF技术的探针),eBPF技术可将原本单一的数据包过滤时间扩展到内核态函数、用户态函数、跟踪点、性能事件以及安全控制等;也就是说,可通过依赖USDT探针,在存储设备源码埋入特征代码,并编译到程序中,即定制化开发后的存储设备中至少一个链路可被相应的探针组监测。具体的,存储设备中需要植入探针的地方可加入DTRACE_PROBE以及DTRACE_PROBE1宏,用来标记需要触发耗时结果统计的代码区域,该代码区域也可称为执行程序、链路或函数阶段。可选的,部署的存储设备的内核版本可不低于预设版本,如4.18等,本发明对预设版本的具体取值不作限定。在其他实施例中,也可通过BPF技术对存储设备进行探针设置,等等;本发明对此不作限定。Based on this, it is necessary to obtain the specific time-consuming in each stage; in the embodiment of the present invention, the storage device has undergone secondary development and transformation, that is, the storage device in the storage system can be a customized developed storage device. Correspondingly, eBPF (Extended Berkeley Packet Filter, an extension of the mechanism for safely injecting code when kernel events and user program events occur) technology can be used to set USDT (Userland Statically Defined Tracing) probes (a probe based on eBPF technology) on core key links. The source code is embedded in the feature code and compiled into the program, that is, at least one link in the customized storage device can be monitored by the corresponding probe set. Specifically, DTRACE_PROBE and DTRACE_PROBE1 macros can be added to the place where the probe needs to be implanted in the storage device to mark the code area that needs to trigger time-consuming result statistics. The code area can also be called the execution program, link or function stage. Optionally, the kernel version of the deployed storage device may not be lower than a preset version, such as 4.18, and the specific value of the preset version is not limited in the present invention. In other embodiments, BPF technology may also be used to perform probe settings on the storage device, etc.; the present invention is not limited thereto.

示例性的,存储设备中的conn_new_command(接受新命令),conn_waiting(等待网络数据),conn_read(数据读取),conn_parse_cmd(命令解析),conn_write(写数据到消息缓冲),conn_mwrite(向router-server写数据),conn_closing(关闭连接)等关键链路上都可加入有USDT探针,从而在按照相应链路对数据访问请求进行执行时,可对链路所涉及的探针中的探针标识进行打印,等等。Exemplarily, conn_new_command (accepting new commands), conn_waiting (waiting for network data), conn_read (data reading), conn_parse_cmd (command parsing), conn_write (writing data to message buffer), conn_mwrite (writing data to router-server), conn_closing (closing connection) and other key links in the storage device can add USDT probes, so that data access requests can be executed according to the corresponding link , the probe IDs in the probes involved in the link can be printed, etc.

在具体的实现中,存储设备在对目标探针组中被执行到的目标起始探针中的探针标识,以及目标探针组中被执行到的目标终止探针中的探针标识进行打印时,可通过在存储设备外部加载特定的内核脚本,以在存储设备内部执行到目标探针组时,将目标起始探针中的探针标识和目标终止探针中的探针标识从内核脚本中打印出来,从而获取到目标探针组所监测的链路的处理耗时(即局部耗时结果)。In a specific implementation, when the storage device prints the probe IDs in the target start probes executed in the target probe group and the probe IDs in the target end probes executed in the target probe group, a specific kernel script can be loaded outside the storage device, so that when the target probe group is executed inside the storage device, the probe IDs in the target start probes and the probe IDs in the target end probes are printed out from the kernel script, thereby obtaining the processing time of the link monitored by the target probe group (that is, the local time-consuming result).

在本发明实施例中,数据访问请求被按照目标探针组所监测的链路进行执行时的局部耗时结果可以包括:目标起始探针中的探针标识的打印时间和目标终止探针中的探针标识的打印时间,也可以包括:目标终止探针中的探针标识的打印时间,与目标起始探针中的探针标识的打印时间之差,等等;本发明对此不作限定。其中,目标终止探针为目标探针组中的任一终止探针。In the embodiment of the present invention, the local time-consuming results when the data access request is executed according to the link monitored by the target probe group may include: the printing time of the probe ID in the target start probe and the printing time of the probe ID in the target end probe, and may also include: the printing time of the probe ID in the target end probe, and the printing time difference between the probe ID in the target start probe, etc.; the present invention is not limited to this. Wherein, the target termination probe is any termination probe in the target probe group.

S403,接收目标存储设备返回的目标请求结果,将目标请求结果添加至第二队列中,并确定目标请求结果从第二队列中出来以被发送至目标客户端的出队时间,第二队列用于存放待发送至客户端的请求结果。S403. Receive the target request result returned by the target storage device, add the target request result to the second queue, and determine the dequeue time for the target request result to come out of the second queue to be sent to the target client, and the second queue is used to store the request result to be sent to the client.

S404,采用入队时间和出队时间,确定数据访问请求的中间层耗时结果。S404. Determine the time-consuming result of the middle layer of the data access request by using the queue entry time and the queue exit time.

在本发明实施例中,中间代理设备可对数据访问请求的中间层耗时结果进行存储。在一种实施方式中,中间代理设备可将中间层耗时结果存储至第一耗时数据中,以在第一耗时数据中添加一条包括中间层耗时结果的存储数据,且第一耗时数据包括中间代理设备接收到的各个请求的中间层耗时结果。In the embodiment of the present invention, the intermediate proxy device may store the time-consuming result of the intermediate layer of the data access request. In one embodiment, the intermediate agent device may store the time-consuming result of the intermediate layer in the first time-consuming data, so as to add a piece of stored data including the time-consuming result of the intermediate layer to the first time-consuming data, and the first time-consuming data includes the time-consuming result of the intermediate layer of each request received by the intermediate agent device.

另一种实施方式中,若中间层耗时结果对应时长大于第一预设时长,则可将中间层耗时结果存储至第二耗时数据中,以在第二耗时数据中添加一条包括中间层耗时结果的存储数据,且第二耗时数据包括至少一个第一慢查询请求中每个第一慢查询请求的中间层耗时结果,第一慢查询请求是指中间层耗时结果对应时长大于第一预设时长的请求;其中,第一预设时长可以是500ms(毫秒)或600sm等,本发明对此不作限定。In another embodiment, if the time-consuming result of the middle layer is longer than the first preset duration, the time-consuming result of the middle layer can be stored in the second time-consuming data, so as to add a piece of stored data including the time-consuming result of the middle layer to the second time-consuming data, and the second time-consuming data includes the time-consuming result of the middle layer of each first slow query request in at least one first slow query request. sm etc., the present invention is not limited to this.

又一种实施方式中,若中间层耗时结果对应时长大于第二预设时长,则将数据访问请求存储至慢查询数据中,以在慢查询数据中添加一条包括数据访问请求的存储数据,且慢查询数据包括至少一个第二慢查询请求,第二慢查询请求是指中间层耗时结果对应时长大于第二预设时长的请求,等等;其中,第二预设时长可以是500ms或600ms等,且第二预设时长可以与第一预设时长相同,也可以与第一预设时长不同,本发明对此不作限定。In yet another embodiment, if the corresponding duration of the time-consuming result of the middle layer is longer than the second preset duration, the data access request is stored in the slow query data to add a piece of stored data including the data access request to the slow query data, and the slow query data includes at least one second slow query request, and the second slow query request refers to a request whose corresponding duration of the time-consuming result of the middle layer is longer than the second preset duration, etc.; wherein, the second preset duration can be 500ms or 600ms, etc. The duration is different, which is not limited in the present invention.

其中,若中间层耗时结果是由两个时间点进行表示的,则中间层耗时结果对应时长为中间层耗时结果中的两个时间点之间的差值;若中间层耗时结果为两个时间点之间的差值,则中间层耗时结果对应时长即为中间层耗时结果本身。Among them, if the time-consuming result of the middle layer is represented by two time points, the corresponding duration of the time-consuming result of the middle layer is the difference between the two time points in the time-consuming result of the middle layer; if the time-consuming result of the middle layer is the difference between the two time points, the corresponding duration of the time-consuming result of the middle layer is the time-consuming result of the middle layer itself.

需要说明的是,一个处理池中的各个队列均可具有相应的耗时埋点,在此种情况下,对于一个处理池中的每个队列,中间代理设备可记录数据访问请求所涉及的数据(即数据访问请求或目标请求结果)在各个队列的入队时间戳(即入队时间)和出队时间戳(即出队时间),从而得到数据访问请求的中间层耗时结果(如目标请求结果针对第二队列的出队时间减去数据访问请求针对第一队列的入队时间的结果),该中间层耗时结果也可称为client-cost(客户端耗时)。It should be noted that each queue in a processing pool can have a corresponding time-consuming buried point. In this case, for each queue in a processing pool, the intermediate proxy device can record the data involved in the data access request (that is, the data access request or the target request result) in each queue. Enqueue timestamp (ie, queue entry time) and queue exit timestamp (ie, queue exit time), so as to obtain the intermediate layer time-consuming result of the data access request (such as the result of the dequeue time of the target request result for the second queue minus the data access request for the first queue. The result of the queue time) , the time-consuming result of the middle layer can also be called client-cost (client-cost).

相应的,针对第一耗时数据和第二耗时数据中的任一存储数据,该任一存储数据包括的内容可为:[时间戳,client-ip(Internet Protocol,网络之间互连的协议),存储设备-ip,请求(如数据访问请求),发送字节数大小,返回字节数大小,第一队列的耗时,第二队列的耗时,第三队列的耗时,第四队列的耗时,中间层耗时结果];或者,该任一存储数据包括的内容可为:[client-ip,存储设备-ip,请求,中间层耗时结果,中间代理设备-ip],等等;本发明对存储数据包括的具体内容不作限定。同时,针对慢查询数据中的任一存储数据,该任一存储数据包括的内容可为:[client-ip,存储设备-ip,第二慢查询请求];或者,该任一存储数据包括的内容可为:[client-ip,存储设备-ip,第二慢查询请求,中间层耗时结果],等等;本发明对此不作限定。其中,client-ip即为客户端的ip,存储设备-ip为处理相应请求的存储设备的ip。Correspondingly, for any stored data in the first time-consuming data and the second time-consuming data, the content included in the stored data may be: [time stamp, client-ip (Internet Protocol, protocol for interconnection between networks), storage device-ip, request (such as data access request), size of sent bytes, size of returned bytes, time-consuming of the first queue, time-consuming of the second queue, time-consuming of the third queue, time-consuming of the fourth queue, time-consuming result of the middle layer]; or, the content of any stored data may be: [client -ip, storage device-ip, request, intermediate layer time-consuming result, intermediate proxy device-ip], etc.; the present invention does not limit the specific content included in the stored data. At the same time, for any stored data in the slow query data, the content included in the stored data may be: [client-ip, storage device-ip, second slow query request]; or, the content included in any stored data may be: [client-ip, storage device-ip, second slow query request, intermediate layer time-consuming result], etc.; the present invention is not limited to this. Wherein, client-ip is the ip of the client, and storage device-ip is the ip of the storage device processing the corresponding request.

应当理解的是,若中间代理设备是按照第二耗时数据和慢查询数据进行数据存储时,当且仅当数据访问请求为慢查询请求(如第一慢查询请求或第二慢查询请求)时,中间代理设备可生成数据访问请求的待存储数据,并对待存储数据进行存储。It should be understood that if the intermediate proxy device stores data according to the second time-consuming data and slow query data, if and only if the data access request is a slow query request (such as the first slow query request or the second slow query request), the intermediate proxy device can generate the data to be stored for the data access request, and store the data to be stored.

在一种实施方式中,中间代理设备可将目标存储数据存储至中间代理设备的日志中,目标存储数据为第一耗时数据、第二耗时数据以及慢查询数据中的任一数据;在此种情况下,中间代理设备在需对数据访问请求的待存储数据进行存储时,可对该待存储数据所需包括的内容进行序列化处理,得到待存储数据,并将待存储数据发送至中间代理设备的日志线程(Log-Collector-Thread,LCT),以将待存储数据存储至中间代理设备的日志中,使得目标存储数据包括该待存储数据。示例性的,若存储数据包括慢查询请求和中间代理设备的ip(即中间代理设备标识),且数据访问请求为慢查询请求,则中间代理设备可对数据访问请求和中间代理设备的ip进行序列化处理;可选的,中间代理设备可通过UDP(UserDatagram Protocol,用户数据报协议)通信方式发送给LCT,如图5所示。In one embodiment, the intermediate proxy device can store the target storage data in the log of the intermediate proxy device, and the target storage data is any data in the first time-consuming data, the second time-consuming data, and the slow query data; in this case, when the intermediate proxy device needs to store the data to be stored in the data access request, it can serialize the content that the data to be stored needs to include, obtain the data to be stored, and send the data to be stored to the log thread (Log-Collector-Thread, LCT) of the intermediate proxy device to store the data to be stored to the intermediate proxy device In the log, the target storage data includes the data to be stored. Exemplary, if the stored data includes the ip (i.e. the intermediate proxy device identification) of the slow query request and the intermediate proxy device, and the data access request is a slow query request, then the intermediate proxy device can serialize the data access request and the ip of the intermediate proxy device; optionally, the intermediate proxy device can be sent to the LCT by UDP (UserDatagram Protocol, User Datagram Protocol) communication mode, as shown in Figure 5.

需要说明的是,当中间代理设备通过客户端交互线程将待存储数据发送至中间代理设备的日志线程时,CDT一旦将请求(即待存储数据)发出则可立刻返回,也就是说,可不再关注LCT是否接收或者处理完成的返回结果,可有效避免CDT因为等待结果返回而阻塞,从而避免阻塞用户请求(即客户端发送的请求)。It should be noted that when the intermediate proxy device sends the data to be stored to the log thread of the intermediate proxy device through the client interaction thread, once the CDT sends the request (that is, the data to be stored), it can return immediately. That is to say, it can no longer pay attention to whether the LCT receives or returns the result after processing, which can effectively prevent the CDT from blocking due to waiting for the result to return, thereby avoiding blocking the user request (that is, the request sent by the client).

另一种实施方式中,中间代理设备可将目标存储数据存储在本地空间中的数据列表(list)中,在此种情况下,中间代理设备在需对数据访问请求的待存储数据进行存储时,可将待存储数据添加至数据列表中,以使目标存储数据包括待存储数据。相应的,中间代理设备可包括运维接口,那么运维人员可通过该运维接口对目标存储数据进行查看;可选的,运维人员在具有查看权限时,可对目标存储数据进行查看,且中间代理设备可通过用户名、密码以及ip等进行查看权限的鉴定。In another embodiment, the intermediate proxy device can store the target storage data in a data list (list) in the local space. In this case, when the intermediate proxy device needs to store the data to be stored in the data access request, it can add the data to be stored to the data list, so that the target storage data includes the data to be stored. Correspondingly, the intermediate proxy device can include an operation and maintenance interface, so the operation and maintenance personnel can view the target storage data through the operation and maintenance interface; optionally, the operation and maintenance personnel can view the target storage data when they have the viewing authority, and the intermediate proxy device can use the user name, password, and ip to identify the viewing authority.

进一步的,中间代理设备可确定过期时长,并在检测到目标存储数据中任一存储数据的存储时长大于过期时长时,删除该任一存储数据,目标存储数据为第一耗时数据、第二耗时数据以及慢查询数据中的任一数据;其中,任一存储数据的存储时长是指存储时间与当前系统时间之间的差值。需要说明的是,该过期时长可以是10分钟,也可以是1小时等;本发明对此不作限定。Further, the intermediate proxy device can determine the expiration time, and delete any storage data when it detects that the storage time of any storage data in the target storage data is longer than the expiration time, and the target storage data is any one of the first time-consuming data, the second time-consuming data, and the slow query data; wherein, the storage time of any storage data refers to the difference between the storage time and the current system time. It should be noted that the expiration time may be 10 minutes, or 1 hour, etc.; the present invention is not limited thereto.

示例性的,假设过期时长为10分钟,且目标存储数据存储有至少一条慢查询请求的存储数据,如中间层耗时结果对应时长大于50ms的慢查询请求,那么当任一存储数据的存储时长大于10分钟时,中间代理设备可对该任一存储数据进行删除,使目标存储数据不再包括该任一存储数据。在此种情况下,当运维人员需要临时上线查询的时候,可以通过运维接口,获取最近10分钟内的慢查询请求,用于临时辅助排查线上最近的慢查询问题。Exemplarily, assuming that the expiration time is 10 minutes, and the target storage data stores at least one slow query request storage data, such as the time-consuming result of the intermediate layer corresponds to a slow query request with a duration greater than 50 ms, then when the storage duration of any storage data is longer than 10 minutes, the intermediate proxy device can delete any storage data, so that the target storage data no longer includes the any storage data. In this case, when the operation and maintenance personnel need to temporarily go online to query, they can obtain the slow query requests in the last 10 minutes through the operation and maintenance interface, and use it to temporarily assist in troubleshooting the latest slow query problems online.

在本发明实施例中,中间代理设备可对数据访问请求进行线上慢查询警示检测;进一步的,当数据访问请求为慢查询请求(如第一慢查询请求或第二慢查询请求等)时,中间代理设备可输出针对数据访问请求的慢查询警示信息,以对运维人员进行提示,该慢查询警示信息可以是音频信息,也可以是文本信息,本发明对此不作限定。可见,中间代理设备可具有慢查询自动记录功能,并可用于线上慢查询警示检测以及采集。In the embodiment of the present invention, the intermediate agent device can perform online slow query warning detection on the data access request; further, when the data access request is a slow query request (such as the first slow query request or the second slow query request, etc.), the intermediate agent device can output slow query warning information for the data access request to prompt the operation and maintenance personnel. The slow query warning information can be audio information or text information, which is not limited in the present invention. It can be seen that the intermediate proxy device can have the function of automatically recording slow queries, and can be used for online slow query warning detection and collection.

需要说明的是,在其他实施例中,也可不执行步骤S401中的确定数据访问请求被添加至第一队列的入队时间,并不执行步骤S403中的确定目标请求结果从第二队列中出来以被发送至目标客户端的出队时间,以及不执行步骤S404,也就是说,中间代理设备可不采用入队时间和出队时间,确定数据访问请求的中间层耗时结果,而是仅在目标存储设备对数据访问请求进行执行的过程中,由目标实例代理设备基于目标起始探针中的探针标识的打印时间和目标终止探针中的探针标识的打印时间,确定数据访问请求被按照目标探针组所监测的链路进行执行时的局部耗时结果,等等。It should be noted that, in other embodiments, the determination of the enqueue time of the data access request being added to the first queue in step S401 may not be performed, the dequeue time of determining the target request result from the second queue to be sent to the target client in step S403 may not be performed, and step S404 may not be performed. The device determines the local time-consuming result when the data access request is executed according to the link monitored by the target probe set based on the print time of the probe ID in the target start probe and the print time of the probe ID in the target end probe, and so on.

本发明实施例可在中间代理设备接收到目标客户端发送的数据访问请求时,将数据访问请求添加至第一队列中,并确定数据访问请求被添加至第一队列的入队时间;然后,通过第一队列,将数据访问请求发送至存储设备集群包括的目标存储设备中,以使目标存储设备按照相应链路对数据访问请求进行执行,并在执行到至少一个探针组中的目标探针组时,对目标探针组中被执行到的目标起始探针中的探针标识,以及目标探针组中被执行到的目标终止探针中的探针标识进行打印;基于此,可通过目标起始探针中的探针标识的打印时间和目标终止探针中的探针标识的打印时间,获取到存储设备内部运行相应链路的耗时等状态,使得存储设备内部不再对运维人员是黑盒,从而便于耗时问题追踪分析,也就是说,可使得运维人员按需捕获存储设备中关键链路的局部耗时结果。进一步的,中间代理设备可在接收到目标存储设备返回的目标请求结果时,将目标请求结果添加至第二队列中,并确定目标请求结果从第二队列中出来以被发送至目标客户端的出队时间,从而采用入队时间和出队时间,确定数据访问请求的中间层耗时结果;进一步的,可基于中间层耗时结果对数据访问请求所涉及的待存储数据进行存储,从而使运维人员可对一定时间范围内的存储数据进行查询,以便于运维人员对存储设备的状态进行分析。并且,中间代理设备还可对慢查询请求进行监测,以输出慢查询警示信息,从而提升慢查询问题的感知能力。In the embodiment of the present invention, when the intermediate proxy device receives the data access request sent by the target client, it can add the data access request to the first queue, and determine the enqueue time when the data access request is added to the first queue; then, through the first queue, send the data access request to the target storage device included in the storage device cluster, so that the target storage device executes the data access request according to the corresponding link, and when the target probe group in at least one probe group is executed, the probe identifier in the target initial probe that is executed in the target probe group and the probe ID that is executed in the target probe group The probe ID in the target termination probe is printed; based on this, the time-consuming state of running the corresponding link inside the storage device can be obtained through the printing time of the probe ID in the target start probe and the printing time of the probe ID in the target termination probe, so that the storage device is no longer a black box for the operation and maintenance personnel, which facilitates the tracking and analysis of time-consuming problems. That is to say, the operation and maintenance personnel can capture the local time-consuming results of key links in the storage device on demand. Further, when receiving the target request result returned by the target storage device, the intermediate proxy device can add the target request result to the second queue, and determine the dequeue time for the target request result to be sent to the target client from the second queue, thereby using the enqueue time and dequeue time to determine the time-consuming result of the middle layer of the data access request; further, the data to be stored involved in the data access request can be stored based on the time-consuming result of the middle layer, so that the operation and maintenance personnel can query the stored data within a certain time range, so that the operation and maintenance personnel can query the storage device status is analyzed. Moreover, the intermediate proxy device can also monitor the slow query request to output slow query warning information, thereby improving the ability to perceive slow query problems.

基于上述描述,本发明实施例还提出一种更为具体的链路耗时分析方法,该链路耗时分析方法可以由上述所提及的存储系统中的目标实例代理设备执行,存储系统包括至少一个客户端、中间代理设备、中间代理设备管理的存储设备集群以及存储设备集群中各个存储设备对应的实例代理设备,目标实例代理设备支持监听捕获中间代理设备的信息,以用于检测目标存储设备所接收以及发出的报文,目标存储设备为存储设备集群中与目标实例代理设备相对应的存储设备;请参见图6,该链路耗时分析方法可包括以下步骤S601-S603:Based on the above description, the embodiment of the present invention also proposes a more specific link time-consuming analysis method. The link time-consuming analysis method can be executed by the target instance proxy device in the storage system mentioned above. The storage system includes at least one client, an intermediate proxy device, a storage device cluster managed by the intermediate proxy device, and an instance proxy device corresponding to each storage device in the storage device cluster. The target instance proxy device supports monitoring and capturing information of the intermediate proxy device for detecting messages received and sent by the target storage device. The target storage device is a storage device in the storage device cluster corresponding to the target instance proxy device; Referring to FIG. 6, the link time consumption analysis method may include the following steps S601-S603:

S601,在检测到目标存储设备接收到数据访问请求中的第一报文数据时,记录第一报文数据的接收时间,数据访问请求包括至少一个报文数据,且第一报文数据的接收时间,早于至少一个报文数据中除第一报文数据以外的任一报文数据的接收时间。S601. When it is detected that the target storage device receives the first message data in the data access request, record the receiving time of the first message data, the data access request includes at least one message data, and the receiving time of the first message data is earlier than the receiving time of any message data except the first message data in the at least one message data.

应当理解的是,中间代理设备只能统计到中间层的中间层耗时结果,但考虑到中间代理设备到存储设备层面还涉及到网络传输开销,因而需要进一步抛开网络传输影响,去获取到存储设备底层命令处理的真实耗时结果,而业界往往是通过使用类似tcpdump或者wireshark之类的工具进行TCP(Transmission Control Protocol,传输控制协议)报文捕获再进行分析,工作繁琐且分析不便。在本发明实施例中,可通过存储设备对应的实例代理设备(perf-agent),捕获每个请求在存储设备的响应时间(即实例层耗时结果),以此支撑运维层面的统计及分析。需要说明的是,一个存储设备对应的实例代理设备可以位于相应存储设备上(即存储设备上还部署有实例代理设备),也可以位于相应存储设备之外,本发明对此不作限定。It should be understood that the intermediate proxy device can only count the time-consuming results of the intermediate layer. However, considering the network transmission overhead from the intermediate proxy device to the storage device level, it is necessary to further ignore the influence of network transmission to obtain the real time-consuming results of the underlying command processing of the storage device. However, the industry often uses tools such as tcpdump or wireshark to capture and analyze TCP (Transmission Control Protocol) messages, which is cumbersome and inconvenient. In the embodiment of the present invention, the response time of each request in the storage device (that is, the time-consuming result of the instance layer) can be captured through the instance agent device (perf-agent) corresponding to the storage device, so as to support statistics and analysis at the operation and maintenance level. It should be noted that the instance proxy device corresponding to a storage device may be located on the corresponding storage device (that is, the instance proxy device is also deployed on the storage device), or it may be located outside the corresponding storage device, which is not limited in the present invention.

在本发明实施例中,一个实例代理设备可以是通过依赖libpcap(一个unix/linux操作系统下的网络数据包捕获函数包)而开发的独立perf-agent(一个基于libpcap技术实现的agent),且每个存储设备对应一个实例代理设备,该libpcap提供了系统独立的用户级别网络数据包捕获接口,并充分考虑到应用程序的可移植性,以使得实例代理设备可分析对应托管的存储设备和每条存储设备命令(即存储设备所需处理的请求)的实例层耗时结果。其中,实例代理设备可基于libpcap,启动主线程,并单独监听捕获中间代理设备的信息,以用于获取存储设备进程所接收以及发出的TCP报文,也就是说,实例代理设备可用于监听捕获相应存储设备端口接收/发出的报文,以感知存储设备层面的延迟。In the embodiment of the present invention, an instance agent device can be an independent perf-agent (an agent realized based on libpcap technology) developed by relying on libpcap (a network packet capture function package under a unix/linux operating system), and each storage device corresponds to an instance agent device. The time-consuming result of the instance layer of the request). Among them, the instance proxy device can start the main thread based on libpcap, and separately monitor and capture the information of the intermediate proxy device to obtain the TCP messages received and sent by the storage device process.

在具体的实现中,存储设备所收到的请求可被拆分成至少一个报文数据,且由于一个存储设备收到的请求通常是海量级别的,因此实例代理设备在统计存储设备的单个请求处理时长时,实例代理设备可维护一个哈希表,以存放请求、第一报文数据的接收时间以及各个报文数据的响应报文的发出时间。其中,存储设备接收到的报文数据也可称为入包,且对于存储设备往外发的报文(即至少一个报文数据中任一报文数据的响应报文)也可称为出包。在其他实施例中,实例代理设备也可将请求、第一报文数据的接收时间以及各个报文数据的响应报文的发出时间存储至一个数组中,等等;本发明对此不作限定。In a specific implementation, the request received by the storage device can be split into at least one packet data, and since the requests received by a storage device are usually at the mass level, when the instance proxy device counts the processing time of a single request of the storage device, the instance proxy device can maintain a hash table to store the request, the receiving time of the first packet data, and the sending time of the response message of each packet data. Wherein, the packet data received by the storage device may also be called an incoming packet, and the outgoing packet (that is, a response packet to any packet data in at least one packet data) sent by the storage device may also be called an outgoing packet. In other embodiments, the instance proxy device may also store the request, the receiving time of the first message data, and the sending time of the response message of each message data in an array, etc.; the present invention is not limited thereto.

S602,在检测到至少一个报文数据中各个报文数据的响应报文被发出时,记录各个报文数据的响应报文被发出的发出时间,一个报文数据的响应报文为存储设备对相应报文数据的执行结果。S602. When it is detected that the response message of each message data in at least one message data is sent, record the sending time of the response message of each message data. The response message of one message data is the execution result of the corresponding message data by the storage device.

需要说明的是,上述各个报文数据的响应报文可构成数据访问请求的目标请求结果。应当理解的是,针对同一请求(如数据访问请求),当目标实例代理设备通过维护一个哈希表来存储数据时,目标存储设备每发出一个响应报文,目标实例代理设备则会更新发出时间,并可将原来的出包记录(即响应报文的发出时间)从哈希表中删除。It should be noted that the response packets of the above-mentioned packet data may constitute the target request result of the data access request. It should be understood that, for the same request (such as a data access request), when the target instance proxy device stores data by maintaining a hash table, each time the target storage device sends a response message, the target instance proxy device will update the sending time, and can delete the original packet output record (that is, the sending time of the response message) from the hash table.

示例性的,假设哈希表中记录的响应报文的发出时间为时间A,且在时间A之后的时间段内,目标实例代理设备又检测到目标存储设备在时间B时发出了一个响应报文,那么目标实例代理设备可将哈希表中的时间A更新为时间B。Exemplarily, assuming that the sending time of the response message recorded in the hash table is time A, and within a time period after time A, the target instance proxy device detects that the target storage device sends a response message at time B, then the target instance proxy device can update time A in the hash table to time B.

S603,采用第一报文数据的接收时间,以及第二报文数据的响应报文被发出的发出时间,确定数据访问请求的实例层耗时结果,第二报文数据的响应报文被发出的发出时间,晚于至少一个报文数据中其他报文数据的响应报文被发出的发出时间。S603. Using the receiving time of the first message data and the sending time of the response message of the second message data to determine the time-consuming result of the instance layer of the data access request, the sending time of the response message of the second message data is later than the sending time of the response messages of other message data in at least one message data.

基于此,目标实例代理设备可从目标存储设备收到中间代理设备发来的第一报文数据开始计算(IN,输入),直到目标存储设备给中间代理设备返回第二报文数据(即最后一个TCP报文)的响应报文(OUT,输出),两者(即第一报文数据的接收时间和第二报文数据的响应报文的发出时间)的时间差为真实的存储设备响应时间。Based on this, the target instance proxy device can start to calculate (IN, input) from the first message data that the target storage device receives from the intermediate proxy device, until the target storage device returns the response message (OUT, output) of the second message data (that is, the last TCP message) to the intermediate proxy device, and the time difference between the two (that is, the receiving time of the first message data and the sending time of the response message of the second message data) is the real storage device response time.

需要说明的是,目标实例代理设备可将第一报文数据的接收时间和第二报文数据的响应报文的发出时间,作为数据访问请求的实例层耗时结果,此时实例层耗时结果包括第一报文数据的接收时间和第二报文数据的响应报文的发出时间;也可将第一报文数据的接收时间和第二报文数据的响应报文的发出时间之间的差值,作为数据访问请求的实例层耗时结果(即上述真实的存储设备响应时间)。It should be noted that the target instance proxy device may use the receiving time of the first message data and the sending time of the response message of the second message data as the instance-level time-consuming result of the data access request. At this time, the instance-level time-consuming result includes the receiving time of the first message data and the sending time of the response message of the second message data.

在本发明实施例中,存储系统还可包括显示系统,目标实例代理设备可确定目标存储设备的存储设备标识,并对实例层耗时结果和存储设备标识进行序列化处理,得到序列化后的耗时数据;并将序列化后的耗时数据发送至显示系统中,以使显示系统对指定时间范围内的耗时数据进行显示。示例性的,该存储设备标识可以是存储设备的ip,等等。In the embodiment of the present invention, the storage system may further include a display system, and the target instance proxy device may determine the storage device identifier of the target storage device, and serialize the instance layer time-consuming result and the storage device identifier to obtain the serialized time-consuming data; and send the serialized time-consuming data to the display system, so that the display system can display the time-consuming data within a specified time range. Exemplarily, the storage device identifier may be the ip of the storage device, and so on.

具体的,显示系统在接收到序列化后的耗时数据后,可对接收到的耗时数据进行持久化存储;那么相应的,显示系统在检测到耗时数据查看请求时,可对指定时间范围内的耗时数据进行显示,且耗时数据查看请求可携带有相应的指定时间范围。Specifically, after the display system receives the serialized time-consuming data, it can persistently store the received time-consuming data; correspondingly, when the display system detects a time-consuming data viewing request, it can display the time-consuming data within a specified time range, and the time-consuming data viewing request can carry a corresponding specified time range.

进一步的,序列化后的耗时数据还可包括数据访问请求;在此种情况下,目标实例代理设备可从目标存储设备获取数据访问请求中的至少一个报文数据,以得到数据访问请求,从而对数据访问请求、实例层耗时结果以及目标存储设备的存储设备标识进行序列化处理,得到序列化后的耗时数据。Further, the serialized time-consuming data may also include a data access request; in this case, the target instance proxy device may obtain at least one message data in the data access request from the target storage device to obtain the data access request, thereby performing serialization processing on the data access request, the time-consuming result of the instance layer, and the storage device identifier of the target storage device to obtain the serialized time-consuming data.

可选的,上述显示系统可以包括开源的ElasticSearch(一种分布式搜索和分析引擎),以用于存储任一实例代理设备远程写入的序列化后的耗时数据,如图3a所示;在此种情况下,目标实例代理设备可将上述序列化后的耗时数据,远程写入到ElasticSearch存储介质中。相应的,上述显示系统还可包括kibana(一种开源的分析及可视化平台),基于此,运维人员可通过查看kibana,按照时间维度检索对应的存储设备集群的耗时波动详情,也就是说,可按照时间维度检索对应的存储设备集群所处理的各个请求的实例层耗时结果。Optionally, the above-mentioned display system may include an open-source ElasticSearch (a distributed search and analysis engine) for storing the serialized time-consuming data remotely written by any instance agent device, as shown in Figure 3a; in this case, the target instance agent device can remotely write the above-mentioned serialized time-consuming data into the ElasticSearch storage medium. Correspondingly, the above display system may also include kibana (an open-source analysis and visualization platform). Based on this, the operation and maintenance personnel can retrieve the time-consuming fluctuation details of the corresponding storage device cluster according to the time dimension by viewing kibana, that is, they can retrieve the instance-level time-consuming results of each request processed by the corresponding storage device cluster according to the time dimension.

本发明实施例可在目标实例代理设备检测到目标存储设备接收到数据访问请求中的第一报文数据时,记录第一报文数据的接收时间,数据访问请求包括至少一个报文数据,且第一报文数据的接收时间,早于至少一个报文数据中除第一报文数据以外的任一报文数据的接收时间;并且,在检测到至少一个报文数据中各个报文数据的响应报文被发出时,可记录各个报文数据的响应报文被发出的发出时间;那么相应的,可采用第一报文数据的接收时间,以及第二报文数据的响应报文被发出的发出时间,确定数据访问请求的实例层耗时结果,第二报文数据的响应报文被发出的发出时间,晚于至少一个报文数据中其他报文数据的响应报文被发出的发出时间。可见,目标实例代理设备可用于感知存储设备层面的实例层耗时结果,也就是说,本发明实施例可通过目标实例代理设备,实时获取目标存储设备接收到的每个请求的准确耗时结果,从而避免中间代理设备和存储设备之间的网络延迟较高时对耗时结果的影响;并且,目标实例代理设备可将序列化后的耗时数据发送至显示系统,以使显示系统对序列化后的耗时数据进行持久化存储,以便于运维人员按照时间维度对显示系统中的耗时数据进行检索。In the embodiment of the present invention, when the target instance proxy device detects that the target storage device has received the first message data in the data access request, it can record the receiving time of the first message data. The data access request includes at least one message data, and the receiving time of the first message data is earlier than the receiving time of any message data in the at least one message data except the first message data; and when it detects that the response message of each message data in the at least one message data is sent, it can record the sending time of the response message of each message data; then correspondingly, The receiving time of the first message data and the sending time of the response message of the second message data can be used to determine the time-consuming result of the instance layer of the data access request. The sending time of the response message of the second message data is later than the sending time of the response messages of other message data in at least one message data. It can be seen that the target instance proxy device can be used to perceive the time-consuming result of the instance layer at the storage device level. That is to say, the embodiment of the present invention can obtain the accurate time-consuming result of each request received by the target storage device in real time through the target instance proxy device, thereby avoiding the impact on the time-consuming result when the network delay between the intermediate proxy device and the storage device is high; and the target instance proxy device can send the serialized time-consuming data to the display system, so that the display system can persistently store the serialized time-consuming data, so that operation and maintenance personnel can view the time-consuming data in the display system according to the time dimension to search.

基于上述链路耗时分析方法的相关实施例的描述,本发明实施例还提出了一种链路耗时分析装置,该链路耗时分析装置可以是运行于电子设备中的一个计算机程序(包括程序代码),此处的电子设备是指:存储系统中的中间代理设备,该存储系统包括至少一个客户端、中间代理设备以及中间代理设备管理的存储设备集群;如图7a所示,该链路耗时分析装置可包括接收单元701、处理单元702以及发送单元703。该链路耗时分析装置可以执行图2或图4所示的链路耗时分析方法,即该链路耗时分析装置可以运行上述单元:Based on the description of the related embodiments of the above-mentioned link time-consuming analysis method, an embodiment of the present invention also proposes a link time-consuming analysis device. The link time-consuming analysis device may be a computer program (including program code) running on an electronic device, where the electronic device refers to an intermediate proxy device in a storage system, and the storage system includes at least one client, an intermediate proxy device, and a storage device cluster managed by the intermediate proxy device; as shown in FIG. The link time-consuming analysis device can execute the link time-consuming analysis method shown in Figure 2 or Figure 4, that is, the link time-consuming analysis device can run the above units:

处理单元702,用于在接收到目标客户端发送的数据访问请求时,将所述数据访问请求添加至第一队列中,并确定所述数据访问请求被添加至所述第一队列的入队时间,所述第一队列用于存放从客户端接收到的请求;The processing unit 702 is configured to add the data access request to the first queue when receiving the data access request sent by the target client, and determine the enqueue time when the data access request is added to the first queue, and the first queue is used to store requests received from the client;

发送单元703,用于通过所述第一队列,将所述数据访问请求发送至所述存储设备集群包括的目标存储设备中,以使所述目标存储设备执行所述数据访问请求,得到所述数据访问请求的目标请求结果,所述目标存储设备为所述存储设备集群中的任一存储设备;The sending unit 703 is configured to send the data access request to a target storage device included in the storage device cluster through the first queue, so that the target storage device executes the data access request to obtain a target request result of the data access request, and the target storage device is any storage device in the storage device cluster;

接收单元701,用于接收所述目标存储设备返回的所述目标请求结果;a receiving unit 701, configured to receive the target request result returned by the target storage device;

所述处理单元702,还用于将所述目标请求结果添加至第二队列中,并确定所述目标请求结果从所述第二队列中出来以被发送至所述目标客户端的出队时间,所述第二队列用于存放待发送至客户端的请求结果;The processing unit 702 is further configured to add the target request result to a second queue, and determine the dequeue time for the target request result to come out of the second queue to be sent to the target client, and the second queue is used to store the request result to be sent to the client;

所述处理单元702,还用于采用所述入队时间和所述出队时间,确定所述数据访问请求的中间层耗时结果。The processing unit 702 is further configured to determine the time-consuming result of the middle layer of the data access request by using the enqueue time and the dequeue time.

在一种实施方式中,发送单元703在通过所述第一队列,将所述数据访问请求发送至所述存储设备集群包括的目标存储设备时,可具体用于:In one embodiment, when the sending unit 703 sends the data access request to the target storage device included in the storage device cluster through the first queue, it may be specifically configured to:

通过所述第一队列,将所述数据访问请求发送至第三队列中,所述第三队列用于存放待发送至存储设备的请求;Send the data access request to a third queue through the first queue, and the third queue is used to store requests to be sent to the storage device;

采用所述第三队列,将所述数据访问请求发送至所述存储设备集群包括的目标存储设备中;Using the third queue, sending the data access request to a target storage device included in the storage device cluster;

处理单元702在将所述目标请求结果添加至第二队列中时,可具体用于:When the processing unit 702 adds the target request result to the second queue, it may be specifically configured to:

将所述目标请求结果添加至第四队列中,所述第四队列用于存放从存储设备接收到的请求结果;adding the target request result to a fourth queue, where the fourth queue is used to store the request result received from the storage device;

通过所述第四队列,将所述目标请求结果发送至所述第二队列中,以使所述目标请求结果被添加至所述第二队列中。Send the target request result to the second queue through the fourth queue, so that the target request result is added to the second queue.

另一种实施方式中,所述中间代理设备包括M个队列组,M为正整数,一个队列组对应一个处理池,且一个请求所涉及的数据均通过同一队列组中的各个队列进行传输,则所述第一队列和所述第二队列均为目标队列组中的队列,所述目标队列组为所述M个队列组中的任一队列组;接收单元701,还可用于:In another embodiment, the intermediate proxy device includes M queue groups, M is a positive integer, one queue group corresponds to one processing pool, and the data involved in a request is transmitted through each queue in the same queue group, then the first queue and the second queue are queues in the target queue group, and the target queue group is any queue group in the M queue groups; the receiving unit 701 can also be used for:

接收多个请求;receive multiple requests;

处理单元702,还可用于:The processing unit 702 can also be used for:

将所述多个请求分发至所述M个队列组中的N个队列组对应的处理池,N为小于或等于M的正整数;Distributing the multiple requests to processing pools corresponding to N queue groups in the M queue groups, where N is a positive integer less than or equal to M;

通过所述N个队列组中的各个队列组,对所述各个队列组中的请求进行并行处理,以通过相应存储设备并行地获取到所述多个请求的请求结果和中间层耗时结果。The requests in the respective queue groups are processed in parallel through each of the N queue groups, so that the request results and the time-consuming results of the middle layer of the multiple requests are obtained in parallel through corresponding storage devices.

另一种实施方式中,处理单元702,还可用于:In another implementation manner, the processing unit 702 may also be used to:

将所述中间层耗时结果存储至第一耗时数据中,以在所述第一耗时数据中添加一条包括所述中间层耗时结果的存储数据,且所述第一耗时数据包括所述中间代理设备接收到的各个请求的中间层耗时结果;或者,storing the time-consuming result of the intermediate layer in the first time-consuming data, so as to add a piece of stored data including the time-consuming result of the intermediate layer to the first time-consuming data, and the first time-consuming data includes the time-consuming result of the intermediate layer of each request received by the intermediate proxy device; or,

若所述中间层耗时结果对应时长大于第一预设时长,则将所述中间层耗时结果存储至第二耗时数据中,以在所述第二耗时数据中添加一条包括所述中间层耗时结果的存储数据,且所述第二耗时数据包括至少一个第一慢查询请求中每个第一慢查询请求的中间层耗时结果,第一慢查询请求是指中间层耗时结果对应时长大于所述第一预设时长的请求;或者,If the time-consuming result corresponding to the intermediate layer is longer than the first preset duration, store the time-consuming result of the intermediate layer in the second time-consuming data to add a piece of storage data including the time-consuming result of the intermediate layer to the second time-consuming data, and the second time-consuming data includes the time-consuming result of the intermediate layer for each first slow query request in at least one first slow query request, and the first slow query request refers to a request for which the corresponding duration of the time-consuming result of the intermediate layer is longer than the first preset duration; or,

若所述中间层耗时结果对应时长大于第二预设时长,则将所述数据访问请求存储至慢查询数据中,以在所述慢查询数据中添加一条包括所述数据访问请求的存储数据,且所述慢查询数据包括至少一个第二慢查询请求,第二慢查询请求是指中间层耗时结果对应时长大于所述第二预设时长的请求。If the corresponding duration of the time-consuming result of the middle layer is longer than the second preset duration, the data access request is stored in the slow query data to add a piece of stored data including the data access request to the slow query data, and the slow query data includes at least one second slow query request, and the second slow query request refers to a request whose corresponding duration of the time-consuming result of the middle layer is longer than the second preset duration.

另一种实施方式中,处理单元702,还可用于:In another implementation manner, the processing unit 702 may also be used to:

确定过期时长,并在检测到目标存储数据中任一存储数据的存储时长大于所述过期时长时,删除所述任一存储数据,所述目标存储数据为所述第一耗时数据、所述第二耗时数据以及所述慢查询数据中的任一数据;Determine the expiration time, and when it is detected that the storage time of any storage data in the target storage data is longer than the expiration time, delete the any storage data, and the target storage data is any data in the first time-consuming data, the second time-consuming data and the slow query data;

其中,所述任一存储数据的存储时长是指存储时间与当前系统时间之间的差值。Wherein, the storage duration of any stored data refers to the difference between the storage time and the current system time.

另一种实施方式中,目标存储设备包括至少一个探针组,任一探针组包括一个起始探针和至少一个终止探针,且在一次链路执行过程中,所述任一探针组中仅存在一个起始探针和一个终止探针被执行;其中,一个探针中设置有相应的探针标识;处理单元702在将所述数据访问请求发送至所述存储设备集群包括的目标存储设备中,以使所述目标存储设备执行所述数据访问请求,得到所述数据访问请求的目标请求结果时,可具体用于:In another embodiment, the target storage device includes at least one probe group, and any probe group includes a start probe and at least one stop probe, and during a link execution process, only one start probe and one stop probe are executed in any probe group; wherein, a probe is set with a corresponding probe identifier; when the processing unit 702 sends the data access request to the target storage device included in the storage device cluster, so that the target storage device executes the data access request and obtains a target request result of the data access request, it can be specifically used for:

将所述数据访问请求发送至所述存储设备集群包括的目标存储设备中,以使所述目标存储设备按照相应链路对所述数据访问请求进行执行,并在执行到所述至少一个探针组中的目标探针组时,对所述目标探针组中被执行到的目标起始探针中的探针标识,以及所述目标探针组中被执行到的目标终止探针中的探针标识进行打印;Sending the data access request to the target storage device included in the storage device cluster, so that the target storage device executes the data access request according to the corresponding link, and when the target probe group in the at least one probe group is executed, print the probe ID of the target start probe executed in the target probe group and the probe ID of the target end probe executed in the target probe group;

其中,所述目标起始探针中的探针标识的打印时间和所述目标终止探针中的探针标识的打印时间用于:确定所述数据访问请求被按照所述目标探针组所监测的链路进行执行时的局部耗时结果。Wherein, the printing time of the probe identification in the target start probe and the printing time of the probe identification in the target termination probe are used to determine the local time-consuming result when the data access request is executed according to the link monitored by the target probe group.

另一方面,本申请实施例还提出了另一种链路耗时分析装置,该链路耗时分析装置可以是运行于电子设备中的一个计算机程序(包括程序代码),且此处的电子设备是指:存储系统中的目标实例代理设备,存储系统包括至少一个客户端、中间代理设备、中间代理设备管理的存储设备集群以及存储设备集群中各个存储设备对应的实例代理设备,目标实例代理设备支持监听捕获所述中间代理设备的信息,以用于检测目标存储设备所接收以及发出的报文,目标存储设备为存储设备集群中与目标实例代理设备相对应的存储设备;如图7b所示,该链路耗时分析装置可包括处理单元704。该链路耗时分析装置可以执行图6所示的链路耗时分析方法,即该链路耗时分析装置可以运行上述单元:On the other hand, the embodiment of the present application also proposes another link time-consuming analysis device. The link time-consuming analysis device may be a computer program (including program code) running on an electronic device, and the electronic device here refers to: a target instance proxy device in a storage system. The storage system includes at least one client, an intermediate proxy device, a storage device cluster managed by the intermediate proxy device, and an instance proxy device corresponding to each storage device in the storage device cluster. A storage device corresponding to the proxy device of the target instance in the device cluster; as shown in FIG. 7 b , the apparatus for link time consumption analysis may include a processing unit 704 . The link time-consuming analysis device can execute the link time-consuming analysis method shown in Figure 6, that is, the link time-consuming analysis device can run the above units:

处理单元704,用于在检测到所述目标存储设备接收到数据访问请求中的第一报文数据时,记录所述第一报文数据的接收时间,所述数据访问请求包括至少一个报文数据,且所述第一报文数据的接收时间,早于所述至少一个报文数据中除所述第一报文数据以外的任一报文数据的接收时间;The processing unit 704 is configured to record the receiving time of the first message data when detecting that the target storage device receives the first message data in the data access request, the data access request includes at least one message data, and the receiving time of the first message data is earlier than the receiving time of any message data in the at least one message data except the first message data;

所述处理单元704,还用于在检测到所述至少一个报文数据中各个报文数据的响应报文被发出时,记录所述各个报文数据的响应报文被发出的发出时间,一个报文数据的响应报文为存储设备对相应报文数据的执行结果;The processing unit 704 is further configured to, when it is detected that a response message of each message data in the at least one message data is sent, record the sending time of the response message of each message data, and a response message of one message data is the execution result of the corresponding message data by the storage device;

所述处理单元704,还用于采用所述第一报文数据的接收时间,以及第二报文数据的响应报文被发出的发出时间,确定所述数据访问请求的实例层耗时结果,所述第二报文数据的响应报文被发出的发出时间,晚于所述至少一个报文数据中其他报文数据的响应报文被发出的发出时间。The processing unit 704 is further configured to use the receiving time of the first message data and the sending time of the response message of the second message data to determine the time-consuming result of the instance layer of the data access request, and the sending time of the response message of the second message data is later than the sending time of the response messages of other message data in the at least one message data.

在一种实施方式中,所述存储系统还包括显示系统,处理单元704,还可用于:In one embodiment, the storage system further includes a display system, and a processing unit 704, which can also be used for:

确定所述目标存储设备的设备标识,并对所述实例层耗时结果和所述设备标识进行序列化处理,得到序列化后的耗时数据;Determine the device identifier of the target storage device, and serialize the instance layer time-consuming result and the device identifier to obtain serialized time-consuming data;

上述链路耗时分析装置还可包括发送单元705,用于:The above link time-consuming analysis device may also include a sending unit 705, configured to:

将所述序列化后的耗时数据发送至所述显示系统中,以使所述显示系统对指定时间范围内的耗时数据进行显示。The serialized time-consuming data is sent to the display system, so that the display system displays the time-consuming data within a specified time range.

根据本发明的一个实施例,图2或图4所示的方法所涉及的各个步骤均可由图7a所示的链路耗时分析装置中的各个单元来执行的。根据本发明的另一个实施例,图6所示的方法所涉及的各个步骤均可由图7b所示的链路耗时分析装置中的各个单元来执行的。According to an embodiment of the present invention, each step involved in the method shown in FIG. 2 or FIG. 4 can be executed by each unit in the link time consumption analysis device shown in FIG. 7a. According to another embodiment of the present invention, each step involved in the method shown in FIG. 6 can be executed by each unit in the link time consumption analysis device shown in FIG. 7b.

根据本发明的另一个实施例,图7a和图7b所示的链路耗时分析装置中的各个单元均可以分别或全部合并为一个或若干个另外的单元来构成,或者其中的某个(些)单元还可以再拆分为功能上更小的多个单元来构成,这可以实现同样的操作,而不影响本发明的实施例的技术效果的实现。上述单元是基于逻辑功能划分的,在实际应用中,一个单元的功能也可以由多个单元来实现,或者多个单元的功能由一个单元实现。在本发明的其它实施例中,任一链路耗时分析装置也可以包括其他单元,在实际应用中,这些功能也可以由其它单元协助实现,并且可以由多个单元协作实现。According to another embodiment of the present invention, each unit in the link time-consuming analysis device shown in Fig. 7a and Fig. 7b can be respectively or all combined into one or several other units to form, or one (some) units can be further divided into functionally smaller units to form, which can achieve the same operation without affecting the realization of the technical effect of the embodiments of the present invention. The above-mentioned units are divided based on logical functions. In practical applications, the functions of one unit may also be realized by multiple units, or the functions of multiple units may be realized by one unit. In other embodiments of the present invention, any link time consumption analysis device may also include other units, and in practical applications, these functions may also be implemented with the assistance of other units, and may be implemented cooperatively by multiple units.

根据本发明的另一个实施例,可以通过在包括中央处理单元(CPU)、随机存取存储介质(RAM)、只读存储介质(ROM)等处理元件和存储元件的例如计算机的通用电子设备上运行能够执行如图2或图4中所示的相应方法所涉及的各步骤的计算机程序(包括程序代码),来构造如图7a中所示的链路耗时分析装置,以及来实现本发明实施例的链路耗时分析方法;并可通过在包括中央处理单元(CPU)、随机存取存储介质(RAM)、只读存储介质(ROM)等处理元件和存储元件的例如计算机的通用电子设备上运行能够执行如图6中所示的相应方法所涉及的各步骤的计算机程序(包括程序代码),来构造如图7b中所示的链路耗时分析装置,以及来实现本发明实施例的链路耗时分析方法。所述计算机程序可以记载于例如计算机存储介质上,并通过计算机存储介质装载于上述电子设备中,并在其中运行。According to another embodiment of the present invention, a computer program (including program code) capable of executing the steps involved in the corresponding methods as shown in FIG. 2 or FIG. 4 can be run on a general-purpose electronic device such as a computer that includes processing elements such as a central processing unit (CPU), a random access storage medium (RAM), and a read-only storage medium (ROM). RAM), read-only storage medium (ROM) and other processing elements and storage elements such as computer general-purpose electronic equipment run computer programs (including program codes) that can execute the steps involved in the corresponding methods as shown in Figure 6, to construct the link time-consuming analysis device as shown in Figure 7b, and to realize the link time-consuming analysis method of the embodiment of the present invention. The computer program may be recorded in, for example, a computer storage medium, loaded into the above-mentioned electronic device through the computer storage medium, and run therein.

本发明实施例可在中间代理设备接收到目标客户端发送的数据访问请求时,将数据访问请求添加至第一队列中,并确定数据访问请求被添加至第一队列的入队时间;然后,中间代理设备可通过第一队列将数据访问请求发送至目标存储设备中,以使目标存储设备执行数据访问请求,得到数据访问请求的目标请求结果;基于此,在中间代理设备接收到目标存储设备返回的目标请求结果时,可将目标请求结果添加至第二队列中,并确定目标请求结果从第二队列中出来以被发送至目标客户端的出队时间,从而采用入队时间和出队时间,确定数据访问请求的中间层耗时结果,使得基于中间代理设备构建的存储系统能够支持链路耗时分析。相应的,构建的存储系统还可包括存储设备集群中各个存储设备对应的实例代理设备,针对目标实例代理设备,目标实例代理设备可在检测到目标存储设备接收到数据访问请求中的第一报文数据时,记录第一报文数据的接收时间,数据访问请求包括至少一个报文数据,且第一报文数据的接收时间,早于至少一个报文数据中除第一报文数据以外的任一报文数据的接收时间;并且,在检测到至少一个报文数据中各个报文数据的响应报文被发出时,记录各个报文数据的响应报文被发出的发出时间,从而采用第一报文数据的接收时间,以及第二报文数据的响应报文被发出的发出时间,确定数据访问请求的实例层耗时结果,从而获取到精确性更高的耗时结果。可见,本发明实施例可构建一个支持链路耗时分析的存储系统,以从至少一个方面实现对请求的链路耗时分析,尤其是存储设备为内存对象缓存系统时,可实现对访问内存对象缓存系统的请求的链路耗时分析,以解决内存对象缓存系统不支持对相应请求的链路耗时分析的问题,从而解决包含内存对象缓存系统的存储系统所涉及的问题定位较慢,且分析手段能力不足等问题。In the embodiment of the present invention, when the intermediate proxy device receives the data access request sent by the target client, it can add the data access request to the first queue, and determine the enqueue time when the data access request is added to the first queue; then, the intermediate proxy device can send the data access request to the target storage device through the first queue, so that the target storage device executes the data access request, and obtains the target request result of the data access request; The dequeue time sent to the target client is used to determine the time-consuming result of the middle layer of the data access request by using the queue-entry time and the dequeue time, so that the storage system based on the intermediate proxy device can support link time-consuming analysis. Correspondingly, the constructed storage system may further include an instance agent device corresponding to each storage device in the storage device cluster. For the target instance agent device, the target instance agent device may record the receiving time of the first message data when detecting that the target storage device receives the first message data in the data access request. When the file is sent, record the sending time of the response message of each message data, so as to use the receiving time of the first message data and the sending time of the response message of the second message data to determine the time-consuming result of the instance layer of the data access request, so as to obtain a more accurate time-consuming result. It can be seen that the embodiment of the present invention can build a storage system that supports link time-consuming analysis, so as to realize link time-consuming analysis of requests from at least one aspect, especially when the storage device is a memory object caching system, it can implement link time-consuming analysis of requests for accessing the memory object caching system, so as to solve the problem that the memory object caching system does not support link time-consuming analysis of corresponding requests, thereby solving problems related to the storage system including the memory object caching system.

基于上述方法实施例以及装置实施例的描述,本发明示例性实施例还提供一种电子设备,包括:至少一个处理器;以及与至少一个处理器通信连接的存储器。所述存储器存储有能够被所述至少一个处理器执行的计算机程序,所述计算机程序在被所述至少一个处理器执行时用于使所述电子设备执行根据本发明实施例的方法。Based on the descriptions of the method embodiment and the device embodiment above, an exemplary embodiment of the present invention further provides an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor. The memory stores a computer program executable by the at least one processor, and when executed by the at least one processor, the computer program is used to cause the electronic device to execute the method according to the embodiment of the present invention.

本发明示例性实施例还提供一种存储有计算机程序的非瞬时计算机可读存储介质,其中,所述计算机程序在被计算机的处理器执行时用于使所述计算机执行根据本发明实施例的方法。Exemplary embodiments of the present invention also provide a non-transitory computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor of a computer, is used to cause the computer to execute the method according to the embodiment of the present invention.

本发明示例性实施例还提供一种计算机程序产品,包括计算机程序,其中,所述计算机程序在被计算机的处理器执行时用于使所述计算机执行根据本发明实施例的方法。Exemplary embodiments of the present invention also provide a computer program product, including a computer program, wherein the computer program, when executed by a processor of a computer, is used to cause the computer to execute the method according to the embodiment of the present invention.

参考图8,现将描述可以作为本发明的服务器或客户端的电子设备800的结构框图,其是可以应用于本发明的各方面的硬件设备的示例。电子设备旨在表示各种形式的数字电子的计算机设备,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本发明的实现。Referring to FIG. 8 , a structural block diagram of an electronic device 800 that can serve as a server or a client of the present invention will now be described, which is an example of a hardware device that can be applied to various aspects of the present invention. Electronic device is intended to mean various forms of digital electronic computing equipment, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. Electronic devices may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are by way of example only, and are not intended to limit implementations of the inventions described and/or claimed herein.

如图8所示,电子设备800包括计算单元801,其可以根据存储在只读存储器(ROM)802中的计算机程序或者从存储单元808加载到随机访问存储器(RAM)803中的计算机程序,来执行各种适当的动作和处理。在RAM 803中,还可存储设备800操作所需的各种程序和数据。计算单元801、ROM 802以及RAM 803通过总线804彼此相连。输入/输出(I/O)接口805也连接至总线804。As shown in FIG. 8 , the electronic device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data necessary for the operation of the device 800 can also be stored. The computing unit 801 , ROM 802 , and RAM 803 are connected to each other through a bus 804 . An input/output (I/O) interface 805 is also connected to the bus 804 .

电子设备800中的多个部件连接至I/O接口805,包括:输入单元806、输出单元807、存储单元808以及通信单元809。输入单元806可以是能向电子设备800输入信息的任何类型的设备,输入单元806可以接收输入的数字或字符信息,以及产生与电子设备的用户设置和/或功能控制有关的键信号输入。输出单元807可以是能呈现信息的任何类型的设备,并且可以包括但不限于显示器、扬声器、视频/音频输出终端、振动器和/或打印机。存储单元808可以包括但不限于磁盘、光盘。通信单元809允许电子设备800通过诸如因特网的计算机网络和/或各种电信网络与其他设备交换信息/数据,并且可以包括但不限于调制解调器、网卡、红外通信设备、无线通信收发机和/或芯片组,例如蓝牙TM设备、WiFi设备、WiMax设备、蜂窝通信设备和/或类似物。Multiple components in the electronic device 800 are connected to the I/O interface 805 , including: an input unit 806 , an output unit 807 , a storage unit 808 and a communication unit 809 . The input unit 806 can be any type of device capable of inputting information to the electronic device 800. The input unit 806 can receive input numeric or character information, and generate key signal input related to user settings and/or function control of the electronic device. The output unit 807 may be any type of device capable of presenting information, and may include, but is not limited to, a display, a speaker, a video/audio output terminal, a vibrator, and/or a printer. The storage unit 808 may include, but is not limited to, a magnetic disk and an optical disk. The communication unit 809 allows the electronic device 800 to exchange information/data with other devices through a computer network such as the Internet and/or various telecommunication networks, and may include, but is not limited to, a modem, a network card, an infrared communication device, a wireless communication transceiver and/or a chipset, such as a Bluetooth™ device, a WiFi device, a WiMax device, a cellular communication device, and/or the like.

计算单元801可以是各种具有处理和计算能力的通用和/或专用处理组件。计算单元801的一些示例包括但不限于中央处理单元(CPU)、图形处理单元(GPU)、各种专用的人工智能(AI)计算芯片、各种运行机器学习模型算法的计算单元、数字信号处理器(DSP)、以及任何适当的处理器、控制器、微控制器等。计算单元801执行上文所描述的各个方法和处理。例如,在一些实施例中,链路耗时分析方法可被实现为计算机软件程序,其被有形地包含于机器可读介质,例如存储单元808。在一些实施例中,计算机程序的部分或者全部可以经由ROM 802和/或通信单元809而被载入和/或安装到电子设备800上。在一些实施例中,计算单元801可以通过其他任何适当的方式(例如,借助于固件)而被配置为执行链路耗时分析方法。The computing unit 801 may be various general-purpose and/or special-purpose processing components having processing and computing capabilities. Some examples of computing units 801 include, but are not limited to, central processing units (CPUs), graphics processing units (GPUs), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, digital signal processors (DSPs), and any suitable processors, controllers, microcontrollers, etc. The computing unit 801 executes the various methods and processes described above. For example, in some embodiments, the link timing analysis method may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 808 . In some embodiments, part or all of the computer program may be loaded and/or installed on the electronic device 800 via the ROM 802 and/or the communication unit 809 . In some embodiments, the calculation unit 801 may be configured to execute the link time consumption analysis method in any other appropriate manner (for example, by means of firmware).

用于实施本发明的方法的程序代码可以采用一个或多个编程语言的任何组合来编写。这些程序代码可以提供给通用计算机、专用计算机或其他可编程数据处理装置的处理器或控制器,使得程序代码当由处理器或控制器执行时使流程图和/或框图中所规定的功能/操作被实施。程序代码可以完全在机器上执行、部分地在机器上执行,作为独立软件包部分地在机器上执行且部分地在远程机器上执行或完全在远程机器或服务器上执行。Program codes for implementing the methods of the present invention may be written in any combination of one or more programming languages. These program codes may be provided to processors or controllers of general-purpose computers, special purpose computers, or other programmable data processing devices, so that the program codes cause the functions/operations specified in the flowcharts and/or block diagrams to be implemented when executed by the processors or controllers. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.

在本发明的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of the present invention, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include one or more wire-based electrical connections, a portable computer disk, a hard disk, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

如本发明使用的,术语“机器可读介质”和“计算机可读介质”指的是用于将机器指令和/或数据提供给可编程处理器的任何计算机程序产品、设备、和/或装置(例如,磁盘、光盘、存储器、可编程逻辑装置(PLD)),包括,接收作为机器可读信号的机器指令的机器可读介质。术语“机器可读信号”指的是用于将机器指令和/或数据提供给可编程处理器的任何信号。As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or means (e.g., magnetic disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and/or data to a programmable processor, including machine-readable media that receive machine instructions as machine-readable signals. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.

为了提供与用户的交互,可以在计算机上实施此处描述的系统和技术,该计算机具有:用于向用户显示信息的显示装置(例如,CRT(阴极射线管)或者LCD(液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。To provide for interaction with a user, the systems and techniques described herein can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, voice input, or tactile input.

可以将此处描述的系统和技术实施在包括后台部件的计算系统(例如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:局域网(LAN)、广域网(WAN)和互联网。The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication, eg, a communication network. Examples of communication networks include: Local Area Network (LAN), Wide Area Network (WAN) and the Internet.

计算机系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。A computer system may include clients and servers. Clients and servers are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by computer programs running on the respective computers and having a client-server relationship to each other.

并且,应理解的是,以上所揭露的仅为本发明较佳实施例而已,当然不能以此来限定本发明之权利范围,因此依本发明权利要求所作的等同变化,仍属本发明所涵盖的范围。And, it should be understood that what is disclosed above is only a preferred embodiment of the present invention, which certainly cannot limit the scope of rights of the present invention. Therefore, equivalent changes made according to the claims of the present invention still fall within the scope of the present invention.

Claims (12)

1.一种链路耗时分析方法,其特征在于,所述方法应用于存储系统中的中间代理设备,所述存储系统包括至少一个客户端、所述中间代理设备以及所述中间代理设备管理的存储设备集群;所述方法包括:1. A link time-consuming analysis method, characterized in that, the method is applied to an intermediate proxy device in a storage system, and the storage system includes at least one client, the intermediate proxy device, and a storage device cluster managed by the intermediate proxy device; the method includes: 在接收到目标客户端发送的数据访问请求时,将所述数据访问请求添加至第一队列中,并确定所述数据访问请求被添加至所述第一队列的入队时间,所述第一队列用于存放从客户端接收到的请求;When receiving the data access request sent by the target client, adding the data access request to the first queue, and determining the enqueue time when the data access request is added to the first queue, the first queue is used to store requests received from the client; 通过所述第一队列,将所述数据访问请求发送至所述存储设备集群包括的目标存储设备中,以使所述目标存储设备执行所述数据访问请求,得到所述数据访问请求的目标请求结果,所述目标存储设备为所述存储设备集群中的任一存储设备;Send the data access request to a target storage device included in the storage device cluster through the first queue, so that the target storage device executes the data access request to obtain a target request result of the data access request, and the target storage device is any storage device in the storage device cluster; 接收所述目标存储设备返回的所述目标请求结果,将所述目标请求结果添加至第二队列中,并确定所述目标请求结果从所述第二队列中出来以被发送至所述目标客户端的出队时间,所述第二队列用于存放待发送至客户端的请求结果;receiving the target request result returned by the target storage device, adding the target request result to a second queue, and determining the dequeue time for the target request result to come out of the second queue to be sent to the target client, and the second queue is used to store the request result to be sent to the client; 采用所述入队时间和所述出队时间,确定所述数据访问请求的中间层耗时结果。Using the enqueue time and the dequeue time, determine the time-consuming result of the middle layer of the data access request. 2.根据权利要求1所述的方法,其特征在于,所述通过所述第一队列,将所述数据访问请求发送至所述存储设备集群包括的目标存储设备中,包括:2. The method according to claim 1, wherein the sending the data access request to the target storage device included in the storage device cluster through the first queue comprises: 通过所述第一队列,将所述数据访问请求发送至第三队列中,所述第三队列用于存放待发送至存储设备的请求;Send the data access request to a third queue through the first queue, and the third queue is used to store requests to be sent to the storage device; 采用所述第三队列,将所述数据访问请求发送至所述存储设备集群包括的目标存储设备中;Using the third queue, sending the data access request to a target storage device included in the storage device cluster; 所述将所述目标请求结果添加至第二队列中,包括:The adding the target request result to the second queue includes: 将所述目标请求结果添加至第四队列中,所述第四队列用于存放从存储设备接收到的请求结果;adding the target request result to a fourth queue, where the fourth queue is used to store the request result received from the storage device; 通过所述第四队列,将所述目标请求结果发送至所述第二队列中,以使所述目标请求结果被添加至所述第二队列中。Send the target request result to the second queue through the fourth queue, so that the target request result is added to the second queue. 3.根据权利要求1或2所述的方法,其特征在于,所述中间代理设备包括M个队列组,M为正整数,一个队列组对应一个处理池,且一个请求所涉及的数据均通过同一队列组中的各个队列进行传输,则所述第一队列和所述第二队列均为目标队列组中的队列,所述目标队列组为所述M个队列组中的任一队列组;所述方法还包括:3. The method according to claim 1 or 2, wherein the intermediate proxy device includes M queue groups, M is a positive integer, a queue group corresponds to a processing pool, and the data involved in a request is transmitted through each queue in the same queue group, then the first queue and the second queue are queues in the target queue group, and the target queue group is any queue group in the M queue groups; the method also includes: 接收多个请求,并将所述多个请求分发至所述M个队列组中的N个队列组对应的处理池,N为小于或等于M的正整数;receiving multiple requests, and distributing the multiple requests to processing pools corresponding to N queue groups in the M queue groups, where N is a positive integer less than or equal to M; 通过所述N个队列组中的各个队列组,对所述各个队列组中的请求进行并行处理,以通过相应存储设备并行地获取到所述多个请求的请求结果和中间层耗时结果。The requests in the respective queue groups are processed in parallel through each of the N queue groups, so that the request results and the time-consuming results of the middle layer of the multiple requests are obtained in parallel through corresponding storage devices. 4.根据权利要求1或2所述的方法,其特征在于,所述方法还包括:4. method according to claim 1 or 2, is characterized in that, described method also comprises: 将所述中间层耗时结果存储至第一耗时数据中,以在所述第一耗时数据中添加一条包括所述中间层耗时结果的存储数据,且所述第一耗时数据包括所述中间代理设备接收到的各个请求的中间层耗时结果;或者,storing the time-consuming result of the intermediate layer in the first time-consuming data, so as to add a piece of stored data including the time-consuming result of the intermediate layer to the first time-consuming data, and the first time-consuming data includes the time-consuming result of the intermediate layer of each request received by the intermediate proxy device; or, 若所述中间层耗时结果对应时长大于第一预设时长,则将所述中间层耗时结果存储至第二耗时数据中,以在所述第二耗时数据中添加一条包括所述中间层耗时结果的存储数据,且所述第二耗时数据包括至少一个第一慢查询请求中每个第一慢查询请求的中间层耗时结果,第一慢查询请求是指中间层耗时结果对应时长大于所述第一预设时长的请求;或者,If the time-consuming result corresponding to the intermediate layer is longer than the first preset duration, store the time-consuming result of the intermediate layer in the second time-consuming data to add a piece of storage data including the time-consuming result of the intermediate layer to the second time-consuming data, and the second time-consuming data includes the time-consuming result of the intermediate layer for each first slow query request in at least one first slow query request, and the first slow query request refers to a request for which the corresponding duration of the time-consuming result of the intermediate layer is longer than the first preset duration; or, 若所述中间层耗时结果对应时长大于第二预设时长,则将所述数据访问请求存储至慢查询数据中,以在所述慢查询数据中添加一条包括所述数据访问请求的存储数据,且所述慢查询数据包括至少一个第二慢查询请求,第二慢查询请求是指中间层耗时结果对应时长大于所述第二预设时长的请求。If the corresponding duration of the time-consuming result of the middle layer is longer than the second preset duration, the data access request is stored in the slow query data to add a piece of stored data including the data access request to the slow query data, and the slow query data includes at least one second slow query request, and the second slow query request refers to a request whose corresponding duration of the time-consuming result of the middle layer is longer than the second preset duration. 5.根据权利要求4所述的方法,其特征在于,所述方法还包括:5. method according to claim 4, is characterized in that, described method also comprises: 确定过期时长,并在检测到目标存储数据中任一存储数据的存储时长大于所述过期时长时,删除所述任一存储数据,所述目标存储数据为所述第一耗时数据、所述第二耗时数据以及所述慢查询数据中的任一数据;Determine the expiration time, and when it is detected that the storage time of any storage data in the target storage data is longer than the expiration time, delete the any storage data, and the target storage data is any data in the first time-consuming data, the second time-consuming data and the slow query data; 其中,所述任一存储数据的存储时长是指存储时间与当前系统时间之间的差值。Wherein, the storage duration of any stored data refers to the difference between the storage time and the current system time. 6.根据权利要求1或2所述的方法,其特征在于,所述目标存储设备包括至少一个探针组,任一探针组包括一个起始探针和至少一个终止探针,且在一次链路执行过程中,所述任一探针组中仅存在一个起始探针和一个终止探针被执行;其中,一个探针中设置有相应的探针标识;所述将所述数据访问请求发送至所述存储设备集群包括的目标存储设备中,以使所述目标存储设备执行所述数据访问请求,得到所述数据访问请求的目标请求结果,包括:6. The method according to claim 1 or 2, wherein the target storage device includes at least one probe group, any probe group includes a start probe and at least one end probe, and during a link execution process, only one start probe and one end probe are executed in any probe group; wherein, a probe is provided with a corresponding probe identifier; the sending the data access request to the target storage device included in the storage device cluster, so that the target storage device executes the data access request, and obtains a target request result of the data access request, comprising: 将所述数据访问请求发送至所述存储设备集群包括的目标存储设备中,以使所述目标存储设备按照相应链路对所述数据访问请求进行执行,并在执行到所述至少一个探针组中的目标探针组时,对所述目标探针组中被执行到的目标起始探针中的探针标识,以及所述目标探针组中被执行到的目标终止探针中的探针标识进行打印;Sending the data access request to the target storage device included in the storage device cluster, so that the target storage device executes the data access request according to the corresponding link, and when the target probe group in the at least one probe group is executed, print the probe ID of the target start probe executed in the target probe group and the probe ID of the target end probe executed in the target probe group; 其中,所述目标起始探针中的探针标识的打印时间和所述目标终止探针中的探针标识的打印时间用于:确定所述数据访问请求被按照所述目标探针组所监测的链路进行执行时的局部耗时结果。Wherein, the printing time of the probe identification in the target start probe and the printing time of the probe identification in the target termination probe are used to determine the local time-consuming result when the data access request is executed according to the link monitored by the target probe group. 7.一种链路耗时分析方法,其特征在于,所述方法应用于存储系统中的目标实例代理设备,所述存储系统包括至少一个客户端、中间代理设备、所述中间代理设备管理的存储设备集群以及所述存储设备集群中各个存储设备对应的实例代理设备,所述目标实例代理设备支持监听捕获所述中间代理设备的信息,以用于检测目标存储设备所接收以及发出的报文,所述目标存储设备为所述存储设备集群中与所述目标实例代理设备相对应的存储设备;所述方法包括:7. A link time-consuming analysis method, wherein the method is applied to a target instance proxy device in a storage system, the storage system includes at least one client, an intermediate proxy device, a storage device cluster managed by the intermediate proxy device, and an instance proxy device corresponding to each storage device in the storage device cluster, the target instance proxy device supports monitoring and capturing information of the intermediate proxy device for detecting messages received and sent by the target storage device, and the target storage device is a storage device corresponding to the target instance proxy device in the storage device cluster; the method includes: 在检测到所述目标存储设备接收到数据访问请求中的第一报文数据时,记录所述第一报文数据的接收时间,所述数据访问请求包括至少一个报文数据,且所述第一报文数据的接收时间,早于所述至少一个报文数据中除所述第一报文数据以外的任一报文数据的接收时间;When it is detected that the target storage device receives the first message data in the data access request, record the receiving time of the first message data, the data access request includes at least one message data, and the receiving time of the first message data is earlier than the receiving time of any message data in the at least one message data except the first message data; 在检测到所述至少一个报文数据中各个报文数据的响应报文被发出时,记录所述各个报文数据的响应报文被发出的发出时间,一个报文数据的响应报文为存储设备对相应报文数据的执行结果;When it is detected that the response message of each message data in the at least one message data is sent, record the sending time of the response message of each message data, and the response message of one message data is the execution result of the corresponding message data by the storage device; 采用所述第一报文数据的接收时间,以及第二报文数据的响应报文被发出的发出时间,确定所述数据访问请求的实例层耗时结果,所述第二报文数据的响应报文被发出的发出时间,晚于所述至少一个报文数据中其他报文数据的响应报文被发出的发出时间。Using the receiving time of the first message data and the sending time of the response message of the second message data to determine the time-consuming result of the instance layer of the data access request, the sending time of the response message of the second message data is later than the sending time of the response messages of other message data in the at least one message data. 8.根据权利要求7所述的方法,其特征在于,所述存储系统还包括显示系统,所述方法还包括:8. The method according to claim 7, wherein the storage system further comprises a display system, and the method further comprises: 确定所述目标存储设备的存储设备标识,并对所述实例层耗时结果和所述存储设备标识进行序列化处理,得到序列化后的耗时数据;Determine the storage device identifier of the target storage device, and serialize the instance layer time-consuming result and the storage device identifier to obtain serialized time-consuming data; 将所述序列化后的耗时数据发送至所述显示系统中,以使所述显示系统对指定时间范围内的耗时数据进行显示。The serialized time-consuming data is sent to the display system, so that the display system displays the time-consuming data within a specified time range. 9.一种链路耗时分析装置,其特征在于,所述装置运行于存储系统中的中间代理设备,所述存储系统包括至少一个客户端、所述中间代理设备以及所述中间代理设备管理的存储设备集群;所述装置包括:9. A link time-consuming analysis device, characterized in that the device operates on an intermediate proxy device in a storage system, and the storage system includes at least one client, the intermediate proxy device, and a storage device cluster managed by the intermediate proxy device; the device includes: 处理单元,用于在接收到目标客户端发送的数据访问请求时,将所述数据访问请求添加至第一队列中,并确定所述数据访问请求被添加至所述第一队列的入队时间,所述第一队列用于存放从客户端接收到的请求;The processing unit is configured to add the data access request to the first queue when receiving the data access request sent by the target client, and determine the enqueue time when the data access request is added to the first queue, and the first queue is used to store requests received from the client; 发送单元,用于通过所述第一队列,将所述数据访问请求发送至所述存储设备集群包括的目标存储设备中,以使所述目标存储设备执行所述数据访问请求,得到所述数据访问请求的目标请求结果,所述目标存储设备为所述存储设备集群中的任一存储设备;A sending unit, configured to send the data access request to a target storage device included in the storage device cluster through the first queue, so that the target storage device executes the data access request to obtain a target request result of the data access request, and the target storage device is any storage device in the storage device cluster; 接收单元,用于接收所述目标存储设备返回的所述目标请求结果;a receiving unit, configured to receive the target request result returned by the target storage device; 所述处理单元,还用于将所述目标请求结果添加至第二队列中,并确定所述目标请求结果从所述第二队列中出来以被发送至所述目标客户端的出队时间,所述第二队列用于存放待发送至客户端的请求结果;The processing unit is further configured to add the target request result to a second queue, and determine the dequeue time for the target request result to come out of the second queue to be sent to the target client, and the second queue is used to store the request result to be sent to the client; 所述处理单元,还用于采用所述入队时间和所述出队时间,确定所述数据访问请求的中间层耗时结果。The processing unit is further configured to use the enqueue time and the dequeue time to determine the time-consuming result of the middle layer of the data access request. 10.一种链路耗时分析装置,其特征在于,所述装置运行于存储系统中的目标实例代理设备,所述存储系统包括至少一个客户端、中间代理设备、所述中间代理设备管理的存储设备集群以及所述存储设备集群中各个存储设备对应的实例代理设备,所述目标实例代理设备支持监听捕获所述中间代理设备的信息,以用于检测目标存储设备所接收以及发出的报文,所述目标存储设备为所述存储设备集群中与所述目标实例代理设备相对应的存储设备;所述装置包括:10. A link time-consuming analysis device, characterized in that the device runs on a target instance proxy device in a storage system, and the storage system includes at least one client, an intermediate proxy device, a storage device cluster managed by the intermediate proxy device, and an instance proxy device corresponding to each storage device in the storage device cluster, and the target instance proxy device supports monitoring and capturing information of the intermediate proxy device for detecting messages received and sent by the target storage device, and the target storage device is a storage device corresponding to the target instance proxy device in the storage device cluster; the device includes: 处理单元,用于在检测到所述目标存储设备接收到数据访问请求中的第一报文数据时,记录所述第一报文数据的接收时间,所述数据访问请求包括至少一个报文数据,且所述第一报文数据的接收时间,早于所述至少一个报文数据中除所述第一报文数据以外的任一报文数据的接收时间;A processing unit, configured to record the receiving time of the first message data when detecting that the target storage device receives the first message data in the data access request, the data access request includes at least one message data, and the receiving time of the first message data is earlier than the receiving time of any message data in the at least one message data except the first message data; 所述处理单元,还用于在检测到所述至少一个报文数据中各个报文数据的响应报文被发出时,记录所述各个报文数据的响应报文被发出的发出时间,一个报文数据的响应报文为存储设备对相应报文数据的执行结果;The processing unit is further configured to record the sending time of the response message of each message data when detecting that the response message of each message data in the at least one message data is sent, and the response message of one message data is the execution result of the corresponding message data by the storage device; 所述处理单元,还用于采用所述第一报文数据的接收时间,以及第二报文数据的响应报文被发出的发出时间,确定所述数据访问请求的实例层耗时结果,所述第二报文数据的响应报文被发出的发出时间,晚于所述至少一个报文数据中其他报文数据的响应报文被发出的发出时间。The processing unit is further configured to use the receiving time of the first message data and the sending time of the response message of the second message data to determine the time-consuming result of the instance layer of the data access request, and the sending time of the response message of the second message data is later than the sending time of the response messages of other message data in the at least one message data. 11.一种电子设备,其特征在于,包括:11. An electronic device, characterized in that it comprises: 处理器;以及processor; and 存储程序的存储器,memory for storing programs, 其中,所述程序包括指令,所述指令在由所述处理器执行时使所述处理器执行根据权利要求1-6中任一项所述的方法;或者,所述指令在由所述处理器执行时使所述处理器执行根据权利要求7或8所述的方法。Wherein, the program includes instructions, which when executed by the processor cause the processor to perform the method according to any one of claims 1-6; or, when executed by the processor, the instructions cause the processor to perform the method according to claim 7 or 8. 12.一种存储有计算机指令的非瞬时计算机可读存储介质,其中,所述计算机指令用于使计算机执行根据权利要求1-6中任一项所述的方法;或者,所述计算机指令用于使计算机执行根据权利要求7或8所述的方法。12. A non-transitory computer-readable storage medium stored with computer instructions, wherein the computer instructions are used to cause a computer to perform the method according to any one of claims 1-6; or, the computer instructions are used to cause a computer to perform the method according to claim 7 or 8.
CN202310512305.XA 2023-05-08 2023-05-08 Link time consumption analysis method and device, storage medium and electronic equipment Pending CN116483578A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310512305.XA CN116483578A (en) 2023-05-08 2023-05-08 Link time consumption analysis method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310512305.XA CN116483578A (en) 2023-05-08 2023-05-08 Link time consumption analysis method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN116483578A true CN116483578A (en) 2023-07-25

Family

ID=87211781

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310512305.XA Pending CN116483578A (en) 2023-05-08 2023-05-08 Link time consumption analysis method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN116483578A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119276734A (en) * 2024-12-06 2025-01-07 北京火山引擎科技有限公司 CDN transmission performance analysis method, device, equipment, medium and product

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119276734A (en) * 2024-12-06 2025-01-07 北京火山引擎科技有限公司 CDN transmission performance analysis method, device, equipment, medium and product
CN119276734B (en) * 2024-12-06 2025-03-04 北京火山引擎科技有限公司 CDN transmission performance analysis method, device, equipment, medium and product

Similar Documents

Publication Publication Date Title
CN108833950B (en) Barrage message issuing method, server, system and storage medium
EP2947582A1 (en) Computing device and method for executing database operation command
US7171464B1 (en) Method of tracing data traffic on a network
CN111737128A (en) On-line test method, grayscale shunt device, and storage medium
WO2019242437A1 (en) Distributed transaction processing method and related device
CN111259022B (en) Information synchronization method, synchronization system, computer equipment and medium
WO2021097713A1 (en) Distributed security testing system, method and device, and storage medium
US10067862B2 (en) Tracking asynchronous entry points for an application
CN111131499A (en) Concurrent and asynchronous task processing method and device thereof
CN111831513B (en) Log query method, device, electronic equipment and storage medium
WO2024125106A1 (en) Data transmission method and apparatus, device, and storage medium
WO2024124789A1 (en) File processing method and apparatus, server, and medium
CN116483578A (en) Link time consumption analysis method and device, storage medium and electronic equipment
CN108989404B (en) Barrage message issuing method, server, system and storage medium
CN116800647A (en) Link tracking method and device, electronic equipment and media
WO2015062418A1 (en) Method, apparatus and equipment for sending data packet
CN111935316B (en) Method and device for acquiring front-end equipment catalog
CN111327511B (en) Instant messaging method, system, terminal equipment and storage medium
CN116248630A (en) Application acceleration method and device, electronic equipment and storage medium
CN102256276B (en) Drive test information processing method and device
CN112637119A (en) Host scanning method and device, storage medium and electronic equipment
CN112291202A (en) Message data visualization method and device and computer readable storage medium
CN111262773A (en) Message synchronization method and data center
CN112291209B (en) Method and device for acquiring front-end equipment catalog
CN113726872B (en) Method, device, equipment and medium for filtering promotion information

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination