Flow control method of cloud database and related system

The traffic control system dynamically adjusts the log generation rate of the cloud database, which solves the problem of poor current limiting effect of the cloud database when the storage pool is overloaded, achieves high availability and adaptability, and ensures stable business operation.

CN118540279APending Publication Date: 2024-08-23HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD

Patent Information

Application Number
CN202310125751.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-16
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

Cloud databases cannot effectively sense business pressure when the storage pool is overloaded, resulting in poor current limiting effects and affecting user experience. Existing current limiting strategies cannot adapt to different business models and lack high availability.

Method used

Use a traffic control system to generate write traffic control policies by monitoring log cache usage information, dynamically adjust the log generation rate, achieve hierarchical current limiting and dynamic load balancing for the business, avoid storage pool overload, and support fine-grained current limiting and multi-level feedback. mechanism, no need to pre-configure IOPS/MBPS quotas.

Benefits of technology

It realizes dynamic load balancing of the cloud database when the storage pool is overloaded, avoiding business damage, adapting to different business models, improving the high availability and current limiting accuracy of the system, and ensuring user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118540279A
    Figure CN118540279A
Patent Text Reader

Abstract

The invention provides a flow control method of a cloud database, which is executed by a flow control system, the flow control system comprises a plurality of computing nodes and a storage pool shared by the plurality of computing nodes, each computing node in the plurality of computing nodes operates an instance of the cloud database, and the flow control system is provided with a first log cache. The first log cache is used for caching logs which are generated when an instance of a cloud database receives a database write request and are to be redistributed to a storage pool, and the method comprises the steps that a computing node monitors use information of the first log cache, then the computing node generates a write flow control strategy according to the use information of the first log cache, and the write flow control strategy is used for redistributing the log to the storage pool; and then the computing node executes the write flow control strategy, so that the log generation rate of the instance of the cloud database is not greater than the maximum generation rate or the generation rate is adjusted according to the adjustment amount. According to the method, hierarchical flow limiting and dynamic flow limiting can be carried out on services, damage to upper-layer services caused by overload of a storage pool is avoided, and high availability is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of cloud databases, and in particular to a flow control method, system, computing device cluster, computer-readable storage medium, and computer program product for a cloud database. Background Art

[0002] With the continuous development of cloud computing technology, cloud databases have emerged. Cloud databases usually refer to databases that run on cloud computing platforms, and access to the database is provided as a service. Users can purchase cloud computing equipment provided by cloud computing platforms, such as virtual machines, and then use the virtual machines to create cloud database instances to run the database independently on the cloud. Users can also purchase access to cloud databases maintained by cloud database providers, thereby creating cloud database instances on cloud computing platforms.

[0003] Considering the utilization rate of storage resources, cloud database instances can share storage resources. Specifically, multiple storage nodes can form a storage pool, and cloud database instances can be run on different computing nodes. The cloud database instances share the storage pool. If the cloud database instance cannot effectively sense the business pressure of the underlying storage and limit the business flow, when the business pressure of the instance is too high and the storage node is overloaded, it may cause the storage pool to fail and be unable to provide services to the outside world, which in turn may cause damage to the business of all instances sharing the storage pool.

[0004] The industry urgently needs a flow control mechanism that enables computing nodes to dynamically protect storage loads under different business pressures to avoid business damage and affect user experience. Summary of the invention

[0005] The present application provides a flow control method for a cloud database, which can perform hierarchical flow control and dynamic flow control on services, avoid damage to upper-layer services due to storage pool overload, and has high availability. The present application also provides a system, a computing device cluster, a computer-readable storage medium, and a computer program product corresponding to the above method.

[0006] In the first aspect, the present application provides a method for controlling the flow of a cloud database. The method can be executed by a flow control system. The flow control system can be a software system, which is deployed in a computing device cluster, and the computing device cluster executes the program code of the flow control system, thereby executing the flow control method of the cloud database of the present application. The flow control system can also be a hardware system, for example, the flow control system can be a computing device cluster with a flow control function, and when the flow control system is running, the flow control method of the cloud database of the present application is executed.

[0007] The traffic control system may include multiple computing nodes and a storage pool shared by the multiple computing nodes. Each of the multiple computing nodes runs an instance of a cloud database. The traffic control system is provided with a first log cache, which is used to cache logs generated by the instance of the cloud database when receiving a database write request and to be redistributed to the storage pool.

[0008] Specifically, the computing node can monitor the usage information of the first log cache, which includes the overall usage rate. The computing node then generates a write traffic control strategy based on the usage information of the first log cache, wherein the write traffic control strategy includes the maximum generation rate of the instance of the cloud database determined based on the overall usage rate or the adjustment amount of the generation rate (for example, an adjustment ratio). The computing node then executes the above-mentioned write traffic control strategy to ensure that the rate at which the instance of the cloud database generates logs is not greater than the maximum generation rate or the generation rate is adjusted according to the adjustment amount.

[0009] The method performs hierarchical flow control on services according to the overall usage rate of the first log cache to ensure a dynamic balance between the generation and consumption of logs, thereby achieving dynamic flow control and avoiding damage to upper-layer services due to overload of the underlying storage pool during the operation of the cloud database instance. It solves the problem that the rule-based flow control strategy cannot perceive the storage pool status, resulting in poor flow control effect. Moreover, the method does not need to set IOPS / MBPS quotas for tenants in advance, can adapt to different business models, and has high availability.

[0010] In some possible implementations, the first log cache may include multiple shards, and the usage information of the first log cache may further include the accumulated amount of logs to be sent of at least one shard among the multiple shards. The computing node may determine the maximum generation rate or the adjustment amount of the generation rate of the instance of the cloud database according to the overall usage rate, and then, according to the accumulated amount of logs to be sent of at least one shard, split the maximum generation rate or the adjustment amount of the instance of the cloud database into the maximum generation rates or the adjustment amounts of the instance of the cloud database for multiple business tables.

[0011] This method can implement fine-grained flow control on the business by splitting the log cache into multiple shards. For example, flow control can be performed at the tenant level, instance level, or table level, thereby making full use of system resources.

[0012] In some possible implementations, the computing node also receives weights of multiple business tables configured by the user, and then splits the maximum generation rate or adjustment amount of the cloud database instance into the maximum generation rate or adjustment amount of the cloud database instance for multiple business tables based on the accumulated amount of logs to be sent of at least one shard and the weights of the multiple business tables.

[0013] This method allows users to configure weights for business tables and adjust the maximum generation rate or adjustment amount based on the weights, thereby effectively protecting users' important businesses on the basis of precise flow control.

[0014] In some possible implementations, the computing node may also receive a user-configured filling time threshold and a filling amount threshold for the first log cache. When the filling time of the first log cache reaches the filling time threshold, or the filling amount of the first log cache reaches the filling amount threshold, the computing node may write the log from the first log cache to at least one storage node in the storage pool.

[0015] This method can aggregate I / Os, thereby ensuring that logs in time periods with sparse I / Os can be persisted in a timely manner and avoiding log cache overflows in time periods with dense I / Os.

[0016] In some possible implementations, the computing node may monitor the processing capacity of at least one storage node in the storage pool, and then adjust the write rate of the first log cache to the at least one storage node according to the change of the processing capacity of the at least one storage node. The method can dynamically adjust the write rate of the storage node according to the change of the processing capacity of the storage node, thereby realizing dynamic flow control when the storage capacity changes.

[0017] In some possible implementations, the computing node can adjust the write rate of logs corresponding to different business tables from the first log cache to the storage node according to the weights of different business tables belonging to the same storage node. This method can comprehensively consider the weights of storage nodes and business tables, thereby effectively protecting important businesses when storage capacity changes.

[0018] In some possible implementations, the computing node may also smooth the processing capacity of at least one storage node through a sliding window, and adjust the write rate of the first log cache to the at least one storage node according to the change in the processing capacity after the smoothing. This method can achieve smooth processing of business fluctuations through a sliding window.

[0019] In some possible implementations, the computing node can also receive an over-issuance threshold configured by the user. When the accumulated amount of logs to be sent to the target node in at least one storage node is greater than the processing capacity of the target node, the logs to be sent are sent to the target node according to the over-issuance threshold. This method allows a certain amount of log over-issuance, and by configuring the over-issuance threshold, it can cope with traffic peaks.

[0020] In some possible implementations, when the target node's accumulated logs to be sent in the next sliding window are still greater than the target node's processing capacity, the computing node can add the database write request to the retry queue. This method processes the logs through the retry queue when the log over-sending exceeds the threshold and the logs to be sent still exceed the storage capacity, thereby protecting the storage node and achieving smooth operation of the business.

[0021] In some possible implementations, a computing node may receive a flow control status fed back by at least one storage node, wherein the flow control status includes one or more of the number of retransmissions, the amount of retransmission logs, and the storage node to which the retransmission logs are to be written. The computing node may generate a write flow control strategy based on usage information of the first log cache and the flow control status fed back by at least one storage node.

