Distributed cache system, method and device

By monitoring the cache resource access indicators of storage nodes in the distributed cache system, establishing a new link map, and scheduling overloaded read/write requests to the idle nodes, the problem of unbalanced cache resource access is solved and load balancing and resource utilization is improved.

CN114595167BActive Publication Date: 2025-03-11ALIBABA (CHINA) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210138924.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-15
Publication Date
2025-03-11
Estimated Expiration
2042-02-15

AI Technical Summary

Technical Problem

In a distributed cache system, due to the different number of read/write requests for different projects, cache resource access in storage nodes is unbalanced, some nodes are loaded too much and some nodes are cache utilization too low.

Method used

The management node obtains cache resource access indicators for each storage node, and determines the first storage node and the target address space segment that meet the preset overload conditions, and the second storage node that meets the preset scheduling conditions. Then, a creation request is sent to the second storage node, a new link map is established, and the read/write request of the target address space segment is scheduled to the second storage node.

Benefits of technology

The balancing scheduling of storage node loads is realized, and the balanced utilization of cache resources in distributed cache systems is improved, and performance degradation is avoided due to load imbalance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114595167B_ABST
    Figure CN114595167B_ABST
Patent Text Reader

Abstract

The embodiments of this specification provide a distributed cache system, method and device, wherein the distributed cache system includes: a management node, multiple storage nodes storing cache resources and a client; the management node obtains the cache resource access index of each storage node, and based on the cache resource access index of each storage node, determines the first storage node and the target address space segment that meet the preset overload condition, and the second storage node that meets the preset scheduling condition; sends a creation request for the target address space segment to the second storage node, and after receiving the response message of successful creation returned by the second storage node, sends a mapping establishment request to the client; after receiving the mapping establishment request, the client creates a link mapping between the target disk, the target address space segment and the second storage node. This solution can improve the utilization balance of cache resources in the distributed cache system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present specification relate to the field of computer technology, and in particular to a distributed cache system. Background Art

[0002] With the development of computer technology, cache resources in a distributed cache system containing multiple storage nodes are usually used to accelerate the read / write requests of each project to improve the processing efficiency of the read / write requests. Therefore, how to allocate cache resources in a distributed cache system is crucial.

[0003] In the related art, each storage node usually stores the same cache resources, for example, the same cache module Cache. On this basis, each storage node evenly corresponds to multiple address space segments, and the read / write requests corresponding to each address space segment access the cache resources in the corresponding storage node to achieve read and write acceleration.

[0004] However, in specific applications, the number of read / write requests for different projects is different, which easily leads to the problem of unbalanced access to cache resources in each node. For example, the load of some storage nodes is too large, and the cache utilization rate of some storage nodes is too low. Therefore, a more reliable solution is needed. Summary of the invention

[0005] In view of this, the embodiments of this specification provide a distributed cache system. One or more embodiments of this specification also relate to a distributed cache method, a distributed cache device, a computing device, a computer-readable storage medium and a computer program to solve the technical defects existing in the prior art.

[0006] According to a first aspect of an embodiment of this specification, there is provided a distributed cache system, comprising: a management node, a plurality of storage nodes storing cache resources, and a client;

[0007] The management node is configured to obtain the cache resource access index of each storage node, determine the first storage node and the target address space segment that meet the preset overload condition, and the second storage node that meets the preset scheduling condition based on the cache resource access index of each storage node; send a creation request for the target address space segment to the second storage node, and after receiving a successful creation response message returned by the second storage node, send a mapping establishment request to the client;

[0008] The client is configured to create a new link mapping of the target address space segment for the target disk after receiving the mapping establishment request, wherein the new link mapping is the target disk, the target address space segment created by the second storage node, and the link mapping between the second storage node.

[0009] According to a second aspect of an embodiment of this specification, a distributed caching method is provided, which is applied to a management node, including:

[0010] Obtain cache resource access indicators for each storage node;

[0011] Based on the cache resource access index of each storage node, determining a first storage node and a target address space segment that meet a preset overload condition, and a second storage node that meets a preset scheduling condition;

[0012] Sending a creation request for the target address space segment to the second storage node;

[0013] After receiving a successful creation response message returned by the second storage node, a mapping establishment request is sent to the client, wherein the mapping establishment request is used by the client to create a new link mapping of the target address space segment for the target disk after receiving the mapping establishment request, and the new link mapping is the target disk, the target address space segment created by the second storage node, and the link mapping between the second storage node.

[0014] According to a third aspect of an embodiment of this specification, a distributed caching method is provided, which is applied to a client and includes:

[0015] Receive a mapping establishment request sent by a management node, wherein the mapping establishment is that the management node obtains the cache resource access index of each storage node, determines the first storage node and the target address space segment that meet the preset overload condition, and the second storage node that meets the preset scheduling condition based on the cache resource access index of each storage node, and sends a creation request for the target address space segment to the second storage node, and sends after receiving a successful creation response message returned by the second storage node;

[0016] According to the mapping establishment request, a new link mapping of the target address space segment is created for the target disk, wherein the new link mapping is the target disk, the target address space segment created by the second storage node, and the link mapping between the second storage node.

[0017] According to a fourth aspect of an embodiment of this specification, a distributed cache device is provided, which is applied to a management node, including:

[0018] A load performance monitoring module is configured to obtain a cache resource access index of each storage node; based on the cache resource access index of each storage node, determine a first storage node and a target address space segment that meet a preset overload condition, and a second storage node that meets a preset scheduling condition;

