A cluster statistical information storage method, device, equipment and readable storage medium
Receive and process resource statistics through object gateway services and store them in the database, solving the problem of low storage cluster performance and achieving functional decoupling and performance improvement.
Patent Information
- Application Number
- CN202412000376.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-04
AI Technical Summary
In the prior art, the performance of storage clusters is low, resulting in a significant impact on performance when determining statistical information between users and buckets.
By using the object gateway service to receive client requests, determine resource statistics, and the object gateway service master node receives resource statistics sent by non-master nodes for processing, and after obtaining the information statistics results, it is stored in the database.
Decoupling storage business functions and statistical functions does not occupy underlying storage resources, improving system performance.
Smart Images

Figure CN119760005A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of object storage technology, and in particular to a cluster statistical information storage method, device, equipment and readable storage medium. Background Art
[0002] With the development of information technology, data in various industries is growing rapidly. Market business has more and more data storage requirements for storage systems. In the field of object storage, user and bucket information is counted to analyze object access traffic. Currently, when analyzing user and bucket information, traffic statistics are stored in the storage side, and bucket and user statistics for every minute are stored in the object storage side. The number of users and buckets in the storage cluster may be as high as 100,000 respectively. Traversing the information of users and buckets every minute will inevitably have a significant impact on the performance of the storage cluster.
[0003] It can be seen that how to reduce the impact on the performance of the storage cluster when determining the statistical information of the storage system such as users and buckets is a problem that technical personnel in this field need to solve. Summary of the invention
[0004] In view of this, an object of the present invention is to provide a cluster statistical information storage method, device, equipment and readable storage medium, which solves the technical problem of low storage cluster performance in the prior art.
[0005] In order to solve the above technical problems, the present invention provides a cluster statistical information storage method, comprising:
[0006] Receive a client request using the object gateway service, and determine resource statistics corresponding to the current object gateway service according to the client request;
[0007] Using the object gateway service master node to receive resource statistics information sent by each object gateway service non-master node, processing all resource statistics information, and obtaining information statistics results;
[0008] The information statistics results are stored in a database.
[0009] In some embodiments, before the method of using the object gateway service master node to receive resource statistics information sent by each object gateway service non-master node and processing all resource statistics information to obtain information statistics results, it also includes:
[0010] Collecting a plurality of performance indicators of each object gateway service; wherein the performance indicators include at least one of central processing unit utilization, memory usage, and network bandwidth;
[0011] Based on multiple performance indicators of each object gateway service, a load value corresponding to each object gateway service is determined based on a load balancing method; wherein the load balancing method is a method for determining the load based on the weight of each performance indicator and the value of the performance indicator;
[0012] Determine the object gateway service with the smallest load based on the load value corresponding to each object gateway service;
[0013] The object gateway service with the smallest load is used as the object gateway service master node.
[0014] In some embodiments, after storing the information statistics result using a database, the method further includes:
[0015] Determining the priority of various types of information in the information statistics results in the database;
[0016] Determine the cache order of the information statistics results according to the priorities of the various types of information;
[0017] According to the cache order of the information statistics results, the information statistics results are stored in the cache in order. In some embodiments, the object gateway service master node receives the resource statistics information sent by each object gateway service non-master node, processes all resource statistics information, and obtains the information statistics results, including:
[0018] When the object gateway service is started, it is determined to start a thread for sending a statistical request task; wherein the thread of the statistical request task is used to send a statistical request task to perform resource statistics;
[0019] Based on the thread of the statistical request task, the object gateway service is used to determine whether the current object gateway service turns on the switch for statistical resource statistical information;
[0020] If the current object gateway service does not have the switch for collecting resource statistics turned on, then the current statistics are terminated;
[0021] If the current object gateway service has turned on the switch for collecting resource statistics, the resource statistics of the current object gateway service are determined;
[0022] Determine whether the current object gateway service is the object gateway service master node;
[0023] If the current object gateway service is not the object gateway service master node, the resource statistics information of the current object gateway service is sent to the object gateway service master node;
[0024] If the current object gateway service is the object gateway service master node, it receives resource statistics information of other object gateway services;
[0025] The object gateway service master node is used to collect statistics of resource statistics information of itself and other object gateway services to obtain the information statistics result.
[0026] In some embodiments, if the current object gateway service is not the object gateway service master node, sending resource statistics information of the current object gateway service to the object gateway service master node includes:
[0027] Add the resource statistics obtained each time to the cache key-value pair;
[0028] Determine whether the number of data items in the cache key-value pair is greater than a set threshold; wherein the cache key-value pair is a key-value pair consisting of a key value and resource statistical information;
[0029] When it is greater than the set threshold, it is determined to send the resource statistics information of the current object gateway service to the object gateway service master node.
[0030] In some embodiments, the resource statistics information includes user statistics information and bucket statistics information. The object gateway service master node is used to collect statistics on the resource statistics information of itself and other object gateway services to obtain the information statistics results, including:
[0031] If the current user statistics information and bucket statistics information are incremental information, the object gateway service master node is used to accumulate the user statistics information and bucket statistics information of itself and other object gateway services to obtain a first information statistics result;
[0032] If the current user statistics and bucket statistics are full information, the object gateway service master node is used to periodically update the quota of the user statistics and bucket statistics of itself and other object gateway services, and the latest user statistics and bucket statistics are used as the second information statistics result;
[0033] The first information statistical result and the second information statistical result are used as the information statistical result.
[0034] In some embodiments, storing the information statistics results using a database includes:
[0035] The information statistics result is sent to a management software platform, so that the information statistics result is written into a database based on the management software platform.
[0036] The present invention also provides a cluster statistical information storage device, comprising:
[0037] A resource statistics information determination module, configured to receive a client request using an object gateway service, and determine resource statistics information corresponding to the current object gateway service according to the client request;
[0038] The information statistics result determination module is used to use the object gateway service master node to receive the resource statistics information sent by each object gateway service non-master node, process all the resource statistics information, and obtain the information statistics result;
[0039] The storage module is used to store the information statistics results using a database.
[0040] The present invention also provides a cluster statistical information storage device, comprising:
[0041] Memory for storing computer programs;
[0042] A processor is used to execute the computer program to implement the steps of the above cluster statistical information storage method.
[0043] The present invention also provides a readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned cluster statistical information storage method are implemented.
[0044] The present invention also provides a computer program product, comprising a computer program / instruction, which implements the steps of the above-mentioned cluster statistical information storage method when executed by a processor.
[0045] The purpose of the embodiments of the present invention is to provide a cluster statistical information storage method, device, equipment and readable storage medium, which can solve the technical problem of low performance of the storage cluster.
[0046] To solve the above technical problems, an embodiment of the present invention provides a cluster statistical information storage method, which may include: using an object gateway service to receive a client request, and determining resource statistical information corresponding to the current object gateway service according to the client request; using an object gateway service master node to receive resource statistical information sent by each object gateway service non-master node, processing all resource statistical information, and obtaining information statistical results; and using a database to store the information statistical results.
[0047] It can be seen from the above technical scheme that the beneficial effect of the present invention is that compared with the current method of counting and storing user information and bucket information on the storage side, the present invention uses the object gateway service to count user information and bucket information, and sends it to the database for storage, thereby decoupling the storage business function and the statistical function, not occupying the underlying storage resources, and improving the performance of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0049] Figure 1 A flowchart of a cluster statistical information storage method provided by an embodiment of the present invention;
[0050] Figure 2 A structural framework diagram corresponding to a cluster statistical information storage method provided by an embodiment of the present invention;
[0051] Figure 3 A flowchart of a cluster statistical information storage method provided by an embodiment of the present invention;
[0052] Figure 4 A schematic diagram of the structure of a cluster statistical information storage device provided by an embodiment of the present invention;
[0053] Figure 5 A schematic diagram of the structure of a cluster statistical information storage device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0055] The terms "including" and "having" in the specification of the present invention and the above-mentioned drawings, as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may include steps or units that are not listed.
[0056] Some of the terms that appear in the description of the embodiments of the present invention may be interpreted as follows:
[0057] Ceph: A high-performance, reliable, and scalable distributed storage system.
[0058] RGW: RADOS gateway, that is, object storage gateway, is used to provide external object storage services.
[0059] Bucket: A container for S3 (a protocol) objects. It is a primary management unit introduced to facilitate the management and operation of a class of objects with the same attributes.
[0060] Shard object: Rados Object (distributed object storage system object) used to store information, maintaining a key-val omap structure (open, programmable architecture), the key corresponds to the rados object name, and val is the stored statistical information.
[0061] With the development of information technology, data in various industries is growing rapidly. Market businesses have more and more demands on data storage in storage systems. In the field of object storage, statistics are collected on users and buckets in unit time, such as TPS (Transactions Per Second), bandwidth, etc., in order to measure and analyze object access traffic. By analyzing this information, we can better understand customers' demands for clusters. Customers can view the pressure of clusters in a certain period of time through statistical information. If the pressure of the cluster is too high, some means, such as capacity expansion, can be used to alleviate the pressure of the cluster and better serve customers. The market has more and more demands on traffic statistics features, and has also put forward greater requirements for the statistics of user and bucket traffic information. Customers can query the performance data of users and buckets in real time through the cluster management interface, which will effectively manage the traffic statistics of users and buckets more efficiently.
[0062] When there are a large number of users and buckets in the cluster, recording the statistical information of users and buckets on the storage side will not only affect the performance of the storage system, but also affect the inability to obtain all statistical information from the storage pool when the storage system fails. At present, the market also stores traffic statistics on the storage side, and the bucket and user statistics for every minute are stored in the omap (Open Multi-Processing Application Platform, a high-performance, highly integrated embedded processor platform) on the 32 shard objects on the object storage side. In view of the fact that the number of users and buckets in the cluster may reach hundreds of thousands respectively, and then storing the traffic statistics of users and buckets in the storage system, 32 shards can no longer carry too much user and bucket statistics, which is obviously not the best choice. Therefore, the present invention proposes a solution for traffic statistics management in a distributed object storage system. It meets the user's requirements for fast query of storage system statistics.
[0063] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0064] Next, a flow chart of a cluster statistical information storage method provided by an embodiment of the present invention is described in detail. Figure 1 A cluster statistical information storage method provided by an embodiment of the present invention includes:
[0065] S101, receiving a client request by using an object gateway service, and determining resource statistical information corresponding to the current object gateway service according to the client request.
[0066] The execution subject of this embodiment is an electronic device, which can be a computer or the like. The object gateway service (RGW) in this embodiment is used to provide object storage services to the outside. The present invention reports the resource statistics information of each storage node in the storage cluster to the management node of the object storage system, that is, the object gateway service. This embodiment does not limit the number of clients. For example, the number of clients in this embodiment can be single; or the number of clients in this embodiment can be multiple. In this embodiment, each client can correspond to a client request. The specific relationship between the client request and the object gateway service is not limited in this embodiment. For example, the client and the object gateway service in this embodiment can be a one-to-one relationship, or the relationship between the client and the object gateway service in this embodiment can be one-to-many. It can be understood that, compared with the current use of storage pools for resource statistics, the advantages of using the object gateway service in the present invention are: First: reduce the burden on the storage pool: when the storage pool does not need to perform resource statistics tasks, it can focus more computing resources and I / O operations on data processing and storage, rather than consuming them on resource statistics. This directly improves the processing capacity and response speed of the storage pool. Second: Optimize performance configuration: By transferring the resource statistics task from the storage pool to the RGW, the RGW can be configured for performance optimization, such as adjusting the cache size and thread pool size to meet the needs of statistical operations without affecting the performance of the storage pool itself. Third: Enhance system stability: Separating the resource statistics task from the storage pool can reduce the workload of the storage pool, thereby reducing the risk of system instability caused by the statistical task and enhancing the stability of the entire storage system. This embodiment does not limit specific resource statistical information. For example, the resource statistical information in this embodiment can be user statistical information; or the resource statistical information in this embodiment can also be bucket statistical information; or it can also be an application performance indicator. The statistical count of the bucket belongs to the metadata information of the bucket, which is mainly used to save the object statistical information of the bucket, including the total number of objects, the total size of objects, etc. It can be understood that the user and bucket TPS (Transactions PerSecond, number of transactions per second), bandwidth and other information in unit time are counted to measure and analyze the object access traffic. By analyzing this information, customers' demands on the cluster can be better understood. The pressure of the cluster in a certain period of time can be viewed through statistical information. If the cluster is under too much pressure, some measures, such as capacity expansion, can be used to alleviate the cluster pressure and improve the user experience.
[0067] It should be further explained that resource statistics include user statistics and bucket statistics. The structure storing user statistics includes user name, user ID, timestamp, upload bandwidth, download bandwidth, number of download requests, number of upload requests, number of deleted requests, upload delay, download delay, deletion delay, used object capacity and number of used objects. The structure storing bucket statistics includes bucket name, timestamp, upload bandwidth, download bandwidth, number of download requests, number of upload requests, number of deleted requests, upload delay, download delay, deletion delay, used object capacity and number of used objects. The structure of user statistics in this embodiment is as follows:
[0068] struct rgw_user_statis_entry {
[0069] rgw_user user; / / User name and user ID
[0070] uint64_t epoch; / / timestamp
[0071] uint64_t put_bandwith; / / Upload bandwidth
[0072] uint64_t get_bandwith; / / Download bandwidth
[0073] uint64_t get_iops; / / Number of download requests
[0074] uint64_t put_iops; / / Number of upload requests
[0075] uint64_t del_iops; / / Number of delete requests
[0076] uint64_t put_latency; / / Upload latency
[0077] uint64_t get_latency; / / Download latency
[0078] uint64_t del_latency; / / delete latency
[0079] uint64_t used_quota_kb; / / Used capacity
[0080] uint64_t used_objects; / / Number of used objects
[0081] }
[0082] Bucket statistics are structured as follows:
[0083] struct rgw_bucket_statis_entry {
[0084] rgw_user user;
[0085] string bucket;
[0086] uint64_t epoch;
[0087] uint64_t put_bandwith;
[0088] uint64_t get_bandwith;
[0089] uint64_t get_iops;
[0090] uint64_t put_iops;
[0091] uint64_t del_iops;
[0092] uint64_t put_latency;
[0093] uint64_t get_latency;
[0094] uint64_t del_latency;
[0095] uint64_t used_quota_kb;
[0096] uint64_t used_objects;
[0097] }
[0098] The meanings of the above letters are the same as those of user statistics, but the corresponding subjects are buckets.
[0099] S102: using the object gateway service master node to receive resource statistical information sent by each object gateway service non-master node, processing all resource statistical information to obtain information statistical results.
[0100] This embodiment does not limit the specific object gateway service master node, and can be any node among all object gateway service nodes. This embodiment does not limit the method of determining the object gateway service master node. For example, this embodiment can determine it according to the number of the object gateway service node; or this embodiment can also determine the object gateway service master node by a load balancing strategy; or this embodiment can also use a distributed consistency algorithm (such as Raft (which defines three roles: leader, follower, and candidate), Paxos (including three roles: proposer, acceptor, and learner)), etc.), so that the object gateway service nodes can communicate with each other and elect a master node by voting. This method can realize automatic failover and dynamic change of the master node.
[0101] It should be further explained that, based on the above embodiment, the above-mentioned use of the object gateway service master node to receive the resource statistical information sent by each object gateway service non-master node, and process all resource statistical information to obtain the information statistical results may include:
[0102] S1021, collecting multiple performance indicators of each object gateway service; wherein the performance indicator includes at least one of central processing unit utilization, memory usage, and network bandwidth.
[0103] The specific number of performance indicators is not limited in this embodiment, for example, it can be a single one; or it can be multiple. This embodiment can use a cluster monitoring tool to collect multiple performance indicators of each object gateway service. It should be noted that, through experiments, it is found that the CPU utilization, memory usage and network bandwidth are relatively important indicators for evaluating the performance of the object gateway service. These three indicators can well reflect the performance of the node.
[0104] S1022, based on the multiple performance indicators of each object gateway service, determine the load value corresponding to each object gateway service based on a load balancing method; wherein the load balancing method is a method for determining the load based on the weight of each performance indicator and the value of the performance indicator.
[0105] For ease of understanding, there are three performance indicators: CPU utilization, memory usage, and network bandwidth. We can set a weight for each indicator and adjust these weights according to actual needs. The sum of the weights is 1. According to the specific value of the indicator, the corresponding performance score is determined. The performance score and the respective weight are multiplied to get the load value. The higher the score, the greater the load.
[0106] S1023: Determine the object gateway service with the smallest load based on the load value corresponding to each object gateway service.
[0107] The load values corresponding to all object gateway services are arranged from large to small, and the object gateway service with the smallest load value is used as the object gateway service master node.
[0108] S1024: Use the object gateway service with the smallest load as the object gateway service master node.
[0109] This embodiment determines the object gateway service master node based on the load balancing strategy, so that the object gateway service master node can efficiently perform resource statistics.
[0110] It should be further explained that the above-mentioned receiving resource statistics information sent by each object gateway service non-master node by using the object gateway service master node, processing all resource statistics information, and obtaining information statistics results may include: when the object gateway service is started, determining to start a thread for sending a statistics request task; wherein the thread of the statistics request task is used to send the statistics request task to perform resource statistics; based on the thread of the statistics request task, using the object gateway service to determine whether the current object gateway service turns on a switch for counting resource statistics information; if the current object gateway service does not turn on the switch for counting resource statistics information, determining to end the current statistics; if the current object gateway service has turned on the switch for counting resource statistics information, determining the resource statistics information of the current object gateway service; determining whether the current object gateway service is the object gateway service master node; if the current object gateway service is not the object gateway service master node, sending the resource statistics information of the current object gateway service to the object gateway service master node; if the current object gateway service is the object gateway service master node, receiving resource statistics information of other object gateway services; using the object gateway service master node to count the resource statistics information of itself and other object gateway services to obtain information statistics results. This embodiment stores the statistical information of each user and each bucket in the cache of the corresponding node. Each node will start a thread task to send the statistical data in the cache to the management node (object gateway service node) of the storage system. The management node will count the resource statistical information received within the current preset time (1 minute). This embodiment ensures the correct start of the resource statistics task through the thread, and the judgment of the object gateway service master node will be performed during the whole process, thereby improving the accuracy of information statistics using the object gateway service master node.
[0111] It should be further explained that, before determining to start the thread for sending the statistical request task, it may also include: receiving a front-end request and recording the current time point; when completing the current request, recording the completion time point and calculating the delay of the request.
[0112] It should be further explained that if the current object gateway service is not the object gateway service master node, the resource statistics information of the current object gateway service is sent to the object gateway service master node, which may include: adding the resource statistics information obtained each time to the cache key-value pair; wherein the cache key-value pair is a key-value pair consisting of a key value and resource statistics information; judging whether the number of data items in the cache key-value pair is greater than a set threshold; when it is greater than the set threshold, determining to send the resource statistics information of the current object gateway service to the object gateway service master node. The cache key-value pair in this embodiment is a key-value pair consisting of a key value and resource statistics information. For example, when the key value is 1, the corresponding resource statistics information is the first resource statistics information; when the key value is 2, the corresponding resource statistics information is the second resource statistics information. This embodiment caches part of the resource statistics information first, and then sends it when a certain number of data items is reached, so as to prevent data loss caused by one-time sending, or the efficiency of sending repeatedly is relatively low. This embodiment can wait until the data in the current cache key-value pair is sent before receiving new data, thereby improving the efficiency and security of data transmission by the non-master node of the object gateway service.
[0113] It should be further explained that the above resource statistics information includes user statistics information and bucket statistics information. The object gateway service master node is used to perform statistics on the resource statistics information of itself and other object gateway services to obtain information statistics results, which may include: if the current user statistics information and bucket statistics information are incremental information, the object gateway service master node is used to perform accumulation processing on the user statistics information and bucket statistics information of itself and other object gateway services to obtain the first information statistics result; if the current user statistics information and bucket statistics information are full information, the object gateway service master node is used to perform regular update quota processing on the user statistics information and bucket statistics information of itself and other object gateway services, and the latest user statistics information and bucket statistics information are used as the second information statistics result; the first information statistics result and the second information statistics result are used as the information statistics result. The incremental information in this embodiment is information that needs to be continuously superimposed, that is, information that needs to be continuously accumulated. This embodiment does not limit the specific incremental information. For example, the incremental information in this embodiment can be the number of download requests; or the incremental information in this embodiment can also be the upload bandwidth. This embodiment does not limit the specific number of incremental information. For example, the incremental information in this embodiment can be multiple; or the incremental information in this embodiment can also be single. The full amount information in this embodiment is information that does not need to be accumulated. This embodiment does not limit the specific full amount information. For example, the full amount information in this embodiment may be the used capacity; or the full amount information in this embodiment may also be the number of used objects; or the full amount information in this embodiment may be the used capacity and the number of used objects.
[0114] S103: Utilize a database to store the information statistics results.
[0115] It should be further explained that the above-mentioned use of a database to store the information statistical results may include: sending the information statistical results to a management software platform, so as to write the information statistical results into a database based on the management software platform. The management software platform of this embodiment may be any type of management software platform. For example, it may be the management software platform of Company A; or the management software platform in this embodiment may also be the management software platform of Company B. The function of the management software platform in this embodiment is to collect, process and store statistical information reported from various data sources. This embodiment uses a management software platform to write the information statistical results into a database, so that various statistical data can be collected, sorted and stored in a centralized manner, thereby avoiding the loss and confusion that may be caused by the dispersion of data in different systems and departments.
[0116] It should be further explained that, based on any of the above embodiments, after using a database to store the information statistics results, it may also include: determining the priority of various types of information in the information statistics results in the database; determining the cache order of the information statistics results according to the priority of various types of information; according to the cache order of the information statistics results, storing the information statistics results in order in the cache. This embodiment uses cache technology to reduce direct access to backend storage and improve data retrieval speed.
[0117] It should be further explained that after the information statistics results are stored, it can also include: performing traffic analysis based on the information statistics results to determine the peak access period and high-frequency access objects; wherein the high-frequency access period is a period during which the number of accesses is greater than the set maximum number of accesses, and the high-frequency access object is an object that has accessed an object more than the set maximum number of times, and the business executed during the peak access period is determined according to the priority of the business; determining the actions that can be executed by the limited high-frequency access objects; and / or evaluating the pressure of the cluster based on the information statistics results to determine whether there is a performance bottleneck or insufficient resources; wherein the pressure is determined based on the processor speed, memory capacity, disk speed or network bandwidth obtained by analyzing the information statistics results and their corresponding thresholds; if it is found that the cluster pressure is too high, capacity planning is performed; wherein capacity planning includes increasing storage resources, server nodes or network bandwidth.
[0118] A cluster statistical information storage method provided by an embodiment of the present invention may include: S101, using an object gateway service to receive a client request, and determining the resource statistical information corresponding to the current object gateway service according to the client request; S102, using an object gateway service master node to receive resource statistical information sent by each object gateway service non-master node, processing all resource statistical information, and obtaining information statistical results; S103, using a database to store the information statistical results. Compared with the traditional technical solution that uses the storage side to count and store user statistical information and bucket statistical information, the present invention uses the object gateway service to count user information and bucket information, and sends it to the database for storage, thereby decoupling the storage business function and the statistical function, without using the storage side for statistics, without occupying the underlying storage resources, and improving the performance of the storage cluster.
[0119] In order to make the present invention easier to understand, please refer to Figure 2 , Figure 2 A structural framework diagram corresponding to a cluster statistical information storage method provided in an embodiment of the present invention may specifically include:
[0120] N clients send network requests to m object gateway services RGW respectively, and the requests include access to resources in multiple buckets. The RGW service records the statistics of access users and buckets in the cache of each RGW service. The statistics in the (m-1) RGW services send requests to the object master node (the nth RGW service) respectively. The nth RGW service receives the statistics of other RGWs, accumulates the statistics of other RGW services and the current statistics of the nth RGW service or takes the latest statistics as the basis, and reports the statistical results of the information within the current preset time (1 minute) to the management software platform, which saves them to the database.
[0121] In order to make the present invention easier to understand, please refer to Figure 3 , Figure 3 A flow chart of a cluster statistical information storage method provided by an embodiment of the present invention may specifically include:
[0122] Step 1: Receive client requests and record front-end request time.
[0123] Step 2: When the client request is completed, the operation completion time is determined, and the request delay is determined based on the front-end request time and the operation completion time.
[0124] Step 3: Each object storage gateway service sends a thread for statistics requests.
[0125] Step 4: Each object storage gateway service determines whether to enable the user and bucket statistics switch.
[0126] Step 5: If enabled, proceed to step 6; otherwise, the execution ends.
[0127] Step 6: Count the user statistics and bucket statistics in the cache.
[0128] Step 7: Add the obtained user statistics and bucket statistics to the cache to obtain a statistics key-value pair.
[0129] Step 8: Determine whether the number of statistical key-value pairs is greater than the set threshold.
[0130] Step 9: If not, wait until the next minute to send a statistics request for the current object storage gateway service to the master node.
[0131] Step 10: If yes, determine whether the current object storage gateway service is the master node. If not, send user statistics and bucket statistics to the master node.
[0132] Step 11: When it is the master node, it receives user statistics and bucket statistics sent by other object storage gateway services.
[0133] Step 12: Determine the type of user statistics information and bucket statistics information. If it is incremental data, accumulate the user information and bucket information. If it is full data, determine the latest full data as the reported information to obtain the information statistics result.
[0134] This embodiment accumulates the user statistics of the current object storage gateway service and the user statistics of other object storage gateway services (except for the used capacity and the number of used objects); the used capacity and the number of used objects reported by each object storage gateway service are inconsistent in most cases, and each object storage gateway service will update the quota regularly every 3 minutes (which can be set according to demand). Due to the inconsistent time of the regular update, the results reported by each object storage gateway service are inconsistent. This patent takes the result of the last updated quota as the benchmark, and takes the latest used capacity and number of used objects of one of the object storage gateway services as the reported value.
[0135] Step 13: Store the information in the database.
[0136] The embodiment of the present invention calculates the statistical information in the cache based on the multi-node distributed object storage system, and a single node sends the statistical information, and finally stores the statistical information in the database. It does not occupy the underlying storage resources, and the rapid reporting of information is completed by calculating the statistical information in the cache and using network resources, so as to achieve the purpose of separating and decoupling the storage business function and the cluster statistical information function. When users query cluster statistical information, they can get the results more quickly, which improves the customer experience and avoids the impact on storage performance. Therefore, a solution for traffic statistical information management in a distributed object storage system is proposed.
[0137] The cluster statistical information storage device provided by an embodiment of the present invention is introduced below. The cluster statistical information storage device described below and the cluster statistical information storage method described above can be referred to each other.
[0138] Figure 4 A schematic diagram of a cluster statistical information storage device provided by an embodiment of the present invention may include:
[0139] The resource statistics information determination module 100 is used to receive a client request using the object gateway service, and determine the resource statistics information corresponding to the current object gateway service according to the client request;
[0140] The information statistics result determination module 200 is used to use the object gateway service master node to receive the resource statistics information sent by each object gateway service non-master node, process all the resource statistics information, and obtain the information statistics result;
[0141] The storage module 300 is used to store the information statistics results using a database.
[0142] Further, based on the above embodiment, the above cluster statistical information storage device may further include:
[0143] A performance indicator determination module, used to collect multiple performance indicators of each object gateway service; wherein the performance indicator includes at least one of central processing unit utilization, memory usage and network bandwidth;
[0144] A load value determination module, used to determine the load value corresponding to each object gateway service based on a load balancing method based on multiple performance indicators of each object gateway service; wherein the load balancing method is a method for determining the load based on the weight of each performance indicator and the value of the performance indicator;
[0145] The object gateway service with the smallest load determining module is used to determine the object gateway service with the smallest load based on the load value corresponding to each object gateway service;
[0146] The object gateway service master node determination module is used to use the object gateway service with the smallest load as the object gateway service master node.
[0147] Further, based on any of the above embodiments, the above cluster statistical information storage device may further include:
[0148] A priority determination module, used to determine the priority of various types of information in the information statistics results in the database;
[0149] A cache order determination module, used to determine the cache order of the information statistics results according to the priority of the various types of information;
[0150] The cache module is used to store the information statistical results in order in the cache according to the cache order of the information statistical results.
[0151] Further, based on any of the above embodiments, the above information statistics result determination module 200 may include:
[0152] A thread determination unit, used for determining and starting a thread for sending a statistical request task when the object gateway service is started; wherein the thread of the statistical request task is used for sending a statistical request task for performing resource statistics;
[0153] A first judgment unit is used to judge whether the current object gateway service turns on the switch of counting resource statistical information based on the thread of the statistical request task and using the object gateway service;
[0154] End current statistics unit, used to determine to end current statistics if the switch for counting resource statistics information is not turned on in the current object gateway service;
[0155] A resource statistics information determination unit, configured to determine the resource statistics information of the current object gateway service if the switch for collecting statistics of resource statistics of the current object gateway service is turned on;
[0156] The second determination unit is used to determine whether the current object gateway service is the object gateway service master node;
[0157] a resource statistics information sending unit, configured to send the resource statistics information of the current object gateway service to the object gateway service master node if the current object gateway service is not the object gateway service master node;
[0158] A resource statistics information receiving unit, configured to receive resource statistics information of other object gateway services if the current object gateway service is the object gateway service master node;
[0159] The information statistical result determining unit is used to use the object gateway service master node to collect statistics of resource statistical information of itself and other object gateway services to obtain the information statistical result.
[0160] Further, based on the above embodiment, the resource statistical information sending unit may include:
[0161] Add to cache key-value pair subunit, used to add resource statistics information obtained each time to the cache key-value pair;
[0162] A data number determination subunit is used to determine whether the number of data in the cache key-value pair is greater than a set threshold; wherein the cache key-value pair is a key-value pair consisting of a key value and resource statistical information;
[0163] The sending determination subunit is used to determine to send the resource statistics information of the current object gateway service to the object gateway service master node when it is greater than a set threshold.
[0164] Further, based on the above embodiment, the resource statistical information includes user statistical information and bucket statistical information, and the above information statistical result determination unit may include:
[0165] A first information statistical result determination subunit is used for, if the current user statistical information and bucket statistical information are incremental information, using the object gateway service master node to perform accumulation processing on the user statistical information and bucket statistical information of itself and other object gateway services to obtain the first information statistical result;
[0166] A second information statistical result determination subunit is used for, if the current user statistical information and bucket statistical information are full information, using the object gateway service master node to periodically update the quota of the user statistical information and bucket statistical information of itself and other object gateway services, and taking the latest user statistical information and bucket statistical information as the second information statistical result;
[0167] The information statistical result determining subunit is used to use the first information statistical result and the second information statistical result as the information statistical result.
[0168] Further, based on any of the above embodiments, the storage module 300 may include:
[0169] The database writing unit based on the management software platform is used to send the information statistical result to the management software platform, so as to write the information statistical result into the database based on the management software platform.
[0170] It should be noted that the order of the modules and units in the above cluster statistical information storage device can be changed without affecting the logic.
[0171] Figure 4 The description of the features in the corresponding embodiments can be found in Figure 4 The relevant descriptions of the corresponding embodiments will not be repeated here one by one.
[0172] The cluster statistical information storage device provided by the embodiment of the present invention may include: a resource statistical information determination module 100, which is used to receive client requests using the object gateway service, and determine the resource statistical information corresponding to the current object gateway service according to the client request; an information statistical result determination module 200, which is used to receive resource statistical information sent by each object gateway service non-master node using the object gateway service master node, process all resource statistical information, and obtain information statistical results; a storage module 300, which is used to store the information statistical results using a database. Compared with the traditional technical solution that uses the storage side to count and store user statistical information and bucket statistical information, the present invention uses the object gateway service to count user information and bucket information, and sends it to the database for storage, thereby decoupling the storage business function and the statistical function, without using the storage side for statistics, without occupying the underlying storage resources, and improving the performance of the storage cluster.
[0173] A cluster statistical information storage device provided by an embodiment of the present invention is introduced below. The cluster statistical information storage device described below and the cluster statistical information storage method described above can be referred to each other.
[0174] Figure 5 A schematic diagram of the structure of a cluster statistical information storage device provided by an embodiment of the present invention, such as Figure 5 As shown, the cluster statistical information storage device includes: a memory 60 for storing computer programs;
[0175] The processor 61 is used to implement the steps of the cluster statistical information storage method in the above embodiment when executing a computer program.
[0176] The cluster statistical information storage device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer, or a desktop computer.
[0177] Among them, the processor 61 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 61 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 61 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 61 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 61 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0178] The memory 60 may include one or more computer-readable storage media, which may be non-transitory. The memory 60 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 60 is at least used to store the following computer program 601, wherein, after the computer program is loaded and executed by the processor 61, the relevant steps of the cluster statistical information storage method disclosed in any of the aforementioned embodiments can be implemented. In addition, the resources stored in the memory 60 may also include an operating system 602 and data 603, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 602 may include Windows, Unix, Linux, etc. Data 603 may include, but is not limited to, data required for the cluster statistical information storage method, etc.
[0179] In some embodiments, the cluster statistical information storage device may further include a display screen 62 , an input / output interface 63 , a communication interface 64 , a power supply 65 , and a communication bus 66 .
[0180] Those skilled in the art will understand that Figure 5 The structure shown in the figure does not constitute a limitation on the cluster statistical information storage device, and may include more or fewer components than those shown in the figure.
[0181] It is understandable that if the cluster statistical information storage method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the current technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, magnetic disk or optical disk and other media that can store program code.
[0182] Based on this, an embodiment of the present invention further provides a readable storage medium (computer-readable storage medium), on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned cluster statistical information storage method are implemented.
[0183] Based on this, an embodiment of the present invention further provides a computer program product, including a computer program / instruction, which implements the steps of the above-mentioned cluster statistical information storage method when executed by a processor.
[0184] The above is a detailed introduction to a cluster statistical information storage method provided by an embodiment of the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0185] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0186] The above is a detailed introduction to a cluster statistical information storage method, device, equipment and readable storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.
Claims
1. A cluster statistical information storage method, characterized in that: include: Receive a client request using the object gateway service, and determine resource statistics corresponding to the current object gateway service according to the client request; Using the object gateway service master node to receive resource statistics information sent by each object gateway service non-master node, processing all resource statistics information, and obtaining information statistics results; The information statistics results are stored in a database.
2. The cluster statistical information storage method according to claim 1, characterized in that: Before the method of using the object gateway service master node to receive resource statistical information sent by each object gateway service non-master node and processing all resource statistical information to obtain the information statistical result, the method further includes: Collecting a plurality of performance indicators of each object gateway service; wherein the performance indicators include at least one of central processing unit utilization, memory usage, and network bandwidth; Based on multiple performance indicators of each object gateway service, a load value corresponding to each object gateway service is determined based on a load balancing method; wherein the load balancing method is a method for determining the load based on the weight of each performance indicator and the value of the performance indicator; Determine the object gateway service with the smallest load based on the load value corresponding to each object gateway service; The object gateway service with the smallest load is used as the object gateway service master node.
3. The cluster statistical information storage method according to claim 1, characterized in that: After storing the information statistics result in the database, the method further includes: Determining the priority of various types of information in the information statistics results in the database; Determine the cache order of the information statistics results according to the priorities of the various types of information; According to the cache order of the information statistical results, the information statistical results are stored in the cache in order.
4. The cluster statistical information storage method according to any one of claims 1 to 3, characterized in that: The method of using the object gateway service master node to receive resource statistical information sent by each object gateway service non-master node and processing all resource statistical information to obtain information statistical results includes: When the object gateway service is started, it is determined to start a thread for sending a statistical request task; wherein the thread of the statistical request task is used to send a statistical request task to perform resource statistics; Based on the thread of the statistical request task, the object gateway service is used to determine whether the current object gateway service turns on the switch for statistical resource statistical information; If the current object gateway service does not have the switch for collecting resource statistics turned on, then the current statistics are terminated; If the current object gateway service has turned on the switch for collecting resource statistics, then determine the resource statistics of the current object gateway service; Determine whether the current object gateway service is the object gateway service master node; If the current object gateway service is not the object gateway service master node, the resource statistics information of the current object gateway service is sent to the object gateway service master node; If the current object gateway service is the object gateway service master node, it receives resource statistics information of other object gateway services; The object gateway service master node is used to collect statistics of resource statistics information of itself and other object gateway services to obtain the information statistics result.
5. The cluster statistical information storage method according to claim 4, characterized in that: If the current object gateway service is not the object gateway service master node, the resource statistics of the current object gateway service are sent to the object gateway service master node, including: Adding the resource statistics information obtained each time to a cache key-value pair; wherein the cache key-value pair is a key-value pair consisting of a key value and resource statistics information; Determine whether the number of data items in the cache key-value pair is greater than a set threshold; When it is greater than the set threshold, it is determined to send the resource statistics information of the current object gateway service to the object gateway service master node.
6. The cluster statistical information storage method according to claim 4, characterized in that: The resource statistics information includes user statistics information and bucket statistics information. The object gateway service master node is used to collect statistics on the resource statistics information of itself and other object gateway services to obtain the information statistics results, including: If the current user statistics information and bucket statistics information are incremental information, the object gateway service master node is used to accumulate the user statistics information and bucket statistics information of itself and other object gateway services to obtain a first information statistics result; If the current user statistics and bucket statistics are full information, the object gateway service master node is used to periodically update the quota of the user statistics and bucket statistics of itself and other object gateway services, and the latest user statistics and bucket statistics are used as the second information statistics result; The first information statistical result and the second information statistical result are used as the information statistical result.
7. The cluster statistical information storage method according to claim 1, characterized in that: The storing of the information statistics results by using a database includes: The information statistics result is sent to a management software platform, so that the information statistics result is written into a database based on the management software platform.
8. A cluster statistical information storage device, characterized in that: include: A resource statistics information determination module, configured to receive a client request using an object gateway service, and determine resource statistics information corresponding to the current object gateway service according to the client request; The information statistics result determination module is used to use the object gateway service master node to receive the resource statistics information sent by each object gateway service non-master node, process all the resource statistics information, and obtain the information statistics result; The storage module is used to store the information statistics results using a database.
9. A cluster statistics information storage device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute the computer program to implement the steps of the cluster statistical information storage method as claimed in any one of claims 1 to 7.
10. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the cluster statistical information storage method according to any one of claims 1 to 7 are implemented.