[0022] This method implements a multi-level feedback mechanism by feeding back the flow control status through the storage nodes of the storage pool, thus ensuring that the generation and consumption of logs are dynamically balanced.

[0023] In some possible implementations, the traffic control system is provided with a shared memory queue, which is used to store database read requests received by instances of the cloud database. The computing node can monitor usage information of the shared memory queue and a return code of at least one storage node in the storage pool, and then generate a read traffic control strategy based on the usage information and the return code of the shared memory queue, and execute the read traffic control strategy.

[0024] This method can use different flow control strategies for read services and write services respectively, adapt to read and write resource consumption, and achieve timely flow control and timely release of flow control.

[0025] In some possible implementations, the flow control system is provided with storage node replica information to cache storage node replica status information. The computing node can generate a flow control strategy based on the replica status information, thereby limiting the flow of the abnormal storage node when the storage node where the replica is located is abnormal.

[0026] In some possible implementations, computing nodes can monitor the usage information of log cache through kernel points, and achieve lightweight monitoring by performing targeted points on the kernel.

[0027] In a second aspect, the present application provides a flow control system. The system includes a plurality of computing nodes and a storage pool shared by the plurality of computing nodes, each of the plurality of computing nodes runs an instance of a cloud database, and the flow control system is provided with a first log cache, the first log cache being used to cache logs generated by the instance of the cloud database when receiving a database write request and to be redistributed to the storage pool;

[0028] The computing node is used to monitor usage information of the first log cache, where the usage information of the first log cache includes an overall usage rate;

[0029] The computing node is further configured to generate a write traffic control strategy according to the usage information of the first log cache, wherein the write traffic control strategy includes a maximum generation rate or an adjustment amount of the generation rate of the instance of the cloud database determined according to the overall usage rate;

[0030] The computing node is further used to execute the write traffic control strategy so that the rate at which the instance of the cloud database generates the log is not greater than the maximum generation rate or the generation rate is adjusted according to the adjustment amount.

[0031] In some possible implementations, the first log cache includes multiple shards, and the usage information of the first log cache also includes an accumulated amount of logs to be sent of at least one shard among the multiple shards;

[0032] The computing node is specifically used for:

[0033] Determining a maximum generation rate or an adjustment amount of the generation rate of the instance of the cloud database according to the overall usage rate;

[0034] According to the accumulated amount of logs to be sent of the at least one shard, the maximum generation rate or adjustment amount of the instance of the cloud database is split into maximum generation rates or adjustment amounts of the instance of the cloud database for multiple business tables.

[0035] In some possible implementations, the computing node is further used for:

[0036] Receive weights of multiple business tables configured by a user;

[0037] The computing node is specifically used for:

[0038] According to the accumulated amount of logs to be sent of the at least one shard and the weights of the multiple business tables, the maximum generation rate or adjustment amount of the instance of the cloud database is split into maximum generation rates or adjustment amounts of the instance of the cloud database for multiple business tables.

[0039] In some possible implementations, the computing node is further used for:

[0040] Receive a fill time threshold and a fill volume threshold of the first log cache configured by a user;

[0041] When the filling time of the first log cache reaches the filling time threshold, or the filling amount of the first log cache reaches the filling amount threshold, the log is written from the first log cache to at least one storage node in the storage pool.

[0042] In some possible implementations, the computing node is further used for:

[0043] Monitoring the processing capacity of at least one storage node in the storage pool;

[0044] According to a change in the processing capability of the at least one storage node, a write rate of the first log cache to the at least one storage node is adjusted.

[0045] In some possible implementations, the computing node is specifically used for:

[0046] According to the weights of different business tables in the same storage node, the writing rate at which logs corresponding to different business tables are written from the first log cache to the storage node is adjusted.

[0047] In some possible implementations, the computing node is further used for:

[0048] Smoothing the processing capacity of the at least one storage node through a sliding window;

[0049] The computing node is specifically used for:

[0050] According to the change in the processing capacity after the smoothing process, a writing rate of the first log cache to the at least one storage node is adjusted.

[0051] In some possible implementations, the computing node is further used for:

[0052] Receive the over-issuance threshold configured by the user;

[0053] When the accumulated amount of logs to be sent of a target node in the at least one storage node is greater than the processing capacity of the target node, the logs to be sent are sent to the target node according to the over-sending threshold.

[0054] In some possible implementations, the computing node is further used for:

[0055] When the accumulated amount of logs to be sent by the target node in the next sliding window is still greater than the processing capacity of the target node, the database write request is added to the retry queue.

[0056] In some possible implementations, at least one storage node in the storage pool is used to:

[0057] Sending a flow control state to the computing node, the flow control state including one or more of a retransmission number, a retransmission log amount, and a storage node to which the retransmission log is to be written;

[0058] The computing node is specifically used for:

[0059] A write flow control policy is generated according to the usage information of the first log cache and the flow control state fed back by the at least one storage node.

[0060] In some possible implementations, the traffic control system is provided with a shared memory queue, and the shared memory queue is used to store database read requests received by the instance of the cloud database; the computing node is further used to:

[0061] Monitoring usage information of the shared memory queue and a return code of at least one storage node in the storage pool;

[0062] Generate a read flow control strategy according to the usage information of the shared memory queue and the return code;

[0063] The read flow control strategy is executed.

[0064] In a third aspect, the present application provides a computing device cluster. The computing device cluster includes at least one computing device, and the at least one computing device includes at least one processor and at least one memory. The at least one processor and the at least one memory communicate with each other. The at least one processor is used to execute instructions stored in the at least one memory, so that the computing device or the computing device cluster executes the flow control method of the cloud database as described in the first aspect or any implementation of the first aspect.

[0065] In a fourth aspect, the present application provides a computer-readable storage medium, in which instructions are stored, and the instructions instruct a computing device or a computing device cluster to execute the cloud database traffic control method described in the above-mentioned first aspect or any implementation of the first aspect.

[0066] In a fifth aspect, the present application provides a computer program product comprising instructions, which, when executed on a computing device or a computing device cluster, enables the computing device or the computing device cluster to execute the cloud database traffic control method described in the first aspect or any one of the implementations of the first aspect.

[0067] Based on the implementations provided in the above aspects, this application can also be further combined to provide more implementations. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] In order to more clearly illustrate the technical method of the embodiments of the present application, the drawings required for use in the embodiments are briefly introduced below.

[0069] Figure 1 A schematic diagram of the architecture of a cloud database provided in an embodiment of the present application;

[0070] Figure 2 A schematic diagram of the architecture of a flow control system provided in an embodiment of the present application;

[0071] Figure 3 A flow chart of a cloud database flow control method provided in an embodiment of the present application;

[0072] Figure 4 A schematic diagram of flow control of a cloud database provided in an embodiment of the present application;

[0073] Figure 5 A schematic diagram of log over-issuance provided in an embodiment of the present application;

[0074] Figure 6 A schematic diagram of the structure of a flow control system provided in an embodiment of the present application;

[0075] Figure 7 A schematic diagram of the structure of a computing device provided in an embodiment of the present application;

[0076] Figure 8 A schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application;

[0077] Fig. 9 A schematic diagram of the structure of another computing device cluster provided in an embodiment of the present application;

[0078] Fig.10 A schematic diagram of the structure of another computing device cluster provided in an embodiment of the present application. DETAILED DESCRIPTION

[0079] The terms "first" and "second" in the embodiments of the present application are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features.

[0080] First, some technical terms involved in the embodiments of the present application are introduced.

[0081] Shared storage refers to storage technology that shares storage resources with multiple computing devices. For a cluster, although the hosts in the cluster have local disks, in order to ensure business continuity and high availability, business data is generally not written to the local disks, but they are used to store operating systems. Business data is usually stored in shared storage, so that even if a host fails, the business can still run normally. Among them, shared storage can divide the shared storage resources into multiple logical units, and number the multiple logical units to obtain logical unit numbers (logic unit numbers, LUNs), and then allocate LUNs to hosts, thereby allocating resources to each host in the cluster.

[0082] The cloud database can use shared storage to improve the utilization of storage resources. The cloud database may include a computing layer and a storage layer. The computing layer includes multiple computing nodes. In some examples, the computing layer may include a structured query language (SQL) parsing layer (also referred to as the SQL layer), and the SQL parsing layer includes SQLNode. The computing layer is used to run an instance of the cloud database to process the user's SQL request (such as a database read request or a database write request). The storage layer includes multiple storage nodes, and the multiple storage nodes can form a storage pool for use by multiple computing nodes (for example, instances of cloud databases on multiple computing nodes).

[0083] The computing layer may also include a storage abstraction layer (SAL). The storage abstraction layer is a logical layer used to isolate data storage from the SQL front end, transactions, query execution, etc. For ease of understanding, the architecture of the cloud database is introduced below with reference to the accompanying drawings.