[0019] The load balancing scheduling module is configured to send a creation request for the target address space segment to the second storage node; after receiving a successful creation response message returned by the second storage node, send a mapping establishment request to the client, wherein the mapping establishment request is used by the client to create a new link mapping of the target address space segment for the target disk after receiving the mapping establishment request, and the new link mapping is the target disk, the target address space segment created by the second storage node, and the link mapping between the second storage node.

[0020] According to a fifth aspect of the embodiments of this specification, a distributed cache device is provided, which is applied to a client and includes:

[0021] a request receiving module configured to receive a mapping establishment request sent by a management node, wherein the mapping establishment is that the management node obtains cache resource access indicators of each storage node, determines a first storage node and a target address space segment that meet a preset overload condition, and a second storage node that meets a preset scheduling condition based on the cache resource access indicators of each storage node, and sends a creation request for the target address space segment to the second storage node, and sends after receiving a creation success response message returned by the second storage node;

[0022] A mapping establishment module is configured to create a new link mapping of the target address space segment for the target disk according to the mapping establishment request, wherein the new link mapping is the target disk, the target address space segment created by the second storage node, and the link mapping between the second storage nodes.

[0023] According to a sixth aspect of an embodiment of this specification, a computing device is provided, including:

[0024] Memory and processor;

[0025] The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions. When the computer executable instructions are executed by the processor, the steps of the above-mentioned distributed cache method are implemented.

[0026] According to a seventh aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the above-mentioned distributed caching method are implemented.

[0027] According to an eighth aspect of the embodiments of this specification, a computer program is provided, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned distributed cache* method.

[0028] An embodiment of the present specification implements a distributed cache system, including: a management node, a plurality of storage nodes storing cache resources, and a client. The management node is configured to obtain the cache resource access index of each storage node, and based on the cache resource access index of each storage node, determine the first storage node and the target address space segment that meet the preset overload condition, and the second storage node that meets the preset scheduling condition; send a creation request for the target address space segment to the second storage node, and after receiving the response message of successful creation returned by the second storage node, send a mapping establishment request to the client; the client is configured to create a new link mapping of the target address space segment for the target disk after receiving the mapping establishment request, wherein the new link mapping is the target disk, the target address space segment created by the second storage node, and the link mapping between the second storage node. And, the read / write request accesses the cache resource according to the link mapping. In this way, a new link mapping for load balancing scheduling can be established based on the load performance monitoring of the storage node; and then the read / write request processed by the target address space segment is scheduled from the overloaded first storage node to the second storage node using the new link mapping for the target address space segment. Therefore, the read / write request originally accessing the cache resources in the first storage node is converted to accessing the cache resources in the second storage node, thereby achieving balanced scheduling of the storage node load and improving the balanced utilization of cache resources in the distributed cache system. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 It is a structural diagram of a distributed cache system in the related art;

[0030] Figure 2 It is a schematic diagram of the structure of a distributed cache system provided by an embodiment of this specification;

[0031] Figure 3 is a flow chart of a distributed caching method applied to a distributed caching system provided by an embodiment of this specification;

[0032] Figure 4 This is an example diagram of an application scenario of a distributed cache system provided by an embodiment of this specification;

[0033] Figure 5 is a flow chart of a distributed caching method applied to a management node provided by an embodiment of this specification;

[0034] Figure 6 is a flow chart of a distributed caching method applied to a client provided by an embodiment of this specification;

[0035] Figure 7 It is a structural diagram of a distributed cache device applied to a management node provided by an embodiment of this specification;

[0036] Figure 8 It is a structural diagram of a distributed cache device applied to a client provided by an embodiment of this specification;

[0037] Fig. 9 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION

[0038] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.

[0039] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or each possible combination of one or more associated listed items.

[0040] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0041] First, the terms involved in one or more embodiments of this specification are explained.

[0042] Cache: a cache function module in the computing and storage architecture. For example, based on the principle of spatial and temporal locality of program access or IO access, a high-speed front-end cache storage medium such as Cache can be used to accelerate the reading and writing of the relatively slow back-end storage medium, thereby meeting the user's performance SLA requirements for computing and storage systems. Among them, SLA (Service Level Agreement) refers to a mutually recognized agreement or contract reached between the enterprise providing the service and the customer on the quality, level, performance, etc. of the service.

[0043] IO request: read / write request. I / O is the abbreviation of input / output, that is, input / output port. For the disk of the storage system, data can be read from the disk through the output port, or data can be written to the disk through the input port. Therefore, each read and write request is called an IO request, or IO for short.

[0044] Segment: a block device, such as a certain discontinuous address space of a disk, can be called an address space segment. For example, the capacity of a block device disk Disk x is 256GiB, the stripe is 128KiB, and Disk x is managed in segments on 8 storage nodes. Then, based on the 128KiB granularity of the stripe, the overall space of Disk x, 256GiB, can be evenly dispersed among the 8 storage service nodes. The Segment size managed by each storage node is 32GiB, and each storage node includes multiple discontinuous address space segments with a single capacity of 128KiB. Among them, the address space represents the size of memory occupied by any computer entity. For example, peripherals, files, servers, or a network computer. The address space includes physical space and virtual space.

[0045] See also Figure 1 , Figure 1 It is a structural diagram of a distributed cache system in the related art, specifically including: a host and multiple storage nodes;