[0084] See also Figure 1 The cloud database system architecture diagram shown in the figure includes the SQL parsing layer, the storage abstraction layer SAL and the storage layer. The following is a detailed introduction to each layer.

[0085] The SQL parsing layer (also called the SQL layer) includes multiple SQL nodes. Multiple SQL nodes form a cluster, which includes a master node (also called Master SQL node) and multiple replica nodes (also called replica SQL node), wherein the master node supports read-write (read-write) and the replica node supports read-only (read only). Each cluster belongs to a tenant, and a tenant can have multiple clusters. SQL nodes are used to manage client connections, parse SQL requests, generate query execution plans, execute queries, and manage transaction isolation. Among them, SQL requests include database read requests or database write requests. When the master node (for example, an instance of a cloud database running on the master node) receives a database write request, it can write the data carried in the database write request into the business table of the storage layer. When the master node receives a database read request, it can route the database read request to the slave node, and the slave node (for example, an instance of a cloud database running on the slave node) reads the corresponding data.

[0086] The storage layer provides distributed, strong consistency and high-performance storage capabilities based on Data Function Virtualization (DFV) storage, thereby ensuring data reliability and horizontal expansion capabilities. Among them, DFV is a solution that builds a data-centric full-stack data service architecture by separating storage and computing.

[0087] The storage abstraction layer SAL is a bridge between the SQL node and the storage layer. It is used to abstract the table file-based operations of the original database into corresponding distributed storage, connect to DFV downward, and provide efficient scheduling of database storage semantics upward. The storage abstraction layer includes the public log module (referred to as SAL SQL Module) executed on the SQL node and the slice store executed on the storage node.

[0088] SAL SQL Module provides SAL interface (application programming interface, API) for SQL nodes (primary / read-only replica) to interact with the underlying storage system. SAL SQL Module includes Common Log Processor (CLP), Slice Manager (SM), Page Reader (PR) and tool programs for synchronizing information with read-only replica nodes.

[0089] CLP is responsible for persisting the database global redo log to DFV, parsing the log and distributing it to the corresponding DFV shards, and generating synchronization messages (dirty pages, active transaction lists, shard persistent log sequence numbers (log sequence number, LSN), etc.) for read-only replicas to obtain. CLP also needs to handle database crash recovery, reload the committed global redo log, and redistribute it to all corresponding shards. SM maintains sharding policies and page mapping information to determine when to add more shards and which database pages should be assigned to which DFV shard. PR is responsible for routing specific page read requests to the corresponding shard manager by looking up page mapping information. SAL SQL Module also provides some other interfaces for SQL nodes to interact with the storage pool, including an API for passing log clearing information (Recycle LSN).

[0090] Slice store is a plug-in module that runs inside a DFV node (such as a DFV server). It is usually used with the DFV storage framework to manage multiple database shards on the same DFV node, support multi-tenant resource sharing, and provide multiple versions of pages to SQL nodes. For each slice, the slice store uses the log directory as a central component to manage redo logs and page data. Specifically, the slice store is used to receive slice redo logs, persist them, and register them in the log directory. The slice store is also used to receive database read requests, such as page read requests, and build specific versions of pages.

[0091] It should be noted that the storage layer of the cloud database is built on top of the DFV node. DFV can provide a read-write interface for the upper-level SQL node storage, and provide strong data consistency and reliability guarantees across regions (such as three availability zones, 3AZs). The SQL node uses the Persistence Log (Plog) mode to store the WAL redo log of the entire database, and uses the iShard mode to shard and manage data between multiple storage nodes. Plog uses a solid-state drive (SSD)-friendly append-write method to make transaction submission faster. The iShard mode aggregates the redo log in pages, manages data shards, achieves fast data reading, and supports ultra-large databases (such as 128TB databases).

[0092] In the above architecture, the business pressure of cloud database instances usually changes dynamically. If the cloud database instances cannot effectively perceive the business pressure of the underlying storage and perform traffic management (such as traffic control, also known as flow control, current limiting) for the business, when the business pressure of the instance is too high and the storage node is overloaded, it may cause the storage pool to fail and be unable to provide services to the outside world, thereby causing damage to the business of all instances in the shared storage pool.

[0093] At present, the industry has proposed a rule-based flow limiting strategy and a flow limiting strategy based on input / output operations per second (IOPS) / transmission volume (megabits per second, MBPS) configuration. Among them, the rule-based flow limiting strategy supports pre-setting rules to match the corresponding SQL statements, limiting the concurrency of the corresponding type of business, so as to achieve the effect of controlling concurrency. The flow limiting strategy based on IOPS / MBPS configuration configures a fixed threshold for each instance by pre-configuring IOPS / MBPS quotas before the instance is started, so that the storage pool can trigger self-protection when overloaded.

[0094] However, under the rule-based flow control strategy, the SQL parsing layer cannot perceive the storage pool status, and cannot match the SQL statement with the storage pool, resulting in poor flow control effect. The flow control strategy based on IOPS / MBPS configuration is a static configuration, which is difficult to adapt to different business models.

[0095] In view of this, the present application provides a flow control method for a cloud database. The method can be performed by a flow control system. The flow control system includes multiple computing nodes and a storage pool shared by the multiple computing nodes, and each of the multiple computing nodes runs an instance of a cloud database.

[0096] Among them, the computing layer is provided with a log cache, which is also called a transport log cache (Transport LogBuffer, TLB). In order to ensure the smooth operation of the business, the log cache can be a multi-level log cache. It should be noted that in order to distinguish it from the log cache of the storage pool in the storage layer, the present application may refer to the log cache of the computing layer as the first log cache, and the first log cache is used to cache the log generated by the instance of the cloud database when receiving a database write request (the log is a log to be redistributed to the storage pool), and the log cache of the storage pool in the storage layer is called the second log cache.

[0097] Specifically, the computing node can monitor the usage information of the first log cache, which includes the overall usage rate. The computing node then generates a write traffic control strategy based on the usage information of the first log cache, wherein the write traffic control strategy includes the maximum generation rate of the instance of the cloud database determined based on the overall usage rate or the adjustment amount of the generation rate (for example, an adjustment ratio). The computing node then executes the above-mentioned write traffic control strategy to ensure that the rate at which the instance of the cloud database generates logs is not greater than the maximum generation rate or the generation rate is adjusted according to the adjustment amount.

[0098] The method performs hierarchical flow control on services according to the overall usage rate of the first log cache to ensure a dynamic balance between the generation and consumption of logs, thereby achieving dynamic flow control and avoiding damage to upper-layer services due to overload of the underlying storage pool during the operation of the cloud database instance. It solves the problem that the rule-based flow control strategy cannot perceive the storage pool status, resulting in poor flow control effect. Moreover, the method does not need to set IOPS / MBPS quotas for tenants in advance, can adapt to different business models, and has high availability.

[0099] This application can be applied to cloud database system architectures based on shared storage and storage-computing separation in public clouds, private clouds, or hybrid clouds. In scenarios where cloud database instances share storage resources and some instances are overloaded due to excessive business pressure, it is possible to accurately classify and limit the flow of services, and dynamically and smoothly handle business changes and changes in storage capacity, so that the underlying storage maintains dynamic load balancing, and can protect customers' key businesses in a fine-grained manner while ensuring availability.

[0100] In order to make the technical solution of the present application clearer and easier to understand, the architecture of the flow control system of the present application is introduced below with reference to the accompanying drawings.

[0101] See also Figure 2 As shown in the schematic diagram of the architecture of the flow control system, the flow control system 10 includes multiple computing nodes 100 and a storage pool 200 shared by the multiple computing nodes 100. The computing nodes 100 and the storage pool 200 communicate via a network, for example, via a remote direct memory access (RDMA) network.

[0102] Each computing node 100 in the plurality of computing nodes 100 runs an instance of a cloud database. The instance of the cloud database supports write services and read services. The instances of the cloud database running on each computing node 100 form an SQL layer in the computing layer, and the common log module in the SQL layer and the slice nodes in the storage layer (for example, slice services running on slice nodes) form a SAL in the computing layer. The traffic control system 10 can set a first log cache in the computing layer (for example, a SAL). The first log cache is used to cache logs generated by the instance of the cloud database when receiving a database write request and to be redistributed to the storage pool.

[0103] The computing node 100 monitors the usage information of the first log cache, and the usage information of the first log cache includes the overall usage rate, and then generates a write flow control strategy based on the usage information of the first log cache. The write flow control strategy includes the maximum generation rate of the instance of the cloud database determined according to the overall usage rate or the adjustment amount of the generation rate (such as the adjustment ratio). For example, when the overall usage rate of the first log cache reaches 80%, the write flow control strategy can be to reduce the generation rate of the instance of the cloud database when generating logs by 10%. If the generation rate is reduced by 10%, the overall usage rate of the first log cache is still at a high level, for example, when it reaches 75%, the write flow control strategy can be to continue to reduce the generation rate of the instance of the cloud database when generating logs by 5%. The computing node 100 is used to execute the above-mentioned write flow control strategy so that the rate at which the instance of the cloud database generates logs is not greater than the maximum generation rate or the generation rate is adjusted according to the above-mentioned adjustment amount. In this way, the SQL layer write flow restriction can be achieved by suppressing the write business in a graded manner.

[0104] Among them, the first log cache includes multiple slices. Different slices can be used to cache logs for different business tables. The usage information of the first log cache also includes the accumulated amount of logs to be sent of at least one of the multiple slices. Accordingly, when generating a flow control strategy, the computing node 100 can first determine the maximum generation rate or the adjustment amount of the generation rate of the instance of the cloud database based on the overall utilization rate, and then, based on the accumulated amount of logs to be sent of at least one slice, split the maximum generation rate or adjustment amount of the instance of the cloud database into the maximum generation rate or adjustment amount of the instance of the cloud database for multiple business tables. In this way, fine-grained flow limiting of the business can be achieved, such as table-level flow limiting. It should be noted that the flow control system 10 can also perform tenant-level and instance-level flow limiting on the business, which is not limited in this embodiment.

[0105] In some possible implementations, the computing node 100 may also monitor the processing capability of at least one storage node in the storage pool 200. The processing capability of the storage node includes the ability of the storage node to write data, and the ability of the storage node to write data may be characterized by the ability of the memory in the storage node to consume data. The computing node 100 may adjust the write rate of the first log cache to the at least one storage node according to the change in the processing capability of the at least one storage node. In this way, the SAL layer write flow control may be implemented.

[0106] In specific implementation, the SAL layer can set a state machine for flow control, based on which, the state machine is also called a flow control state machine. The flow control state machine includes a flow control metadata cache and a storage metadata cache, which are used to cache flow control metadata and storage metadata, respectively. The flow control metadata includes usage information of the above-mentioned first log cache, such as the overall usage rate of the first log cache. The usage information of the first log cache may also include the accumulated amount of logs to be sent by the slice in the first log cache. Further, the flow control metadata also includes the processing capacity of the storage node. In this way, the computing node 100 can obtain the flow control metadata from the flow control state machine and generate a flow control policy based on the flow control metadata. The storage metadata may be metadata related to storage, including but not limited to metadata indicating the storage location. When performing SAL layer flow control, the corresponding storage node can be determined based on the storage metadata, so as to perform fine-grained flow control on the storage node.

[0107] In this embodiment, the computing node 100 can also receive the flow control state (also referred to as the current limiting state) fed back by at least one storage node. The flow control state includes one or more of the number of retransmissions, the amount of retransmission logs, and the storage nodes to which the retransmission logs are to be written. In this way, when the computing node 100 generates a flow control strategy, it can generate a write flow control strategy based on the usage information of the first log cache and the flow control state fed back by at least one storage node. In this way, a multi-level feedback mechanism can be formed, which can ensure that the generation and consumption of logs are dynamically balanced on the basis of protecting the storage nodes, so that the business can run smoothly.

[0108] In some possible implementations, SAL may also set a storage node replica information cache to cache storage node replica status information. Among them, the replica status information of the storage node may include replica consistency or replica inconsistency. When generating a flow control strategy, the computing node 100 may also generate it in combination with the above-mentioned replica status information. For example, when the replica status information indicates that the replica is inconsistent, the computing node 100 may limit the flow of the storage node where the replica is located. For example, if one of the three replicas is not consistent with the other two replicas, the computing node 100 may determine that the storage node where the above-mentioned replica is located is abnormal, and the abnormal storage node may be limited.

[0109] The above describes in detail the flow control process of the write service. This embodiment also designs a corresponding flow control solution for the read service. By adopting flow control strategies of different dimensions for the read service and the write service, different buffer mechanisms are designed to adapt to the read and write resource consumption, and dynamically smooth the changes in the service and storage processing capabilities.

[0110] Specifically, the traffic control system 10 is provided with a shared memory queue, for example, a shared memory queue is provided in SAL. The shared memory queue is used to store database read requests received by instances of the cloud database. The computing node 100 can monitor the usage information of the shared memory queue and the return code of at least one storage node in the storage pool. Among them, the return code of the storage node can have multiple values, and each value represents a state of the storage node. For example, the return code of the storage node is 1, indicating that the storage node is in a busy state and reaches the upper limit of the capacity, the return code of the storage node is 2, indicating that the storage node has no data, and the return code of the storage node is 3, indicating that the storage node is in a normal state. The computing node 100 can generate a read flow control strategy based on the usage information and return code of the shared memory queue, and then the computing node 100 executes the read flow control strategy. Specifically, the usage information of the shared memory queue includes the usage rate of the shared memory queue. When the usage rate reaches a preset ratio and the return code indicates that the storage node is in a busy state, a read flow control strategy can be generated, and the read flow control strategy can include the maximum amount of database read requests received or the adjustment ratio of the amount of database read requests received. The computing node 100 may adjust the amount of database read requests received according to the above read flow control strategy. In some examples, the maximum amount of database read requests received may be a positive number or zero. When the maximum amount of database read requests received is zero, it indicates that a new database read request is refused to be responded to.

[0111] The above is a detailed introduction to the architecture of the flow control system 10 . The following is an explanation of the flow control method of the cloud database in an embodiment of the present application from the perspective of the flow control system 10 .

[0112] See also Figure 3The flow control method of the cloud database shown is performed by a flow control system 10, which includes a plurality of computing nodes 100 and a storage pool 200 shared by the plurality of computing nodes 100. Each computing node 100 in the plurality of computing nodes 100 runs an instance of the cloud database. The flow control system 10 is also provided with a first log cache, which is used to cache logs generated by the instance of the cloud database when receiving a database write request and to be redistributed to the storage pool 200. The method includes the following steps:

[0113] S302: The computing node 100 monitors usage information of the first log cache.

[0114] The usage information of the first log cache includes the overall usage rate. The overall usage rate can be represented by the ratio of the log accumulation amount in the first log cache and the capacity of the first log cache. Furthermore, the first log cache may include multiple slices. The usage information of the first log cache may also include the log accumulation amount to be sent of at least one slice among the multiple slices.

[0115] Considering the system performance, the computing node 100 can monitor the usage information of the first log cache through kernel dotting. Among them, the kernel is the core of the operating system. As the first program executed by the operating system, the kernel is first loaded into the memory to start the system behavior and always remains in the memory until the operating system is shut down. Among them, the system behavior may include process management, disk management, task scheduling, and memory management. During memory management, the kernel can apply for a number of memory spaces as the first log cache to store the logs generated by the instance of the cloud database to be redistributed to the storage pool 200. Based on this, after the kernel performs dotting (also known as burying points) on the I / O behavior of the above-mentioned first log cache, the computing node 100 can obtain the output of the dotting position, thereby realizing the monitoring of the usage information of the first log cache. Due to the targeted dotting of the kernel, lightweight monitoring can be achieved. In some examples, the impact of kernel dotting on system performance can be controlled within 3%.

[0116] S304: The computing node 100 generates a write flow control strategy according to the usage information of the first log cache.

[0117] Specifically, when the overall usage rate is maintained at a high level, for example, when the overall usage rate reaches the usage rate threshold, the computing node 100 can trigger the restriction of the rate at which the instance of the cloud database generates logs (i.e., trigger the flow limit), and the flow limit method can be to limit the maximum generation rate of the instance of the cloud database when generating logs, or to reduce the generation rate of the instance of the cloud database. Based on this, the write flow control strategy can include the maximum generation rate of the instance of the cloud database determined according to the overall usage rate or the adjustment amount of the generation rate. Among them, the adjustment amount of the generation rate can be an adjustment ratio (such as a reduction) or an adjustment value.

[0118] Different overall utilization rates may correspond to different maximum generation rates or adjustments. For example, when the overall utilization rate reaches 90%, the reduction may be 20%, and when the overall utilization rate reaches 80%, the reduction may be 10%. It should be noted that the computing node 100 may perform hierarchical flow limiting (hierarchical suppression) on the write service. For example, when the overall utilization rate of the first log cache reaches 80%, the write flow control strategy may be to reduce the generation rate of the cloud database instance when generating logs by 10%. If the generation rate is reduced by 10%, the overall utilization rate of the first log cache is still at a high level, for example, when it reaches 75%, the write flow control strategy may be to continue to reduce the generation rate of the cloud database instance when generating logs by 5%. This example is illustrated by suppressing the level by level. When the overall utilization rate shows a downward trend, the generation rate may be restored level by level until the flow limiting is lifted. Among them, the maximum generation rate or adjustment amount corresponding to each level may be pre-set, or may be determined by the computing node 100 in an adaptive manner, for example, by an adaptive machine learning algorithm.

[0119] Furthermore, the usage information of the first log cache also includes the accumulated amount of logs to be sent of at least one of the multiple shards. After determining the maximum generation rate or the adjustment amount of the generation rate of the instance of the cloud database based on the overall usage rate, the computing node 100 can also split the maximum generation rate or the adjustment amount of the instance of the cloud database into the maximum generation rate or the adjustment amount of the instance of the cloud database for multiple business tables according to the accumulated amount of logs to be sent of at least one shard.