[0046] The host is used to run projects A0 to An. Therefore, the host may include at least one client. In addition, a specified number of block devices may be allocated to the project to utilize the capacity of the block devices to process the read / write requests of the project. For example, disk D0 and disk D1 are allocated to project A0. On this basis, in order to improve the processing speed of read / write requests through distributed caching, the overall space of the disk, that is, the total capacity, may be divided into multiple stripes according to a preset stripe granularity, such as 128KiB: multiple discontinuous address space segments, and evenly distributed in multiple storage nodes. For example, the above Figure 1 Disk D0 of project A0, that is, Disk0, is divided into multiple discontinuous address space segments, which are distributed in storage node 0 to storage node m, namely: address space segment S0-0, address space segment S0-1, ... address space segment S0-m. Disk D1 is divided into: address space segment S1-0, address space segment S1-1, ... address space segment S1-m. Similarly, the disks of project A1 to project An, such as disks D2 to Dy, are similarly divided, the difference being that the divided disks are different. In this way, when the disk processes a read / write request of a project, the read / write request accesses the address space segment and accesses the cache resources, such as Cache, in the storage node to which the address space segment belongs.

[0047] exist Figure 1 In the distributed cache system shown in the figure, the number of read / write requests for different items is different, which may cause uneven number of read / write requests for accessing cache resources of different storage nodes, resulting in unbalanced load on storage nodes. Figure 1 ,The number of read / write requests for project An exceeds the threshold, the disk Dx is overloaded, and the number of read / write requests processed by the address space segments Sx-0 and Sx-1 of disk Dx: Segment x-0 and Segment x-1 exceeds the threshold, resulting in insufficient cache resources for storage nodes 0 and 1, and the cache hit rate of read / write requests processed by Disk x is low. And, Figure 1 The cache resources of each storage node in the system shown can be regarded as a high-speed performance layer, and the low-speed capacity of each storage node can be regarded as a low-speed capacity layer. When the hit rate of cache resources decreases, some read / write requests are converted to access the low-speed capacity, causing the performance of Disk x to drop sharply, or even drop to zero in a certain period of time in severe cases: the access hit rate is zero. This will greatly reduce the SLA of the project. However, there are relatively idle storage nodes in the distributed cache system, such as storage node m. Therefore, a more reliable solution is needed: a distributed cache system with more balanced utilization of cache resources.

[0048] To this end, in this specification, a distributed cache system is provided. This specification also involves a distributed cache method, a distributed cache device, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.

[0049] See also Figure 2 , Figure 2 This is a schematic diagram of a distributed cache system provided by an embodiment of this specification, which specifically includes:

[0050] A management node 202 , a plurality of storage nodes 206 storing cache resources, and a client 204 .

[0051] In specific applications, Figure 1 Similar to the host in the distributed cache system shown, the client 204 can be configured to run the target project. The number of target projects can be one or more, for example, it can be project A0 to project An. In addition, the structure of the storage node 206 can be set according to the specific application scenario, for example, the storage node 206 may include or not include a low-speed capacity layer. The management node 202 can specifically be one or more computing devices, which is reasonable and is not limited in this embodiment.

[0052] The management node 202 is configured to obtain the cache resource access index of each storage node 206, and determine the first storage node and the target address space segment that meet the preset overload condition, and the second storage node that meets the preset scheduling condition based on the cache resource access index of each storage node 206; send a creation request for the target address space segment to the second storage node, and after receiving a successful creation response message returned by the second storage node, send a mapping establishment request to the client.

[0053] In specific applications, the cache resource access index is generated by a read / write request accessing a cache resource in a storage node, and can characterize the utilization rate of the cache resource in the storage node. Exemplarily, the cache resource access index may include at least one of the following indicators: a node cache access index of a storage node, a segment cache access index of an address space segment to a storage node, and a cache resource hit index of an address space segment to a storage node. In addition, there may be multiple ways for the management node 202 to obtain the cache resource access index of each storage node 206. In order to facilitate understanding and reasonable layout, the cache resource access index and the method for obtaining the cache resource access index will be specifically described in the form of an optional embodiment.

[0054] Among them, the first storage node and the target address space segment meet the preset overload condition, indicating that the read / write request allocated to the target address space segment overloads the access to the cache resources in the first storage node. The second storage node meets the preset scheduling condition, indicating that the cache resources in the second storage node are relatively idle. Therefore, the read / write request to access the cache resources of the first storage node can be scheduled to the second storage node. To this end, the access path for the read / write request to access the cache resources: link mapping can be adjusted: a new link mapping between the target disk to which the target address space segment belongs, the target address space segment and the second storage node can be established.

[0055] The client 204 is configured to create a new link mapping of the target address space segment for the target disk after receiving the mapping establishment request, wherein the new link mapping is the target disk, the target address space segment created by the second storage node, and the link mapping between the second storage nodes.

[0056] In a specific application, the link mapping represents the access path of the read / write request to access the cache resource, and the read / write request can be sent to the corresponding address space segment for processing according to the link mapping. In addition, the processing can access the cache resource of the corresponding storage node according to the link mapping to improve the processing efficiency through the cache resource. Therefore, in an optional implementation, the client 204 is also configured as follows:

[0057] For a read / write request of a target project, determining a target disk for processing the read / write request;

[0058] Find a new link mapping containing the target disk;

[0059] According to the new link mapping, the read / write request is sent to the target address space segment created by the second storage node for processing.

[0060] The target disk may refer to a disk of a client running the target project. Therefore, determining the target disk for processing the read / write request may include: obtaining a project identifier included in the read / write request of the target project, and using the project identifier to search for the target disk corresponding to the target project from the pre-established correspondence between disks and projects. Figure 1 Similar to the distributed cache system shown in FIG. 1 , the relationship between the target disk and the target address space segment in this embodiment is: the target disk is divided to obtain multiple address space segments, and the target address space segment belongs to the multiple address space segments. The difference lies in the different distributed cache systems. In this way, the read / write request of this embodiment can access the cache resource through the new link mapping, ensuring the load balancing scheduling of the storage node and improving the balance of cache resource utilization.