[0120] Among them, the database write request can be a transaction request. For example, when user A initiates a gift to user B in a game application, a transaction request can be generated. The transaction request is used to deduct the digital assets in user A's account and increase the digital assets in user B's account. When the instance of the cloud database generates logs based on the above transaction request, it can generate logs corresponding to different shards. Accordingly, due to the different accumulated amounts of logs to be sent for different shards, when the computing node 100 splits the maximum generation rate or adjustment amount when generating logs for the instance of the cloud database based on the accumulated amount of logs to be sent, different maximum generation rates or adjustment amounts can be split for different shards. When the logs of multiple shards correspond to the same transaction, the computing node 100 can generate logs according to the maximum value of the split maximum generation rate or adjustment amount.

[0121] The computing node 100 can also receive the weights of multiple business tables configured by the user. For example, in a game application, the business table includes a recharge business table and a map business table. The user can set a higher weight for the recharge business table and a lower weight for the map business table. In this way, the recharge business table has a higher priority and the map business table has a lower priority. Accordingly, the computing node 100 can split the maximum generation rate or adjustment amount of the instance of the cloud database into the maximum generation rate or adjustment amount of the instance of the cloud database for multiple business tables according to the accumulated amount of logs to be sent of at least one slice and the weights of multiple business tables. For example, when the accumulated amount of logs to be sent of different slices is equal or the difference is less than the set value, the computing node 100 can prioritize the flow control of map services, thereby ensuring the normal operation of recharge services.

[0122] S306: The computing node 100 executes the write flow control strategy.

[0123] Specifically, the computing node 100 can update the maximum generation rate of the instance of the cloud database in the configuration file or update the generation rate of the instance of the cloud database according to the adjustment amount according to the write traffic control strategy, so that the rate at which the instance of the cloud database generates the log is not greater than the maximum generation rate or the generation rate is adjusted according to the adjustment amount.

[0124] Furthermore, when the write traffic control strategy includes the maximum generation rate or adjustment amount of the cloud database instance for multiple business tables, the computing node 100 can update the maximum generation rate of the cloud database instance for multiple business tables (when generating logs) in the configuration file, or update the generation rate of the cloud database instance for multiple business tables (when generating logs) in the configuration file according to the adjustment amount corresponding to each business table, so that the rate of the cloud database instance when generating logs for each business table is not greater than the respective maximum generation rate, or the generation rate is adjusted according to the respective corresponding adjustment amount. Thus, fine-grained business layer traffic management is achieved.

[0125] S308: The computing node 100 receives the filling time threshold and filling amount threshold of the first log buffer configured by the user. When the filling time of the first log buffer reaches the filling time threshold, or the filling amount of the first log buffer reaches the filling amount threshold, S310 is executed.

[0126] In this embodiment, the first log cache can aggregate I / Os. In order to ensure that the logs in the time period with sparse I / Os can be persisted in time and avoid overflow of the first log cache in the time period with dense I / Os, the computing node 100 can set the filling time threshold and the filling amount threshold of the first log cache. For example, the computing node 100 can provide a configuration interface, which can be a graphical user interface (GUI) or a command user interface (CUI). The user can configure the filling time threshold and the filling amount threshold through the configuration interface, and the computing node 100 receives the above filling time threshold and the filling amount threshold configured by the user.

[0127] It should be noted that the computing node 100 can set a default value for the filling time threshold and a default value for the filling amount threshold. When the user has not configured the filling time threshold and the filling amount threshold, the computing node 100 can adopt the default values ​​for the filling time threshold and the filling amount threshold.

[0128] S310 : The computing node 100 writes the log from the first log cache to at least one storage node in the storage pool 200 .

[0129] The computing node 100 writes the log from the first log cache to at least one storage node in the storage pool 200 when the filling time of the first log cache reaches the filling time threshold or the filling amount of the first log cache reaches the filling amount threshold.

[0130] It should be noted that a second log cache may be set in the storage pool 200. The computing node 100 may first write the log into the second log cache, and then the second log cache may write the log into at least one storage node. Considering reliability, the computing node 100 may write multiple copies of the log into different storage nodes. For example, the computing node 100 may write three copies of the log into three storage nodes based on the second log cache.

[0131] S312 : The computing node 100 monitors the processing capability of at least one storage node in the storage pool 200 .

[0132] The processing capacity of a storage node includes the ability of the storage node to write data. The ability of a storage node to write data can be characterized by the data consumption capacity of the memory in the storage node (for example, the amount of data consumed per second). The storage node can monitor the data consumption capacity of the memory of the storage node to obtain the processing capacity of the storage node. Accordingly, the computing node 100 can receive the processing capacity fed back by at least one storage node in the storage pool 200, thereby realizing the monitoring of the processing capacity of at least one storage node in the storage pool.

[0133] Among them, when the storage node monitors the consumption capacity of the storage node's memory for data, it can be implemented by kernel dotting. Similar to the computing node 100 monitoring the usage information of the first log cache, after dotting (also called embedding) the kernel's I / O behavior on the memory, the storage node can obtain the output of the dotting position, thereby obtaining the consumption capacity of the storage node's memory for data, and then obtaining the processing capacity of the storage node.

[0134] S314: The computing node 100 adjusts the write rate of the first log cache to the at least one storage node according to the change of the processing capability of the at least one storage node.

[0135] Specifically, the computing node 100 can periodically monitor the processing capacity of the storage node, and when the change in the processing capacity of the storage node meets the conditions, the computing node 100 can adjust the write rate of the first log cache to at least one storage node. The change in the processing capacity of the storage node can be that the change in the processing capacity of the storage node reaches a preset amount, or the change rate reaches a preset ratio. For example, if the increment of the processing capacity of the storage node reaches a preset amount, the computing node can increase the write rate of the first log cache to the storage node. For another example, if the attenuation of the processing capacity of the storage node reaches a preset amount, the computing node can reduce the write rate of the first log cache to the storage node.

[0136] Similar to limiting the flow of business, when adjusting the write rate of the first log cache to at least one storage node, the computing node 100 can adjust the write rate of logs corresponding to different business tables from the first log cache to the storage node according to the weights of different business tables in the same storage node.

[0137] For ease of understanding, the following is an example. Figure 4 The schematic diagram of flow control of the cloud database instance shown in the figure, the computing node can limit the flow of the corresponding business table according to the usage information of the first log cache (such as TLB), such as the overall usage rate of the TLB and the accumulated amount of logs to be sent in the slice in the TLB, and look up the mapping table according to the page number of the table space involved in the business in the business log record (referred to as log), obtain the weight and storage node of the corresponding business table, and adjust the write rate of the log corresponding to the business table from the first log cache to the corresponding storage node in combination with the weight of the business table.

[0138] In some possible implementations, the computing node 100 may also smooth the processing capacity of the at least one storage node through a sliding window, and accordingly, the computing node 100 may adjust the write rate of the first log cache to the at least one storage node according to the change in the processing capacity after the smoothing process. In this way, business fluctuations can be smoothly processed.

[0139] In addition, the computing node 100 also allows log over-issuance to cope with traffic peaks. Specifically, the computing node 100 can receive an over-issuance threshold configured by the user. When the accumulated amount of logs to be sent to the target node in at least one storage node is greater than the processing capacity of the target node, the computing node 100 can send the logs to be sent to the target node according to the over-issuance threshold. It should be noted that the computing node 100 can compensate for the over-issuance at a later stage to stabilize the business pressure of the storage node within expectations.

[0140] For ease of understanding, the following is an example. Figure 5 The schematic diagram of log over-issuance is shown. In this example, in the first sliding window, the current writing capacity (processing capacity) fed back by the storage node is greater than the amount of logs to be written in the computing layer. In the second sliding window, the current writing capacity fed back by the storage node is equal to the amount of logs to be written in the computing layer, so that the computing layer can obtain the accumulated writing capacity. In the third sliding window, the current writing capacity fed back by the storage node is less than the amount of logs to be written in the computing layer, and the computing node 100 can perform log over-issuance, which is equivalent to pre-consuming writing capacity. Based on this, the computing node 100 can compensate in the fourth sliding window.

[0141] It should also be noted that when the target node's accumulated logs to be sent in the next sliding window are still greater than the target node's processing capacity, the computing node 100 can add the database write request to the retry queue. The computing node 100 processes the limited database write request through the retry queue.

[0142] In some possible implementations, the computing node 100 may also receive the flow control state fed back by the at least one storage node. The flow control state includes one or more of the number of retransmissions, the amount of retransmission logs, and the storage node to which the retransmission logs are to be written. The flow control state can provide a reference for the computing node 100 to generate a write flow control strategy for the next cycle. Specifically, the computing node 100 can generate a write flow control strategy for the next cycle based on the usage information of the first log cache and the flow control state fed back by the at least one storage node. In this way, it is possible to achieve dynamic and smooth processing of business changes and changes in the processing capacity of storage nodes based on the flow control state fed back by each buffering mechanism.