[0061] In one embodiment of the present specification, read / write requests access cache resources according to link mapping. In this way, a new link mapping for load balancing scheduling can be established based on the load performance monitoring of the storage node; and then the read / write requests processed by the target address space segment are scheduled from the overloaded first storage node to the second storage node using the new link mapping for the target address space segment. Therefore, the read / write request that originally accessed the cache resources in the first storage node is converted to access the cache resources in the second storage node, achieving balanced scheduling of the storage node load and improving the balanced utilization of cache resources in the distributed cache system.

[0062] For ease of understanding, the following Figure 3 The application of the above distributed cache system is taken as an example to illustrate. Figure 3 , Figure 3 This is a flow chart of a distributed cache method applied to a distributed cache system provided by an embodiment of this specification, which may specifically include the following steps:

[0063] S302, the management node obtains the cache resource access index of each storage node;

[0064] S304, the management node determines a first storage node and a target address space segment that meet a preset overload condition, and a second storage node that meets a preset scheduling condition based on the cache resource access index of each storage node;

[0065] S306, the management node sends a creation request for the target address space segment to the second storage node;

[0066] S308, the second storage node returns a response message of successful creation to the management node;

[0067] S310, the management node sends a mapping establishment request to the client;

[0068] S312, the client creates a new link mapping of the target address space segment for the target disk, wherein the new link mapping is a link mapping between the target disk, the target address space segment created by the second storage node, and the second storage node.

[0069] The technical solution of this embodiment and the technical solution of the above-mentioned distributed cache system belong to the same concept. For details not described in detail in this embodiment, please refer to the description of the technical solution of the above-mentioned distributed cache system.

[0070] In an optional implementation, the cache resource access indicator includes: a node cache access indicator and a segment cache access indicator; the preset overload condition includes: a first node cache access threshold and a segment cache access condition; the preset scheduling condition includes: a second node cache access threshold;

[0071] The management node 202 is further configured as follows:

[0072] Determine, from each storage node, a first storage node whose node cache access index is greater than a first node cache access threshold, and a second storage node whose node cache access index is less than a second node cache access threshold;

[0073] According to the segment cache access indicator, a target address space segment that meets the segment cache access condition is determined among the address space segments of the first storage node.

[0074] Exemplarily, the node cache access indicator cache_occupancy of storage node 1 is greater than the first node cache access threshold χ, and the first node cache access threshold may be 90%, which may be modified through configuration files or the like according to specific application requirements. Therefore, storage node 1 may be determined as the first storage node. Furthermore, the node cache access indicator cache_occupancy of storage node m is less than the second node cache access threshold γ, and the second node cache access threshold may be 60%, which may be modified through configuration files or the like according to specific application requirements. Therefore, storage node m may be determined as the second storage node. In this way, this embodiment realizes the determination of the first storage node, the second storage node, and the target address space segment through diversified cache resource access indicators and corresponding conditions.

[0075] Furthermore, the segment cache access conditions may be various, which are described in detail in the form of optional embodiments.

[0076] In an optional implementation, the segment cache access condition includes: a segment cache access threshold and a cache hit threshold; the cache resource access index also includes: a cache resource hit index;

[0077] The management node is further configured as follows:

[0078] From each address space segment of the first storage node, a target address space segment whose segment cache access index is smaller than the segment cache access threshold and whose cache resource hit index is smaller than the cache hit threshold is determined.

[0079] Exemplarily, the segment cache hit indicator segment_cache_hit of the address space segment Segment x-1 is less than the segment cache hit threshold α, the cache hit threshold may be 30%, and may be modified through configuration files, etc. according to specific application requirements; and, the segment cache access indicator segment_cache_occupancy of the address space segment Segment x-1 is less than the cache access threshold β, and the cache access threshold may be 4%, and may be modified through configuration files, etc. according to specific application requirements.

[0080] This embodiment determines the target address space segment through the segment cache access index and the cache resource hit index, which can reduce the imbalanced situation that the cache resource hit index of the read / write request corresponding to the address space segment is greater than the cache hit threshold, while the number of read / write requests is relatively large, resulting in the segment cache access index being less than the segment cache access threshold: the cache resources are concentratedly allocated to a certain address space segment, and the address space segments other than the address space segment lack or even have no cache resources to access. Therefore, this embodiment can further improve the balance of cache resource utilization.

[0081] In another optional implementation, the segment cache access condition includes: a segment cache access threshold or a cache hit threshold; the cache resource access index also includes: a cache resource hit index;

[0082] The management node is further configured as follows:

[0083] From each address space segment of the first storage node, a target address space segment whose segment cache access index is smaller than a segment cache access threshold or whose cache resource hit index is smaller than a cache hit threshold is determined.

[0084] This embodiment can determine the target address space segment using one indicator and one condition, thereby improving the efficiency of determining the target address space segment and reducing the overload problem to a certain extent.

[0085] In an optional implementation, the management node is further configured to:

[0086] Broadcasting a request to obtain cache resource access indicators to each storage node;

[0087] The storage nodes are further configured as follows:

[0088] Determine the cache resource access index, generate response information including the cache resource access index, and send the response information to the management node.

[0089] Exemplarily, CacheMaster broadcasts Ping RPCRequest to CacheServer of each storage service node, and CacheServer returns cache resource access indicators in Ping RPC Response. Among them, ping (Packet Internet Groper) is an Internet packet explorer, a program used to test the amount of network connections; RPC (Remote Procedure Call, Remote Procedure Call Protocol). In addition, the specific determination method of cache resource access indicators can be obtained by statistically analyzing cache resource access parameters. In order to facilitate understanding and reasonable layout, it will be specifically explained in the form of optional embodiments later.