[0143] Among them, the above S308 to S314 are some specific implementation methods of the present application embodiment to perform write flow control in the storage abstraction layer SAL, and the flow control method of the cloud database in the present application embodiment may not perform the above steps. For example, the flow control system 10 can perform write flow control on the cloud database from the SQL layer.

[0144] S316 : The computing node 100 monitors the usage information of the shared memory queue and the return code of at least one storage node in the storage pool 200 .

[0145] The shared memory queue is used to store database read requests. The usage information of the shared memory queue may include the usage rate of the shared memory queue. The return code of the storage node can have multiple values, each of which represents a state of the storage node. For example, the return code of the storage node is 1, which indicates that the storage node is in a busy state and has reached the capacity limit. The return code of the storage node is 2, which indicates that the storage node has no data. The return code of the storage node is 3, which indicates that the storage node is in a normal state.

[0146] Among them, the computing node 100 can monitor the usage information of the shared memory queue through the kernel monitoring method, which will not be repeated here.

[0147] S318: The computing node 100 generates a read flow control strategy according to the usage information and return code of the shared memory queue.

[0148] Specifically, when the utilization rate reaches a preset ratio and the return code indicates that the storage node is in a busy state, the computing node 100 can limit the read traffic (specifically, limit the amount of database read requests received), and the read traffic control strategy may include the maximum amount of database read requests received or the adjustment ratio of the amount of database read requests received.

[0149] S320: The computing node 100 executes the read flow control strategy.

[0150] Similar to executing the write traffic control strategy, the computing node 100 can update the maximum number of database read requests received by the cloud database instance in the configuration file, or update the number of database read requests received according to the adjustment ratio, so that the number of database read requests received by the cloud database instance does not exceed the above-mentioned maximum number of database read requests received, or receives database read requests according to the adjusted number of database read requests received.

[0151] The above S316 to S320 are optional steps of the embodiment of the present application, and the method of the embodiment of the present application may not execute the above S316 to S320. For example, when the computing node 100 does not receive a database read request, the above S316 to S320 may not be executed.

[0152] Based on the above description, the method classifies the services and limits the flow in a fine-grained manner according to the overall utilization rate of the first log cache and the accumulated amount of logs to be sent in the slice in the first log cache, so as to ensure that the generation and consumption of logs reach a dynamic balance, realize dynamic flow limiting, avoid the upper-layer services being damaged due to the overload of the underlying storage pool during the operation of the cloud database instance, and solve the problem that the rule-based flow limiting strategy cannot perceive the storage pool status and leads to poor flow limiting effect. Moreover, the method does not need to set IOPS / MBPS quotas for tenants in advance, can adapt to different business models, and has high availability. In addition, the method can use different flow control strategies for read and write services respectively, adapt to the consumption of read and write resources, and can realize timely flow limiting and timely release of flow limiting.

[0153] Based on the flow control method of the cloud database provided in the embodiment of the present application, the embodiment of the present application also provides a flow control system 10 as described above. The flow control system 10 is introduced below in conjunction with the accompanying drawings.

[0154] See also Figure 1The structure diagram of the flow control system 10 shown in the figure, the system 100 comprises: a plurality of computing nodes 100 and a storage pool 200 shared by the plurality of computing nodes. Each computing node 100 in the plurality of computing nodes 100 runs an instance of a cloud database, and the flow control system 10 is provided with a first log cache, which is used to cache logs generated by the instance of the cloud database when receiving a database write request and to be redistributed to the storage pool;

[0155] The computing node 100 is used to monitor usage information of the first log cache, wherein the usage information of the first log cache includes an overall usage rate;

[0156] The computing node 100 is further configured to generate a write traffic control strategy according to the usage information of the first log cache, wherein the write traffic control strategy includes a maximum generation rate or an adjustment amount of the generation rate of the instance of the cloud database determined according to the overall usage rate;

[0157] The computing node 100 is further used to execute a write flow control strategy so that the rate at which the cloud database instance generates logs is not greater than the maximum generation rate or the generation rate is adjusted according to the adjustment amount.

[0158] The computing node 100 and the storage pool 200 can be implemented by hardware. The computing node 100 can include at least one computing device, such as a cloud server. Alternatively, the computing node 100 can also be a device implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD can be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof. Similarly, at least one storage node in the storage pool 200 can include at least one computing device, or a device implemented by an ASIC or a PLD.

[0159] In some possible implementations, the first log cache includes multiple shards, and the usage information of the first log cache also includes an accumulated amount of logs to be sent of at least one shard among the multiple shards;

[0160] The computing node 100 is specifically used for:

[0161] Determine the maximum generation rate of the cloud database instance or the adjustment amount of the generation rate according to the overall usage rate;

[0162] According to the accumulated amount of logs to be sent of at least one shard, the maximum generation rate or adjustment amount of the instance of the cloud database is split into maximum generation rates or adjustment amounts of the instance of the cloud database for multiple business tables.

[0163] In some possible implementations, the computing node 100 is further configured to:

[0164] Receive weights of multiple business tables configured by a user;

[0165] The computing node 100 is specifically used for:

[0166] According to the accumulated amount of logs to be sent of at least one shard and the weights of multiple business tables, the maximum generation rate or adjustment amount of the cloud database instance is split into the maximum generation rates or adjustment amounts of the cloud database instance for multiple business tables.

[0167] In some possible implementations, the computing node 100 is further configured to:

[0168] Receive a fill time threshold and a fill amount threshold of a first log cache configured by a user;

[0169] When the filling time of the first log buffer reaches a filling time threshold, or the filling amount of the first log buffer reaches a filling amount threshold, the log is written from the first log buffer to at least one storage node in the storage pool 200 .

[0170] In some possible implementations, the computing node 100 is further configured to:

[0171] Monitoring the processing capacity of at least one storage node in the storage pool;

[0172] According to a change in the processing capability of the at least one storage node, a write rate of the first log cache to the at least one storage node is adjusted.

[0173] In some possible implementations, the computing node 100 is specifically used for:

[0174] According to the weights of different business tables in the same storage node, the writing rate of logs corresponding to different business tables from the first log cache to the storage node is adjusted.

[0175] In some possible implementations, the computing node 100 is further configured to:

[0176] Smoothing the processing capacity of at least one storage node through a sliding window;

[0177] The computing node 100 is specifically used for:

[0178] According to the change in the processing capacity after the smoothing process, a writing rate of the first log cache to the at least one storage node is adjusted.

[0179] In some possible implementations, the computing node 100 is further configured to:

[0180] Receive the over-issuance threshold configured by the user;

[0181] When the accumulated amount of logs to be sent to the target node in at least one storage node is greater than the processing capacity of the target node, the logs to be sent are sent to the target node according to the oversending threshold.

[0182] In some possible implementations, the computing node 100 is further configured to:

[0183] When the accumulated amount of logs to be sent by the target node in the next sliding window is still greater than the processing capacity of the target node, the database write request is added to the retry queue.

[0184] In some possible implementations, at least one storage node in the storage pool 200 is used to:

[0185] Sending a flow control state to the computing node, wherein the flow control state includes one or more of the number of retransmissions, the amount of retransmission logs, and the storage node to which the retransmission logs are to be written;

[0186] The computing node 100 is specifically used for:

[0187] A write flow control policy is generated according to the usage information of the first log cache and the flow control state fed back by at least one storage node.

[0188] In some possible implementations, the traffic control system 10 is provided with a shared memory queue, which is used to store database read requests received by the instance of the cloud database; the computing node 100 is also used to:

[0189] Monitor the usage information of the shared memory queue and the return code of at least one storage node in the storage pool;

[0190] Generate a read flow control strategy based on the shared memory queue usage information and return code;

[0191] Execute the read flow control policy.

[0192] Figure 1 The flow control system 10 is introduced from the hardware perspective. The flow control system 10 can also be a software system. The computing node 100 and the storage pool 200 can be applications or application modules running on a computing device or a computing device cluster. Figure 6As shown, the computing node 100 includes a monitoring module 102 , a policy generating module 104 and a policy executing module 106 , and the storage pool 200 includes a communication module 202 and a storage module 204 .

[0193] A monitoring module 102, configured to monitor usage information of the first log cache, wherein the usage information of the first log cache includes an overall usage rate;

[0194] The strategy generation module 104 is used to generate a write traffic control strategy according to the usage information of the first log cache, wherein the write traffic control strategy includes a maximum generation rate or an adjustment amount of the generation rate of the instance of the cloud database determined according to the overall usage rate;

[0195] The policy execution module 106 is used to execute the write flow control policy so that the rate at which the cloud database instance generates logs is not greater than the maximum generation rate or the generation rate is adjusted according to the adjustment amount.