[0090] In another optional implementation, the management node is further configured to:

[0091] Broadcasting a request to obtain cache resource access indicators to each storage node;

[0092] The storage nodes are further configured as follows:

[0093] Determine cache resource access parameters, generate response information including the cache resource access parameters, and send the response information to the management node;

[0094] The management node is further configured as follows:

[0095] The cache resource access parameters in the response information are counted to obtain the cache resource access index.

[0096] In this embodiment, the management node performs statistics on cache resource access parameters, which can reduce the occupation of storage node resources, further improve the performance of storage nodes, and facilitate the utilization of cache resources.

[0097] In an optional implementation, the cache resource access index includes at least one of the following indexes: a node cache access index of a storage node, a segment cache access index of an address space segment to a storage node, and a cache resource hit index of an address space segment to a storage node;

[0098] The node cache access indicators include: the ratio of the storage node's cache resource access capacity to the storage node's total cache resource capacity;

[0099] The segment cache access indicators include: the ratio of the address space segment’s access capacity to the storage node’s cache resources to the address space segment’s capacity;

[0100] The cache resource hit index includes: the ratio of the number of cache resource hits of the storage node by the read / write requests processed by the address space segment to the total number of read / write requests processed by the space segment.

[0101] This embodiment provides a method for determining the node cache access index of the storage node, the segment cache access index of the address space segment to the storage node, and the cache resource hit index of the address space segment to the storage node. The parameters in each determination method can be regarded as cache resource access parameters. Exemplarily, the node cache access index includes: the cache resource access capacity of the storage node, and the ratio of the total cache resource capacity of the storage node: the overall cache resource occupancy rate of any storage node cache_occupancy = the cache resource occupancy capacity of any storage node ÷ the total cache resource capacity. The segment cache access index includes: the cache resource access capacity of the address space segment to the storage node, and the ratio of the capacity of the address space segment: the cache resource occupancy ratio of each segment segment_cache_occupancy = the cache resource occupancy capacity of the segment (the specific occupancy of the cache, the amount of cache applied after an IO request) ÷ the segment capacity (the size of the segment itself). The cache resource hit indicators include: the number of times the read / write requests processed by the address space segment hit the cache resources of the storage node, and the ratio of the total number of read / write requests processed by the space segment: each segment's own segment_cache_hit = the number of times the segment's IO request hits the cache ÷ the total number of segment's IO request.

[0102] In an optional implementation, the management node 202 is further configured to:

[0103] Sending a deletion request for the target address space segment to the first storage node;

[0104] The first storage node is configured as:

[0105] According to the deletion request, the target address space segment in the first storage node is deleted, and a deletion success feedback for the target address space segment is returned to the management node.

[0106] For example, the CacheServer of storage node 1 receives a request to destroy Segment x-1, and after the destruction is completed, it returns a feedback to the CacheMaster that the Segment has been destroyed successfully. Destruction is deletion in this embodiment. In this way, the storage resources occupied by useless link mappings in the client can be saved. In addition, the access errors that may be caused by useless link mappings can be reduced.

[0107] The following combination Figure 4 , taking the application of the distributed cache system provided in this specification as an example, the distributed cache method is further described. Figure 4 An example diagram of an application scenario of a distributed cache system provided by an embodiment of this specification is shown. Figure 4 The distributed cache system shown includes: MultiClient: multi-client, which is mainly responsible for maintaining and managing the data link mapping from the host to each segment of each storage node; CacheMaster: Cache resource load balancing scheduling center, that is, the management node, which is mainly responsible for monitoring the overall cache resource occupancy rate of each storage service node, the cache resource occupancy and hit rate of the related segments. When the above three items meet certain conditions (explained in the following process description), the related segments will initiate balanced scheduling between storage nodes; CacheServer: Cache function service module, used to provide cache services, mainly responsible for providing IO acceleration capabilities for the segments of storage nodes.

[0108] Application Figure 4 The distributed cache method of the distributed cache system shown specifically includes the following steps:

[0109] S1, CacheMaster broadcasts Ping RPC Request (ping (Packet Internet Groper) is an Internet packet explorer, a program used to test the amount of network connections; RPC (Remote Procedure Call) remote procedure call protocol) to the CacheServer of each storage service node, and the CacheServer returns the overall cache resource occupancy cache_occupancy of any storage node, the cache resource occupancy ratio segment_cache_occupancy of each Segment, and the hit rate segment_cache_hit in the Ping RPC Response; the calculation method of the above key information is as follows: the overall cache resource occupancy of any storage node cache_occupancy = cache resource occupancy capacity of any storage node ÷ total cache resource capacity; the cache resource occupancy ratio of each Segment segment_cache_occupancy = cache resource occupancy capacity of the segment ÷ segment capacity; the segment_cache_hit of each Segment = the number of times the segment's IO request hits the cache ÷ the total number of segment's IO requests.

[0110] S2, the node cache access index cache_occupancy of storage node 1 is greater than the first node cache access threshold χ (the default value is 90%, configuration modification is supported), and the segment_cache_hit of Segment x-1 is lower than a certain threshold α (the default value is 30%, configuration modification is supported), and the segment_cache_occupancy of Segment x-1 is lower than a certain threshold β (the default value is 4%, configuration modification is supported); at the same time, the node cache access index cache_occupancy of storage node m is less than the second node cache access threshold γ (the default value is 60%, configuration modification is supported).

[0111] S3: CacheMaster receives the cache occupancy and segment hit rate information returned by each CacheServer. If it detects that the returned indicators meet the conditions in S2, it prepares to initiate balanced scheduling for Segment x-1.

[0112] S4, CacheMaster sends a request to storage node m to create a new Segment x-1;

[0113] S5: CacheServer of storage node m receives the request to create Segment x-1. After the creation is completed, it returns a message to CacheMaster that the Segment has been created successfully.

[0114] S6, after receiving the response of successful creation of Segment x-1 returned by CacheServer of storage node m, CacheMaster sends a new link mapping establishment request of Segment x-1 of Disk x to MultiClient of the host;

[0115] S7, MultiClient creates a new link mapping for Segment x-1 for Disk x and updates the link mapping information. The new related IO will be sent to the new Segment x-1 located at storage node m.

[0116] S8, CacheMaster sends a deletion request for the original Segment x-1 to the CacheServer of storage node 1;

[0117] S9, the CacheServer of storage node 1 receives the destruction request of Segment x-1, and after the destruction is completed, it returns the feedback of successful destruction of the Segment to the CacheMaster.

[0118] See also Figure 5 , Figure 5 A flowchart of a distributed caching method applied to a management node provided by an embodiment of the present specification is shown, which specifically includes the following steps.

[0119] S502, obtaining cache resource access indicators of each storage node;

[0120] S504, based on the cache resource access index of each storage node, determining a first storage node and a target address space segment that meet a preset overload condition, and a second storage node that meets a preset scheduling condition;

[0121] S506, sending a creation request for the target address space segment to the second storage node;

[0122] S508, after receiving the successful creation response message returned by the second storage node, sends a mapping establishment request to the client, wherein the mapping establishment request is used by the client to create a new link mapping of the target address space segment for the target disk after receiving the mapping establishment request, and the new link mapping is the target disk, the target address space segment created by the second storage node, and the link mapping between the second storage node.

[0123] In one embodiment of the present specification, the new link mapping is a link mapping between the target disk, the target address space segment created by the second storage node, and the second storage node. And, the read / write request accesses the cache resource according to the link mapping. In this way, based on the load performance monitoring of the storage node, a new link mapping for load balancing scheduling can be established; and then the read / write request processed by the target address space segment can be scheduled from the overloaded first storage node to the second storage node using the new link mapping for the target address space segment. Therefore, the read / write request that originally accessed the cache resource in the first storage node is converted to access the cache resource in the second storage node, thereby achieving balanced scheduling of the storage node load and improving the balanced utilization of cache resources in the distributed cache system.

[0124] The above is a schematic scheme of a distributed cache method of this embodiment. It should be noted that the technical scheme of the distributed cache method and the technical scheme of the distributed cache system described above are of the same concept, and the details not described in detail in the technical scheme of the distributed cache method can be found in the description of the technical scheme of the distributed cache system described above.

[0125] See also Figure 6 , Figure 6 A flow chart of a distributed caching method applied to a client provided according to an embodiment of the present specification is shown, which specifically includes the following steps.

[0126] S602, receiving a mapping establishment request sent by the management node, wherein the mapping establishment is that the management node obtains the cache resource access index of each storage node, determines the first storage node and the target address space segment that meet the preset overload condition, and the second storage node that meets the preset scheduling condition based on the cache resource access index of each storage node, and sends a creation request for the target address space segment to the second storage node, and sends after receiving a creation success response message returned by the second storage node;

[0127] S604: Create a new link mapping of the target address space segment for the target disk according to the mapping establishment request, wherein the new link mapping is a link mapping between the target disk, the target address space segment created by the second storage node, and the second storage node.

[0128] In one embodiment of the present specification, the new link mapping is a link mapping between the target disk, the target address space segment created by the second storage node, and the second storage node. And, the read / write request accesses the cache resource according to the link mapping. In this way, based on the load performance monitoring of the storage node, a new link mapping for load balancing scheduling can be established; and then the read / write request processed by the target address space segment can be scheduled from the overloaded first storage node to the second storage node using the new link mapping for the target address space segment. Therefore, the read / write request that originally accessed the cache resource in the first storage node is converted to access the cache resource in the second storage node, thereby achieving balanced scheduling of the storage node load and improving the balanced utilization of cache resources in the distributed cache system.

[0129] The above is a schematic scheme of a distributed cache method of this embodiment. It should be noted that the technical scheme of the distributed cache method and the technical scheme of the distributed cache system described above are of the same concept, and the details not described in detail in the technical scheme of the distributed cache method can be found in the description of the technical scheme of the distributed cache system described above.

[0130] Corresponding to the above method embodiment, this specification also provides a distributed cache device embodiment, Figure 7 FIG. 1 shows a schematic diagram of a distributed cache device applied to a management node according to an embodiment of the present specification. Figure 7 As shown, the device comprises:

[0131] The load performance monitoring module 702 is configured to obtain a cache resource access index of each storage node; based on the cache resource access index of each storage node, determine a first storage node and a target address space segment that meet a preset overload condition, and a second storage node that meets a preset scheduling condition;

[0132] The load balancing scheduling module 704 is configured to send a creation request for the target address space segment to the second storage node; after receiving a successful creation response message returned by the second storage node, send a mapping establishment request to the client, wherein the mapping establishment request is used by the client to create a new link mapping of the target address space segment for the target disk after receiving the mapping establishment request, and the new link mapping is the target disk, the target address space segment created by the second storage node, and the link mapping between the second storage node.