[0196] In some possible implementations, the first log cache includes multiple shards, and the usage information of the first log cache also includes an accumulated amount of logs to be sent of at least one shard among the multiple shards;

[0197] The strategy generation module 104 is specifically used for:

[0198] Determine the maximum generation rate of the cloud database instance or the adjustment amount of the generation rate according to the overall usage rate;

[0199] According to the accumulated amount of logs to be sent of at least one shard, the maximum generation rate or adjustment amount of the instance of the cloud database is split into maximum generation rates or adjustment amounts of the instance of the cloud database for multiple business tables.

[0200] In some possible implementations, the computing node 100 further includes an interaction module 108;

[0201] An interaction module 108, configured to receive weights of multiple service tables configured by a user;

[0202] The strategy generation module 104 is specifically used for:

[0203] According to the accumulated amount of logs to be sent of at least one shard and the weights of multiple business tables, the maximum generation rate or adjustment amount of the cloud database instance is split into the maximum generation rates or adjustment amounts of the cloud database instance for multiple business tables.

[0204] In some possible implementations, the interaction module 108 is further configured to:

[0205] Receive a fill time threshold and a fill amount threshold of a first log cache configured by a user;

[0206] The computing node 100 further includes a log writing module 110;

[0207] The log writing module 110 is used to write the log from the first log cache to at least one storage node in the storage pool 200 (for example, it can be the storage module 204 in the storage pool 200) when the filling time of the first log cache reaches the filling time threshold, or the filling amount of the first log cache reaches the filling amount threshold.

[0208] In some possible implementations, the monitoring module 102 is further configured to:

[0209] Monitoring the processing capacity of at least one storage node in the storage pool;

[0210] The log writing module 110 is further used for:

[0211] According to a change in the processing capability of the at least one storage node, a write rate of the first log cache to the at least one storage node is adjusted.

[0212] In some possible implementations, the log writing module 110 is specifically used to:

[0213] According to the weights of different business tables in the same storage node, the writing rate of logs corresponding to different business tables from the first log cache to the storage node is adjusted.

[0214] In some possible implementations, the log writing module 110 is further configured to:

[0215] Smoothing the processing capacity of at least one storage node through a sliding window;

[0216] The log writing module 110 is specifically used for:

[0217] According to the change in the processing capacity after the smoothing process, a writing rate of the first log cache to the at least one storage node is adjusted.

[0218] In some possible implementations, the interaction module 108 is further configured to:

[0219] Receive the over-issuance threshold configured by the user;

[0220] The log writing module 110 is further configured to: when the accumulated amount of logs to be sent to the target node in at least one storage node is greater than the processing capacity of the target node, send the logs to be sent to the target node according to the over-sending threshold.

[0221] In some possible implementations, the log writing module 110 is further configured to:

[0222] When the accumulated amount of logs to be sent by the target node in the next sliding window is still greater than the processing capacity of the target node, the database write request is added to the retry queue.

[0223] In some possible implementations, the communication module 202 is used to:

[0224] Sending a flow control state to a computing node (e.g., a log writing module 110 in the computing node 100), wherein the flow control state includes one or more of a retransmission number, a retransmission log amount, and a storage node to which the retransmission log is to be written;

[0225] The strategy generation module 104 is specifically used for:

[0226] A write flow control policy is generated according to the usage information of the first log cache and the flow control state fed back by at least one storage node.

[0227] In some possible implementations, the traffic control system 10 is provided with a shared memory queue, which is used to store database read requests received by the instance of the cloud database; the monitoring module 102 is also used to:

[0228] Monitor the usage information of the shared memory queue and the return code of at least one storage node in the storage pool;

[0229] The strategy generation module 104 is also used for:

[0230] Generate a read flow control strategy based on the shared memory queue usage information and return code;

[0231] The policy execution module 106 is also used for:

[0232] Execute the read flow control policy.

[0233] The present application also provides a computing device 700. Figure 7 As shown, computing device 700 includes: bus 702, processor 704, memory 706 and communication interface 708. Processor 704, memory 706 and communication interface 708 communicate through bus 702. Computing device 700 can be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in computing device 700.

[0234] The bus 702 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7The bus 704 is represented by only one line, but does not mean that there is only one bus or one type of bus. The bus 704 may include a path for transmitting information between various components of the computing device 700 (eg, the memory 706, the processor 704, and the communication interface 708).

[0235] The processor 704 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0236] The memory 706 may include a volatile memory, such as a random access memory (RAM). The processor 704 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid state drive (SSD). The memory 706 stores executable program code, and the processor 704 executes the executable program code to implement the aforementioned cloud database flow control method. Specifically, the memory 706 stores instructions for the flow control system 10 to execute the cloud database flow control method.

[0237] The communication interface 708 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 700 and other devices or communication networks.

[0238] The embodiment of the present application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smart phone.

[0239] like Figure 8 As shown, the computing device cluster includes at least one computing device 700. The memory 706 in one or more computing devices 700 in the computing device cluster may store the same flow control system 10 for executing instructions of the flow control method of the cloud database.

[0240] In some possible implementations, one or more computing devices 700 in the computing device cluster may also be used to execute some instructions of the flow control system 10 for executing the flow control method of the cloud database. In other words, the combination of one or more computing devices 700 may jointly execute the instructions of the flow control system 10 for executing the flow control method of the cloud database.

[0241] It should be noted that the memory 706 in different computing devices 700 in the computing device cluster can store different instructions for executing partial functions of the flow control system 10 .

[0242] Fig. 9 A possible implementation is shown. Fig. 9 As shown, two computing devices 700A and 700B are connected via a communication interface 708. The memory in the computing device 700A stores instructions for executing the functions of the monitoring module 102, the policy generation module 104, the policy execution module 106, the interaction module 108, and the log writing module 110. The memory in the computing device 700B stores instructions for executing the functions of the communication module 202 and the storage module 204. In other words, the memory 706 of the computing devices 700A and 700B jointly stores instructions for the flow control system 10 to execute the flow control method of the cloud database.

[0243] Fig. 9 The connection mode between the computing device clusters shown can be considered that the flow control method of the cloud database provided in this application needs to generate and execute the write flow control strategy and send the flow control status. Therefore, it is considered that the functions implemented by the monitoring module 102, the policy generation module 104, the policy execution module 106, the interaction module 108 and the log writing module 110 are executed by the computing device 700A, and the functions implemented by the communication module 202 and the storage module 204 are executed by the computing device 700B.

[0244] It should be understood that Fig. 9 The functions of the computing device 700A shown in FIG. 7 may also be completed by multiple computing devices 700. Similarly, the functions of the computing device 700B may also be completed by multiple computing devices 700.

[0245] In some possible implementations, one or more computing devices in the computing device cluster may be connected via a network, which may be a wide area network or a local area network. Fig.10 A possible implementation is shown. Fig.10As shown, two computing devices 700C and 700D are connected via a network. Specifically, the network is connected via a communication interface in each computing device. In this type of possible implementation, the memory 706 in the computing device 700C stores instructions for executing the functions of the monitoring module 102, the policy generation module 104, the policy execution module 106, the interaction module 108, and the log writing module 110. At the same time, the memory 706 in the computing device 700D stores instructions for executing the functions of the communication module 202 and the storage module 204.

[0246] Fig.10 The connection mode between the computing device clusters shown can be considered that the flow control method of the cloud database provided in this application needs to generate and execute the write flow control strategy and send the flow control status. Therefore, it is considered that the functions implemented by the monitoring module 102, the policy generation module 104, the policy execution module 106, the interaction module 108 and the log writing module 110 are executed by the computing device 700C, and the functions implemented by the communication module 202 and the storage module 204 are executed by the computing device 700D. It should be understood that Fig.10 The functions of the computing device 700C shown in FIG. 700A may also be completed by multiple computing devices 700. Similarly, the functions of the computing device 700D may also be completed by multiple computing devices 700.

[0247] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute the above-mentioned flow control method applied to the flow control system for executing the cloud database.

[0248] The embodiment of the present application also provides a computer program product including instructions. The computer program product may be a software or program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes the above-mentioned cloud database flow control method.

[0249] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present invention.

Claims

1. A flow control method for a cloud database, It is characterized in that Applied to a traffic control system, the system includes a plurality of computing nodes and a storage pool shared by the plurality of computing nodes, each of the plurality of computing nodes runs an instance of a cloud database, the traffic control system is provided with a first log cache, the first log cache is used to cache logs generated by the instance of the cloud database when receiving a database write request and to be redistributed to the storage pool, the method includes: The computing node monitors usage information of the first log cache, where the usage information of the first log cache includes an overall usage rate; The computing node generates a write traffic control strategy according to the usage information of the first log cache, wherein the write traffic control strategy includes a maximum generation rate or an adjustment amount of the generation rate of the instance of the cloud database determined according to the overall usage rate; The computing node executes the write flow control strategy so that the rate at which the instance of the cloud database generates the log is not greater than the maximum generation rate or the generation rate is adjusted according to the adjustment amount.