[0133] In one embodiment of the present specification, the new link mapping is a link mapping between the target disk, the target address space segment created by the second storage node, and the second storage node. And, the read / write request accesses the cache resource according to the link mapping. In this way, based on the load performance monitoring of the storage node, a new link mapping for load balancing scheduling can be established; and then the read / write request processed by the target address space segment can be scheduled from the overloaded first storage node to the second storage node using the new link mapping for the target address space segment. Therefore, the read / write request that originally accessed the cache resource in the first storage node is converted to access the cache resource in the second storage node, thereby achieving balanced scheduling of the storage node load and improving the balanced utilization of cache resources in the distributed cache system.

[0134] The above is a schematic scheme of a distributed cache device of this embodiment. It should be noted that the technical scheme of the distributed cache device and the technical scheme of the distributed cache method applied to the management node above belong to the same concept, and the details not described in detail in the technical scheme of the distributed cache device can be found in the description of the technical scheme of the distributed cache method applied to the management node above.

[0135] Figure 8 FIG. 1 shows a schematic diagram of a distributed cache device applied to a client provided by an embodiment of the present specification. Figure 8 As shown, the device comprises:

[0136] The request receiving module 802 is configured to receive a mapping establishment request sent by the management node, wherein the mapping establishment is that the management node obtains the cache resource access index of each storage node, determines the first storage node and the target address space segment that meet the preset overload condition, and the second storage node that meets the preset scheduling condition based on the cache resource access index of each storage node, and sends a creation request for the target address space segment to the second storage node, and sends after receiving a creation success response message returned by the second storage node;

[0137] The mapping establishment module 804 is configured to create a new link mapping of the target address space segment for the target disk according to the mapping establishment request, wherein the new link mapping is the target disk, the target address space segment created by the second storage node, and the link mapping between the second storage nodes.

[0138] In one embodiment of the present specification, the new link mapping is a link mapping between the target disk, the target address space segment created by the second storage node, and the second storage node. And, the read / write request accesses the cache resource according to the link mapping. In this way, based on the load performance monitoring of the storage node, a new link mapping for load balancing scheduling can be established; and then the read / write request processed by the target address space segment can be scheduled from the overloaded first storage node to the second storage node using the new link mapping for the target address space segment. Therefore, the read / write request that originally accessed the cache resource in the first storage node is converted to access the cache resource in the second storage node, thereby achieving balanced scheduling of the storage node load and improving the balanced utilization of cache resources in the distributed cache system.

[0139] The above is a schematic scheme of a distributed cache device applied to a client in this embodiment. It should be noted that the technical scheme of the distributed cache device and the technical scheme of the distributed cache method applied to the client belong to the same concept, and the details not described in detail in the technical scheme of the distributed cache device can be found in the description of the technical scheme of the distributed cache method applied to the client.

[0140] Fig. 9 The block diagram of a computing device according to an embodiment of the present specification is shown. The components of the computing device 900 include but are not limited to a memory 910 and a processor 920. The processor 920 is connected to the memory 910 via a bus 930, and the database 950 is used to store data.

[0141] The computing device 900 also includes an access device 940 that enables the computing device 900 to communicate via one or more networks 960. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 940 may include one or more of any type of network interface (e.g., a network interface card (NIC)) of wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world-wide interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

[0142] In one embodiment of the present specification, the above components of the computing device 900 and Fig. 9 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Fig. 9 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0143] The computing device 900 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 900 may also be a mobile or stationary server.

[0144] The processor 920 is used to execute the following computer executable instructions, which implement the steps of the above-mentioned distributed cache method when executed by the processor.

[0145] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above distributed cache method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above distributed cache method.

[0146] An embodiment of the present specification further provides a computer-readable storage medium storing computer-executable instructions, which can implement the steps of the above-mentioned distributed caching method when executed by a processor.

[0147] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above-mentioned distributed caching method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above-mentioned distributed caching method.

[0148] An embodiment of the present specification further provides a computer program, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned distributed cache method.

[0149] The above is a schematic scheme of a computer program of this embodiment. It should be noted that the technical scheme of the computer program and the technical scheme of the above distributed cache method belong to the same concept, and the details not described in detail in the technical scheme of the computer program can be referred to the description of the technical scheme of the above distributed cache method.

[0150] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0151] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0152] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.

[0153] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0154] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe the details of each in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is limited only by the claims and their full scope and equivalents.

Claims

1. A distributed cache system, comprising: Management node, multiple storage nodes storing cache resources, and clients; The management node is configured to obtain the cache resource access index of each storage node, and determine the first storage node and the target address space segment that meet the preset overload condition, and the second storage node that meets the preset scheduling condition based on the cache resource access index of each storage node, wherein the cache resource access index includes: a node cache access index, a segment cache access index, and a cache resource hit index, the node cache access index of the first storage node is greater than the first node cache access threshold, the node cache access index of the second storage node is less than the second node cache access threshold, and the target address space segment is determined according to the segment cache access index and the cache resource hit index; send a creation request for the target address space segment to the second storage node, and after receiving a successful creation response message returned by the second storage node, send a mapping establishment request to the client; The client is configured to create a new link mapping of the target address space segment for the target disk after receiving the mapping establishment request, wherein the new link mapping is the target disk, the target address space segment created by the second storage node, and the link mapping between the second storage node.

2. The system according to claim 1, wherein the preset overload condition comprises: first node cache access threshold and segment cache access condition; The preset scheduling conditions include: a second node cache access threshold; The management node is further configured as follows: Determine, from the storage nodes, a first storage node whose node cache access index is greater than the first node cache access threshold, and a second storage node whose node cache access index is less than the second node cache access threshold; According to the segment cache access indicator, a target address space segment that meets the segment cache access condition is determined among the address space segments of the first storage node.

3. The system according to claim 2, wherein the segment cache access condition comprises: Segment cache access threshold and cache hit threshold; The management node is further configured as follows: A target address space segment whose segment cache access index is smaller than the segment cache access threshold and whose cache resource hit index is smaller than the cache hit threshold is determined from each address space segment of the first storage node.