2. The method according to claim 1, It is characterized in that The first log cache includes a plurality of shards, and the usage information of the first log cache further includes an accumulated amount of logs to be sent of at least one shard among the plurality of shards; The computing node generates a write flow control strategy according to the usage information of the first log cache, including: The computing node determines, according to the overall usage rate, a maximum generation rate or an adjustment amount of the generation rate of the instance of the cloud database; The computing node splits the maximum generation rate or adjustment amount of the instance of the cloud database into maximum generation rates or adjustment amounts of the instance of the cloud database for multiple business tables according to the accumulated amount of logs to be sent of the at least one shard.

3. The method according to claim 2, It is characterized in that The method further comprises: The computing node receives weights of multiple service tables configured by a user; The computing node splits the maximum generation rate or adjustment amount of the instance of the cloud database into maximum generation rates or adjustment amounts of the instance of the cloud database for multiple business tables according to the accumulated amount of logs to be sent of the at least one shard, including: The computing node splits the maximum generation rate or adjustment amount of the instance of the cloud database into maximum generation rates or adjustment amounts of the instance of the cloud database for multiple business tables according to the accumulated amount of logs to be sent of the at least one shard and the weights of the multiple business tables.

4. The method according to any one of claims 1 to 3, It is characterized in that The method further comprises: The computing node receives a filling time threshold and a filling amount threshold of the first log cache configured by a user; When the filling time of the first log cache reaches the filling time threshold, or the filling amount of the first log cache reaches the filling amount threshold, the computing node writes the log from the first log cache to at least one storage node in the storage pool.

5. The method according to claim 4, It is characterized in that The method further comprises: The computing node monitors the processing capability of at least one storage node in the storage pool; The computing node adjusts a write rate of the first log cache to the at least one storage node according to a change in a processing capability of the at least one storage node.

6. The method according to claim 5, It is characterized in that The computing node adjusts the write rate of the first log cache to the at least one storage node, including: The computing node adjusts the writing rate of logs corresponding to different business tables from the first log cache to the storage node according to the weights of different business tables in the same storage node.

7. The method according to claim 5 or 6, It is characterized in that The method further comprises: The computing node performs smoothing processing on the processing capability of the at least one storage node through a sliding window; The computing node adjusts the write rate of the first log cache to the at least one storage node according to the change of the processing capacity of the at least one storage node, including: The computing node adjusts a write rate of the first log cache to the at least one storage node according to a change in processing capacity after smoothing.

8. The method according to claim 7, It is characterized in that The method further comprises: The computing node receives an over-issuance threshold configured by a user; When the accumulated amount of logs to be sent of a target node in the at least one storage node is greater than the processing capacity of the target node, the logs to be sent are sent to the target node according to the over-sending threshold.

9. The method according to claim 8, It is characterized in that The method further comprises: When the accumulated amount of logs to be sent by the target node in the next sliding window is still greater than the processing capacity of the target node, the database write request is added to the retry queue.

10. The method according to any one of claims 1 to 9, It is characterized in that The method further comprises: The computing node receives the flow control state fed back by the at least one storage node, where the flow control state includes one or more of the number of retransmissions, the amount of retransmission logs, and the storage node to which the retransmission logs are to be written; The computing node generates a write flow control strategy according to the usage information of the first log cache, including: The computing node generates a write flow control policy according to the usage information of the first log cache and the flow control state fed back by the at least one storage node.

11. The method according to any one of claims 1 to 10, It is characterized in that The traffic control system is provided with a shared memory queue, and the shared memory queue is used to store database read requests received by the instance of the cloud database; the method further includes: The computing node monitors usage information of the shared memory queue and a return code of at least one storage node in the storage pool; The computing node generates a read flow control strategy according to the usage information of the shared memory queue and the return code; The computing node executes the read flow control strategy.

12. A flow control system, It is characterized in that The system includes a plurality of computing nodes and a storage pool shared by the plurality of computing nodes, each of the plurality of computing nodes runs an instance of a cloud database, the traffic control system is provided with a first log cache, the first log cache is used to cache logs generated by the instance of the cloud database when receiving a database write request and to be redistributed to the storage pool; The computing node is used to monitor usage information of the first log cache, where the usage information of the first log cache includes an overall usage rate; The computing node is further configured to generate a write traffic control strategy according to the usage information of the first log cache, wherein the write traffic control strategy includes a maximum generation rate or an adjustment amount of the generation rate of the instance of the cloud database determined according to the overall usage rate; The computing node is further used to execute the write traffic control strategy so that the rate at which the instance of the cloud database generates the log is not greater than the maximum generation rate or the generation rate is adjusted according to the adjustment amount.

13. The system according to claim 12, It is characterized in that The first log cache includes a plurality of shards, and the usage information of the first log cache further includes an accumulated amount of logs to be sent of at least one shard among the plurality of shards; The computing node is specifically used for: Determining a maximum generation rate or an adjustment amount of the generation rate of the instance of the cloud database according to the overall usage rate; According to the accumulated amount of logs to be sent of the at least one shard, the maximum generation rate or adjustment amount of the instance of the cloud database is split into maximum generation rates or adjustment amounts of the instance of the cloud database for multiple business tables.

14. The system according to claim 13, It is characterized in that The computing node is also used for: Receive weights of multiple business tables configured by a user; The computing node is specifically used for: According to the accumulated amount of logs to be sent of the at least one shard and the weights of the multiple business tables, the maximum generation rate or adjustment amount of the instance of the cloud database is split into maximum generation rates or adjustment amounts of the instance of the cloud database for multiple business tables.

15. A system according to any one of claims 12 to 14, It is characterized in that The computing node is also used for: Receive a fill time threshold and a fill amount threshold of the first log cache configured by a user; When the filling time of the first log cache reaches the filling time threshold, or the filling amount of the first log cache reaches the filling amount threshold, the log is written from the first log cache to at least one storage node in the storage pool.

16. The system according to claim 15, It is characterized in that The computing node is also used for: Monitoring the processing capacity of at least one storage node in the storage pool; According to a change in the processing capability of the at least one storage node, a write rate of the first log cache to the at least one storage node is adjusted.

17. The system according to claim 16, It is characterized in that The computing node is specifically used for: According to the weights of different business tables in the same storage node, the writing rate at which logs corresponding to different business tables are written from the first log cache to the storage node is adjusted.

18. The system according to claim 16 or 17, It is characterized in that The computing node is also used for: Smoothing the processing capacity of the at least one storage node through a sliding window; The computing node is specifically used for: According to the change in the processing capacity after the smoothing process, a writing rate of the first log cache to the at least one storage node is adjusted.

19. The system according to claim 18, It is characterized in that The computing node is also used for: Receive the over-issuance threshold configured by the user; When the accumulated amount of logs to be sent of a target node in the at least one storage node is greater than the processing capacity of the target node, the logs to be sent are sent to the target node according to the over-sending threshold.

20. The system according to claim 19, It is characterized in that The computing node is also used for: When the accumulated amount of logs to be sent by the target node in the next sliding window is still greater than the processing capacity of the target node, the database write request is added to the retry queue.

21. A system according to any one of claims 12 to 20, It is characterized in that At least one storage node in the storage pool is used for: Sending a flow control state to the computing node, the flow control state including one or more of a retransmission number, a retransmission log amount, and a storage node to which the retransmission log is to be written; The computing node is specifically used for: A write flow control policy is generated according to the usage information of the first log cache and the flow control state fed back by the at least one storage node.

22. A system according to any one of claims 12 to 21, It is characterized in that The traffic control system is provided with a shared memory queue, and the shared memory queue is used to store database read requests received by the instance of the cloud database; the computing node is also used to: Monitoring usage information of the shared memory queue and a return code of at least one storage node in the storage pool; Generate a read flow control strategy according to the usage information of the shared memory queue and the return code; The read flow control strategy is executed.

23. A computing device cluster, It is characterized in that The computing device cluster includes at least one computing device, and the at least one computing device includes at least one processor and at least one memory, wherein the at least one memory stores computer-readable instructions; the at least one processor executes the computer-readable instructions so that the computing device cluster executes the method as described in any one of claims 1 to 11.

24. A computer-readable storage medium, It is characterized in that The method comprises computer-readable instructions; the computer-readable instructions are used to implement the method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Log data collecting method and system and log collecting server

    CN102790686A

  • Speed limiting method and device for writing cache, equipment and medium

    CN111367471A

  • Data writing speed determination method and device and computer equipment

    CN112748878A

  • Data storage method and device, electronic equipment and computer readable storage medium

    CN113220729A

Cited By

  • Cross-network data synchronization flow control method and system, medium and program product

    CN119276885A

  • Traffic control method, system, medium and program product for cross-network data synchronization

    CN119276885B

  • Method, device and equipment for limiting flow of SQL (Structured Query Language) statement and distributed database

    CN120492479A

  • Hierarchical current limiting method and device, equipment, storage medium and product

    CN121907778A