4. According to the system according to any one of claims 1 to 3, the management node is further configured to: Broadcasting an acquisition request for the cache resource access indicator to each storage node; The storage node is further configured as: Determine the cache resource access indicator, generate response information including the cache resource access indicator, and send the response information to the management node.

5. The system according to claim 1, wherein the cache resource access index comprises at least one of the following indexes: a node cache access index of a storage node, a segment cache access index of an address space segment to a storage node, and a cache resource hit index of an address space segment to a storage node; The node cache access index includes: The ratio of the cache resource access capacity of the storage node to the total cache resource capacity of the storage node; The segment cache access index includes: a ratio of the cache resource access capacity of the address space segment to the storage node to the capacity of the address space segment; The cache resource hit index includes: the ratio of the number of cache resource hits of the storage node by the read / write requests processed by the address space segment to the total number of read / write requests processed by the space segment.

6. The system according to any one of claims 1 to 3 and 5, wherein the management node is further configured to: Sending a deletion request for the target address space segment to the first storage node; The first storage node is configured as: According to the deletion request, the target address space segment in the first storage node is deleted, and a deletion success feedback for the target address space segment is returned to the management node.

7. The system according to any one of claims 1 to 3 and 5, wherein the client is further configured to: For a read / write request of a target project, determining a target disk for processing the read / write request; Find the new link mapping containing the target disk; According to the new link mapping, the read / write request is sent to the target address space segment created by the second storage node for processing.

8. A distributed caching method, applied to a management node, the method comprising: Obtain cache resource access indicators for each storage node; Based on the cache resource access index of each storage node, determine the first storage node and the target address space segment that meet the preset overload condition, and the second storage node that meets the preset scheduling condition, wherein the cache resource access index includes: a node cache access index, a segment cache access index, and a cache resource hit index, the node cache access index of the first storage node is greater than a first node cache access threshold, the node cache access index of the second storage node is less than a second node cache access threshold, and the target address space segment is determined according to the segment cache access index and the cache resource hit index; Sending a creation request for the target address space segment to the second storage node; After receiving a successful creation response message returned by the second storage node, a mapping establishment request is sent to the client, wherein the mapping establishment request is used by the client to create a new link mapping of the target address space segment for the target disk after receiving the mapping establishment request, and the new link mapping is the target disk, the target address space segment created by the second storage node, and the link mapping between the second storage node.

9. A distributed caching method, applied to a client, the method comprising: Receive a mapping establishment request sent by a management node, wherein the mapping establishment is for the management node to obtain cache resource access indicators of each storage node, and based on the cache resource access indicators of each storage node, determine a first storage node and a target address space segment that meet a preset overload condition, and a second storage node that meets a preset scheduling condition, wherein the cache resource access indicator includes: a node cache access indicator, a segment cache access indicator, and a cache resource hit indicator, the node cache access indicator of the first storage node is greater than a first node cache access threshold, the node cache access indicator of the second storage node is less than a second node cache access threshold, the target address space segment is determined according to the segment cache access indicator and the cache resource hit indicator, and send a creation request for the target address space segment to the second storage node, and send after receiving a successful creation response message returned by the second storage node; According to the mapping establishment request, a new link mapping of the target address space segment is created for the target disk, wherein the new link mapping is the target disk, the target address space segment created by the second storage node, and the link mapping between the second storage node.

10. A distributed cache device, applied to a management node, comprising: A load performance monitoring module is configured to obtain cache resource access indicators of each storage node; Based on the cache resource access index of each storage node, determine the first storage node and the target address space segment that meet the preset overload condition, and the second storage node that meets the preset scheduling condition, wherein the cache resource access index includes: a node cache access index, a segment cache access index, and a cache resource hit index, the node cache access index of the first storage node is greater than a first node cache access threshold, the node cache access index of the second storage node is less than a second node cache access threshold, and the target address space segment is determined according to the segment cache access index and the cache resource hit index; The load balancing scheduling module is configured to send a creation request for the target address space segment to the second storage node; after receiving a successful creation response message returned by the second storage node, send a mapping establishment request to the client, wherein the mapping establishment request is used by the client to create a new link mapping of the target address space segment for the target disk after receiving the mapping establishment request, and the new link mapping is the target disk, the target address space segment created by the second storage node, and the link mapping between the second storage node.

11. A distributed cache device, applied to a client, comprising: A request receiving module is configured to receive a mapping establishment request sent by a management node, wherein the mapping establishment is that the management node obtains the cache resource access index of each storage node, and determines the first storage node and the target address space segment that meet the preset overload condition, and the second storage node that meets the preset scheduling condition based on the cache resource access index of each storage node, wherein the cache resource access index includes: a node cache access index, a segment cache access index, and a cache resource hit index, the node cache access index of the first storage node is greater than the first node cache access threshold, the node cache access index of the second storage node is less than the second node cache access threshold, the target address space segment is determined according to the segment cache access index and the cache resource hit index, and a creation request for the target address space segment is sent to the second storage node, and is sent after receiving a response message of successful creation returned by the second storage node; A mapping establishment module is configured to create a new link mapping of the target address space segment for the target disk according to the mapping establishment request, wherein the new link mapping is the target disk, the target address space segment created by the second storage node, and the link mapping between the second storage nodes.

12. A computing device comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the distributed caching method described in any one of claims 8 to 9 are implemented.

13. A computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the distributed caching method according to any one of claims 8 to 9.

Citation Information

Patent Citations

  • Load balancing method, system and device

    CN113377530A