A method, device, equipment and readable storage medium for obtaining performance data
By obtaining PG data in the storage cluster and performing first-in-first-out queue statistics on incremental performance data, the problem of inaccurate storage pool performance statistics is solved, and more accurate and stable performance data display is achieved.
Patent Information
- Application Number
- CN202210870838.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-22
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2042-07-22
AI Technical Summary
The existing storage cluster performance statistics solution has a large number of OSDs and each OSD sends data at inconsistent times, resulting in an inability to accurately count storage pool performance during MON calculations, resulting in inaccurate statistics and large fluctuations.
By obtaining PG data, determining incremental performance data, and writing it into a first-in-first-out performance data queue for cumulative statistics, storage pool performance data is obtained. The performance data queue is used to cache recent performance data to improve statistical accuracy.
It achieves the accuracy and stability of storage pool performance data, improves product usability and competitiveness, and can more realistically reflect product performance.
Smart Images

Figure CN115113825B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of storage technology, and in particular to a method, apparatus, device, and readable storage medium for acquiring performance data. Background Art
[0002] In a distributed storage system, a storage pool is an aggregation of PGs (Placement Groups, a carrier for placing objects).
[0003] For storage clusters, performance statistics refer to the read and write bandwidth of the storage cluster. Read and write IOPS are important indicators of cluster performance and status. This information differs from the performance displayed by stress testing tools. Stress testing tools reflect performance from the client's perspective, and storage clusters should also have their own performance statistics and display methods.
[0004] The existing cluster performance statistics solution involves: OSDs calculate the data volume and read / write operation counts over a period of time; each OSD sends this statistical information to the master monitor; and the master monitor synchronizes the statistical information with the backup monitor when proposing a proposal, performing calculations, and displaying the results. This solution has a problem: due to the large number of OSDs in the storage pool, the time at which each OSD sends data to the monitor varies. As a result, the monitor's calculations may not necessarily reflect the data volume and read / write operation counts for all OSDs in the storage pool during that period.
[0005] In summary, how to effectively solve the problem of how to accurately calculate storage pool performance is a technical problem that those skilled in the art urgently need to solve. Summary of the Invention
[0006] The purpose of this application is to provide a performance data acquisition method, device, equipment and readable storage medium, which caches recent performance data through a performance data queue to make storage pool performance statistics more accurate, fluctuations more gradual, and better reflect the actual performance of the product, thereby improving product usability and enhancing product competitiveness.
[0007] To solve the above technical problems, this application provides the following technical solutions:
[0008] A performance data statistics method, comprising:
[0009] Acquire PG data; the PG data includes cumulative performance value and time;
[0010] Using the PG data and the PG data of the previous round of proposals, determine the performance increment data corresponding to the current round of proposals; the performance increment data includes performance increment and duration increment;
[0011] Writing the incremental performance data into a first-in-first-out performance data queue;
[0012] Statistical calculations are performed on the performance increment data of each round of proposals in the performance data queue to obtain storage pool performance data.
[0013] Preferably, writing the incremental performance data into a first-in-first-out performance data queue includes:
[0014] Accumulating the duration increments in the performance data queue to obtain a total duration increment;
[0015] Determine whether the total duration increment is greater than a preset duration threshold;
[0016] If yes, writing the incremental performance data into the performance data queue while ensuring that the number of data items in the performance data queue is less than a fixed number;
[0017] If not, directly write the incremental performance data into the performance data queue.
[0018] Preferably, writing the incremental performance data into the performance data queue while ensuring that the depth of the performance data queue is fixed includes:
[0019] Obtain the number of data items in the performance data queue;
[0020] Determining whether the number of data items is greater than a fixed number;
[0021] If yes, kicking out the performance incremental data that first enters the performance data queue, and then removing the performance incremental data from the performance data queue;
[0022] If not, the performance increment data is written into the performance data queue.
[0023] Preferably, statistical calculation is performed on the performance increment data of each round of proposals in the performance data queue to obtain storage pool performance data, including:
[0024] Accumulating the performance increment data in the performance data queue to obtain a total increment of read data, a total increment of write data, a total increment of read times, and a total increment of write times;
[0025] Accumulating the duration increments in the performance data queue to obtain a total duration increment;
[0026] Compare the total increment of read data, the total increment of write data, the total increment of read times, and the total increment of write times with the total duration increment to obtain the read bandwidth, write bandwidth, read times per second, and write times per second;
[0027] The read bandwidth, the write bandwidth, the number of reads per second, and the number of writes per second are determined as the storage pool performance data.
[0028] Preferably, the PG data and the PG data of the previous round of proposals are used to determine the performance increment data corresponding to the current round of proposals, including:
[0029] According to the data type, the PG data is subtracted from the PG data of the previous round of proposals to obtain the performance increment data corresponding to the current round of proposals.
[0030] Preferably, the obtaining of PG data includes:
[0031] Receive the PG data sent by OSD.
[0032] Preferably, it also includes:
[0033] Draw a performance trend graph corresponding to the storage pool performance data and historical storage pool performance data;
[0034] The performance trend graph is displayed on the visualization interface.
[0035] A performance data acquisition device, comprising:
[0036] PG data acquisition module, used to acquire PG data; the PG data includes cumulative performance value and time;
[0037] A proposal module is used to determine the performance increment data corresponding to the proposal in this round by using the PG data and the PG data of the previous round of proposals; the performance increment data includes performance increment and duration increment;
[0038] A data cache module, configured to write the incremental performance data into a first-in-first-out performance data queue;
[0039] The performance statistics module is used to perform statistical calculations on the performance increment data of each round of proposals in the performance data queue to obtain storage pool performance data.
[0040] An electronic device, comprising:
[0041] memory for storing computer programs;
[0042] A processor is used to implement the steps of the above-mentioned performance data acquisition method when executing the computer program.
[0043] A readable storage medium stores a computer program, which implements the steps of the above-mentioned performance data acquisition method when executed by a processor.
[0044] Apply the method provided in the embodiment of the present application to obtain PG data; the PG data includes cumulative performance values and time; use the PG data and the PG data of the previous round of proposals to determine the performance incremental data corresponding to this round of proposals; the performance incremental data includes performance value-added and duration value-added; write the performance incremental data into a first-in-first-out performance data queue; perform statistical calculations on the performance incremental data of each round of proposals in the performance data queue to obtain storage pool performance data.
[0045] In the present application, since the storage pool is an aggregation of PGs, the PG data is obtained first. It should be noted that in the present application, the PG data is the cumulative performance value and time, rather than the amount of data and the number of read and write operations within a period of time. After obtaining the PG data, the performance incremental data corresponding to the current round of proposals can be determined based on the PG data and the PG data of the previous round of proposals. The performance incremental data includes the performance incremental value and the duration increment. In order to make the obtained storage pool performance data more accurate, the present application also stores the performance incremental data in the performance data queue. Based on the performance data queue, the performance incremental data corresponding to multiple rounds of proposals can be statistically calculated to finally obtain the storage pool performance data. That is, the storage pool performance data is an integration of the PG data corresponding to the time of multiple rounds of proposals, which can more accurately characterize the true performance of the storage pool. That is, the storage pool performance data is more accurate.
[0046] Correspondingly, the embodiments of the present application also provide a performance data acquisition device, equipment and readable storage medium corresponding to the above-mentioned performance data acquisition method, which have the above-mentioned technical effects and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0048] Figure 1 This is a flowchart of a method for obtaining performance data in an embodiment of the present application;
[0049] Figure 2 This is a statistical diagram of data accumulation in an embodiment of the present application;
[0050] Figure 3 This is a statistical diagram of performance data in an embodiment of the present application;
[0051] Figure 4 This is a schematic diagram of a performance data queue in an embodiment of the present application;
[0052] Figure 5This is another schematic diagram of a performance data queue in an embodiment of the present application;
[0053] Figure 6 This is a schematic structural diagram of a performance data acquisition device in an embodiment of the present application;
[0054] Figure 7 This is a schematic structural diagram of an electronic device according to an embodiment of the present application;
[0055] Figure 8 This is a schematic diagram of the specific structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0056] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific embodiments. Obviously, the embodiments described are only a part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making any creative efforts are within the scope of protection of the present application.
[0057] For ease of understanding, the following describes and explains the relevant terms involved in this application:
[0058] OSD, Object-based Storage Device, object storage device;
[0059] MON, Monitor, monitoring module;
[0060] PG, Placement Group, a carrier for placing objects;
[0061] SSD, Solid State Disk, solid state electronic storage array hard disk;
[0062] HDD, Hard Disk Drive, hard disk drive;
[0063] IOPS, Input / Output Operations Per Second, the number of read and write operations per second.
[0064] Please refer to Figure 1 , Figure 1 This is a flowchart of a method for obtaining performance data in an embodiment of the present application. The method can be applied to a MON, and the method includes the following steps:
[0065] S101. Obtain PG data.
[0066] PG data includes cumulative performance values and time. The cumulative performance values can specifically include the total amount of read data, the total amount of write data, the total number of reads, and the total number of writes. The time is the time when the cumulative performance value was determined, such as 2022-7-10-13:52:25.
[0067] Specifically, the MON can obtain the PG data by receiving data sent by other modules or devices, or by reading data from a database or other form of data stored in a readable storage medium. In this application, the PG data includes cumulative performance values and time.
[0068] In a distributed file system, stored content is segmented into fixed-size chunks. This fixed-size chunk of data is called an object. A PG is a logical aggregation of multiple objects. PGs and objects are mapped using a consistent hashing algorithm, with one PG corresponding to multiple objects. Each PG is mapped to an OSD using a data distribution algorithm, with one PG corresponding to multiple OSDs. An OSD can be simply thought of as a physical disk; multiple PGs can reside on one OSD, allowing the desired content to be stored on the disk.
[0069] The client always maps the data object to the PG first, and then sends it to the master of the PG (OSD), so all data read and write operations must go through the master of the PG. Therefore, in a specific implementation of the present application, step S101 obtains PG data, which can specifically include: receiving PG data sent by the OSD. That is, the OSD performs performance statistics on PG in units of PG, thereby obtaining the cumulative performance value and time, and feeding it back to the MON. Specifically, when the OSD processes read and write operations, it counts the data read and write bandwidth and the number of read and write operations, and uses a cumulative method to store the performance data in the database (MON can read it from the database). That is, after the storage pool is created, the performance statistics in the storage pool will only increase and not decrease. For example Figure 2 As shown in the figure, the client wants to write 5M data to pg1.1. The master of this pg is osd.0. Then the write bandwidth of pg1.1 counted by this osd will increase by 5M. Next time, if 4M is written, the write bandwidth will continue to increase by 4M, that is, 9M. The same applies to other statistics. I will not go into details here.
[0070] OSD can send PG data to MON at a fixed time. Every time MON receives PG data, it can update the stored PG data until the proposal time is reached.
[0071] S102. Determine the performance increment data corresponding to the proposals in this round by using the PG data and the PG data of the previous round of proposals.
[0072] Among them, performance incremental data includes performance value-added and duration value-added.
[0073] It should be noted that in this application, PG data is the latest data obtained, and the PG data of the previous round of proposals is the latest PG data corresponding to the previous round of proposals. In this application, there is no limit on the number of times MON obtains PG data between two proposals. In other words, before the next proposal, it can be continuously updated based on the PG data sent by OSD. For the PG data sent by different OSDs, the PG data is accumulated and counted in units of PG.
[0074] After the proposal time arrives, the performance increment data corresponding to the current proposal can be removed directly based on the current PG data and the PG data of the previous proposal. That is, the performance increment data corresponds to the performance increment data between this proposal and the previous proposal.
[0075] In a specific implementation of the present application, step S102 uses PG data and PG data of the previous round of proposals to determine the performance increment data corresponding to this round of proposals, specifically including: according to the data type, the PG data and the PG data of the previous round of proposals are subtracted to obtain the performance increment data corresponding to this round of proposals. In other words, the PG data of this proposal is directly subtracted from the corresponding data type in the PG data of the previous round of proposals to obtain the performance increment data corresponding to this round of proposals. For example, the PG data of this proposal includes: a total amount of write data of 30M, a total amount of read data of 10M, 150 write times, 60 read times, and time: 2022-6-24-09:51:05; the PG data corresponding to the previous round of proposals includes: a total amount of write data of 10M, a total amount of read data of 5M, 50 write times, 300 read times, and time: 2022-6-24-09:51:00. Please refer to the table below and perform difference calculations for the corresponding types. The performance increment data corresponding to this round of proposals include: write data increment 20M, read data increment 5M, write number increment 30, read number increment 60, and duration increment: 5 seconds.
[0076]
[0077] It should be noted that when it is the first proposal, the total amount of write data, total amount of read data, number of writes and number of reads corresponding to the previous round of proposals can be initialized to zero; the first statistical time of the PG data corresponding to this round of proposals is set to the time of the previous round of proposals.
[0078] S103: Write the incremental performance data into a first-in-first-out performance data queue.
[0079] After obtaining the incremental performance data, it is written into a first-in-first-out performance data queue.
[0080] Incremental performance data includes incremental write data, incremental read data, incremental write counts, incremental read counts, and incremental duration. Based on this data, the storage pool's read bandwidth, write bandwidth, and IOPS for the time period corresponding to the current and previous rounds of proposals can be directly calculated. To avoid inaccurate performance statistics for the storage pool based directly on the time period corresponding to the current and previous rounds of proposals, performance statistics corresponding to multiple rounds of proposals can be collected to avoid inaccuracies caused by performance fluctuations corresponding to a single round of time.
[0081] Based on this, in this application, a performance data queue is set up, in which incremental performance data is cached so that more accurate storage pool performance data can be obtained later.
[0082] In actual applications, the depth of the performance data queue (ie, the number of data items in the queue) may be fixed or not fixed, and the specific situation can be set according to actual needs, which will not be described in detail here.
[0083] S104: Statistically calculate the incremental performance data of each round of proposals in the performance data queue to obtain storage pool performance data.
[0084] In the present application, the incremental performance data of each round of proposals in the performance data queue is statistically calculated to obtain the storage pool performance data, that is, the storage pool performance data is a valid statistic of the performance data corresponding to multiple proposals in the performance data queue. In other words, the storage pool performance data will not be calculated by MON because the number of OSDs in the storage pool is large and the time for each OSD to send data to MON is not fixed. In other words, the storage pool performance data will not necessarily be the data volume and number of read and write operations of all OSDs in the storage pool during this period of time due to the large number of OSDs in the storage pool. That is, the storage pool performance data obtained by UO in the present application is the data volume and number of read and write operations of all OSDs in the storage pool within the time range of these multiple rounds of proposals.
[0085] In a specific embodiment of the present application, step S104 performs statistical calculations on the incremental performance data of each round of proposals in the performance data queue to obtain storage pool performance data, including:
[0086] Step 1: Accumulate the performance increment data in the performance data queue to obtain the total increment of read data, the total increment of write data, the total increment of read times, and the total increment of write times;
[0087] Step 2: Accumulate the duration increments in the performance data queue to obtain the total duration increment;
[0088] Step 3: Compare the total increment of read data, the total increment of write data, the total increment of read times, and the total increment of write times with the total duration increment to obtain the read bandwidth, write bandwidth, read times per second, and write times per second.
[0089] Step 4: Determine the read bandwidth, write bandwidth, read times per second, and write times per second as storage pool performance data.
[0090] For ease of description, the above four steps are combined and explained below.
[0091] Please refer to Figure 3 , Figure 3 Schematic diagram of the statistics of performance data in the embodiment of the present application. Accumulate the various incremental performance data in the performance data queue to obtain the total incremental read data, the total incremental write data, the total incremental read times and the total incremental write times; accordingly, accumulate the duration increment in the performance data queue to obtain the total duration increment. That is, no matter how many groups of incremental performance data there are in the performance data queue, all types of data in these incremental performance data are accumulated separately to obtain the total incremental read data, the total incremental write data, the total incremental read times, the total incremental write times and the total duration increment, and then compare the total incremental read data, the total incremental write data, the total incremental read times and the total incremental write times with the total duration increment respectively, to obtain the read bandwidth, write bandwidth, read times per second and write times per second; that is, the storage pool performance data is the read bandwidth, write bandwidth, read times per second and write times per second.
[0092] After obtaining the storage pool performance data, a performance trend chart can be plotted, combining the storage pool performance data with historical storage pool performance data. This performance trend chart can be displayed on a visual interface. This allows users to accurately visualize storage performance trends, allowing them to decide whether to add or remove corresponding services and assess the actual performance status of the connected storage pool. This performance trend chart can be in the form of a line chart, a bar chart, or other similar formats.
[0093] Apply the method provided in the embodiment of the present application to obtain PG data; the PG data includes cumulative performance values and time; use the PG data and the PG data of the previous round of proposals to determine the performance incremental data corresponding to this round of proposals; the performance incremental data includes performance value-added and duration value-added; write the performance incremental data into a first-in-first-out performance data queue; perform statistical calculations on the performance incremental data of each round of proposals in the performance data queue to obtain storage pool performance data.
[0094] In the present application, since the storage pool is an aggregation of PGs, the PG data is obtained first. It should be noted that in the present application, the PG data is the cumulative performance value and time, rather than the amount of data and the number of read and write operations within a period of time. After obtaining the PG data, the performance incremental data corresponding to the current round of proposals can be determined based on the PG data and the PG data of the previous round of proposals. The performance incremental data includes the performance incremental value and the duration increment. In order to make the obtained storage pool performance data more accurate, the present application also stores the performance incremental data in the performance data queue. Based on the performance data queue, the performance incremental data corresponding to multiple rounds of proposals can be statistically calculated to finally obtain the storage pool performance data. That is, the storage pool performance data is an integration of the PG data corresponding to the time of multiple rounds of proposals, which can more accurately characterize the true performance of the storage pool. That is, the storage pool performance data is more accurate.
[0095] It should be noted that, based on the above embodiments, the embodiments of the present application also provide corresponding improved solutions. In the preferred / improved embodiments, the same steps or corresponding steps as those in the above embodiments can be referenced to each other, and the corresponding beneficial effects can also be referenced to each other, and will not be described in detail in the preferred / improved embodiments of this document.
[0096] Since the calculation of MON depends on the MON's proposal (usually once every 5 seconds), the MON's proposal time is relatively fixed when the cluster is normal, but when a cluster failure occurs, the proposal time will be greatly shortened (such as 0.1 seconds to 1 second), resulting in large fluctuations in the performance calculated during this period. To solve this problem, the present application proposes to dynamically adjust the depth of the performance data queue to adapt to failure scenarios and normal operation scenarios. Specifically, in executing step S103, the performance incremental data is written into the first-in-first-out performance data queue, including:
[0097] Step 1: Accumulate the duration increments in the performance data queue to obtain the total duration increment;
[0098] Step 2: Determine whether the total duration increment is greater than a preset duration threshold;
[0099] Step 3: If yes, then write the incremental performance data into the performance data queue while ensuring that the number of data entries in the performance data queue is less than the fixed number;
[0100] Step 4: If not, directly write the incremental performance data into the performance data queue.
[0101] For ease of understanding, the above four steps are combined and explained below.
[0102] By reading the duration increments in the performance data queue and accumulating them, the total duration increment corresponding to the performance data queue can be obtained, which is also the duration corresponding to the data stored in the performance data queue. When the total duration increment is greater than the preset duration threshold, it indicates that the performance data queue can meet the statistical requirements at this time, and thus the length of the performance data queue can be fixed at this time. That is, at this time, while ensuring that the number of data items in the performance data queue is less than a fixed number, the performance increment data can be written into the performance data queue. In a specific embodiment of the present application, the above-mentioned step three, writing the performance increment data into the performance data queue while ensuring that the depth of the performance data queue is fixed, includes:
[0103] Step 1: Get the number of data items in the performance data queue.
[0104] Step 2: Determine whether the number of data items is greater than the fixed number;
[0105] Step 3: If yes, kick out the performance incremental data that first enters the performance data queue, and then queue the performance incremental data into the performance data queue;
[0106] Step 4: If not, write the incremental performance data into the performance data queue.
[0107] Please refer to Figure 4 , Figure 4 The following is a schematic diagram of a performance data queue in an embodiment of the present application. That is, according to the first-in-first-out rule, when the number of data items is greater than a fixed number (such as 10, which can of course be set to other values that can be effectively counted based on the length of the proposal), the performance incremental data that first enters the performance data queue is kicked out first, and then the performance incremental data is added to the performance data queue, thereby ensuring that the depth of the performance data queue is fixed; when the number of data items is not greater than the fixed number, the performance incremental data can be directly written to the performance data queue.
[0108] If the total duration increment is not greater than the preset duration threshold, it indicates that the proposal time is shortened and the application is in a fault scenario. At this time, more performance data corresponding to this proposal needs to be counted to more accurately express the actual storage pool performance. Therefore, the performance data queue can be deepened at this time, that is, the incremental performance data can be directly written into the performance data queue. Please refer to Figure 5 , Figure 5 This is another performance data queue diagram for an embodiment of the present application; while the depth of the performance data queue is not limited, the time duration of the data recorded by the performance data queue is limited to no more than a preset duration threshold, such as 40 seconds. This value can be adjusted based on the length of regular resolution times, resolution times in fault scenarios, and the duration of data reported by each OSD, to ensure that the resulting storage pool performance data reflects the actual situation.
[0109] In other words, using time to regulate queue depth can prevent the MON proposal time from being shortened in failure scenarios, giving the OSD more time to report more statistical data, and avoiding problems such as inaccurate calculations and large fluctuations caused by insufficient data.
[0110] Corresponding to the above method embodiment, the embodiment of the present application further provides a performance data acquisition device. The performance data acquisition device described below and the performance data acquisition method described above can refer to each other.
[0111] See also Figure 6 As shown, the device includes the following modules:
[0112] PG data acquisition module 101, used to acquire PG data; PG data includes cumulative performance value and time;
[0113] The proposal module 102 is used to determine the performance increment data corresponding to the proposal of this round by using the PG data and the PG data of the previous round of proposals; the performance increment data includes the performance increment and the duration increment;
[0114] The data cache module 103 is used to write incremental performance data into a first-in-first-out performance data queue;
[0115] The performance statistics module 104 is used to perform statistical calculations on the performance increment data of each round of proposals in the performance data queue to obtain storage pool performance data.
[0116] Use the device provided in the embodiment of the present application to obtain PG data; the PG data includes cumulative performance values and time; use the PG data and the PG data of the previous round of proposals to determine the performance incremental data corresponding to this round of proposals; the performance incremental data includes performance value-added and duration value-added; write the performance incremental data into a first-in-first-out performance data queue; perform statistical calculations on the performance incremental data of each round of proposals in the performance data queue to obtain storage pool performance data.
[0117] In the present application, since the storage pool is an aggregation of PGs, the PG data is obtained first. It should be noted that in the present application, the PG data is the cumulative performance value and time, rather than the amount of data and the number of read and write operations within a period of time. After obtaining the PG data, the performance incremental data corresponding to the current round of proposals can be determined based on the PG data and the PG data of the previous round of proposals. The performance incremental data includes the performance incremental value and the duration increment. In order to make the obtained storage pool performance data more accurate, the present application also stores the performance incremental data in the performance data queue. Based on the performance data queue, the performance incremental data corresponding to multiple rounds of proposals can be statistically calculated to finally obtain the storage pool performance data. That is, the storage pool performance data is an integration of the PG data corresponding to the time of multiple rounds of proposals, which can more accurately characterize the true performance of the storage pool. That is, the storage pool performance data is more accurate.
[0118] In a specific embodiment of the present application, the data cache module 103 is specifically configured to accumulate the duration increments in the performance data queue to obtain a total duration increment;
[0119] Determine whether the total duration increment is greater than a preset duration threshold;
[0120] If yes, then write the incremental performance data into the performance data queue while ensuring that the number of data entries in the performance data queue is less than the fixed number;
[0121] If not, the incremental performance data is directly written to the performance data queue.
[0122] In a specific embodiment of the present application, the data cache module 103 is specifically used to obtain the number of data items in the performance data queue;
[0123] Determine whether the number of data items is greater than the fixed number;
[0124] If yes, the performance incremental data that first enters the performance data queue is kicked out, and the performance incremental data is queued;
[0125] If not, the incremental performance data is written to the performance data queue.
[0126] In a specific embodiment of the present application, the performance statistics module 104 is specifically configured to accumulate the incremental performance data in the performance data queue to obtain the total incremental read data, the total incremental write data, the total incremental read times, and the total incremental write times;
[0127] Accumulate the duration increments in the performance data queue to obtain the total duration increment;
[0128] Compare the total increment of read data, the total increment of write data, the total increment of read times, and the total increment of write times with the total duration increment to obtain the read bandwidth, write bandwidth, read times per second, and write times per second.
[0129] Read bandwidth, write bandwidth, reads per second, and writes per second are determined as storage pool performance data.
[0130] In a specific implementation of the present application, the proposal module 102 is specifically used to subtract the PG data from the PG data of the previous round of proposals according to the data type to obtain the performance increment data corresponding to the current round of proposals.
[0131] In a specific implementation of the present application, the PG data acquisition module 101 is specifically configured to receive PG data sent by the OSD.
[0132] In a specific embodiment of the present application, it also includes:
[0133] A display module is used to draw performance trend graphs corresponding to storage pool performance data and historical storage pool performance data;
[0134] Display performance trend charts on the visual interface.
[0135] Corresponding to the above method embodiment, an embodiment of the present application further provides an electronic device. The electronic device described below and the performance data acquisition method described above can refer to each other.
[0136] See also Figure 7 As shown, the electronic device includes:
[0137] Memory 332, for storing computer programs;
[0138] The processor 322 is configured to implement the steps of the performance data acquisition method of the above method embodiment when executing a computer program.
[0139] For details, please refer to Figure 8 , Figure 8 This is a schematic diagram of the specific structure of an electronic device provided in this embodiment. The electronic device may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 322 (for example, one or more processors) and a memory 332, and the memory 332 stores one or more computer applications 342 or data 344. Among them, the memory 332 can be a temporary storage or a permanent storage. The program stored in the memory 332 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the data processing device. Furthermore, the central processing unit 322 can be configured to communicate with the memory 332 to execute a series of instruction operations in the memory 332 on the electronic device 301.
[0140] The electronic device 301 may further include one or more power supplies 326 , one or more wired or wireless network interfaces 350 , one or more input / output interfaces 358 , and / or one or more operating systems 341 .
[0141] The steps in the performance data acquisition method described above can be implemented by the structure of an electronic device.
[0142] Corresponding to the above method embodiment, an embodiment of the present application further provides a readable storage medium. The readable storage medium described below and the performance data acquisition method described above can refer to each other.
[0143] A readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the performance data acquisition method of the above method embodiment.
[0144] The readable storage medium may specifically be any readable storage medium that can store program code, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0145] Those skilled in the art 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 above description has generally described the composition and steps of each example according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art 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 this application.
Claims
1. A method for obtaining performance data, characterized in that: include: Obtain placement group PG data; the PG data includes cumulative performance values and time; Using the PG data and the PG data of the previous round of proposals, determine the performance increment data corresponding to the current round of proposals; The performance increment data includes performance increment and duration increment; Writing the incremental performance data into a first-in-first-out performance data queue; Performing statistical calculations on the performance increment data of each round of proposals in the performance data queue to obtain storage pool performance data; The performance increment data of each round of proposals in the performance data queue is statistically calculated to obtain storage pool performance data, including: Accumulating the performance increment data in the performance data queue to obtain a total increment of read data, a total increment of write data, a total increment of read times, and a total increment of write times; Accumulating the duration increments in the performance data queue to obtain a total duration increment; Compare the total increment of read data, the total increment of write data, the total increment of read times, and the total increment of write times with the total duration increment to obtain the read bandwidth, write bandwidth, read times per second, and write times per second; The read bandwidth, the write bandwidth, the number of reads per second, and the number of writes per second are determined as the storage pool performance data.
2. The performance data acquisition method according to claim 1, characterized in that: Writing the incremental performance data into a first-in-first-out performance data queue includes: Accumulating the duration increments in the performance data queue to obtain a total duration increment; Determine whether the total duration increment is greater than a preset duration threshold; If yes, writing the incremental performance data into the performance data queue while ensuring that the number of data items in the performance data queue is less than a fixed number; If not, directly write the incremental performance data into the performance data queue.
3. The performance data acquisition method according to claim 2, characterized in that: The step of writing the incremental performance data into the performance data queue while ensuring that the depth of the performance data queue is fixed includes: Obtain the number of data items in the performance data queue; Determining whether the number of data items is greater than a fixed number; If yes, kicking out the performance incremental data that first enters the performance data queue, and then removing the performance incremental data from the performance data queue; If not, the performance increment data is written into the performance data queue.
4. The performance data acquisition method according to claim 1, characterized in that: Using the PG data and the PG data of the previous round of proposals, determine the performance increment data corresponding to the current round of proposals, including: According to the data type, the PG data is subtracted from the PG data of the previous round of proposals to obtain the performance increment data corresponding to the current round of proposals.
5. The performance data acquisition method according to claim 1, characterized in that: Get PG data, including: Receive the PG data sent by the OSD.
6. The performance data acquisition method according to any one of claims 1 to 5, characterized in that: Also includes: Draw a performance trend graph corresponding to the storage pool performance data and historical storage pool performance data; The performance trend graph is displayed on a visual interface.
7. A performance data acquisition device, characterized in that: include: A PG data acquisition module is used to acquire placement group PG data; the PG data includes cumulative performance values and time; A proposal module is used to determine the performance increment data corresponding to the proposal in this round by using the PG data and the PG data of the previous round of proposals; The performance increment data includes performance increment and duration increment; A data cache module, configured to write the incremental performance data into a first-in-first-out performance data queue; A performance statistics module is used to perform statistical calculations on the performance increment data of each round of proposals in the performance data queue to obtain storage pool performance data; Among them, the performance statistics module is specifically used to accumulate the performance incremental data in the performance data queue to obtain the total increment of read data, the total increment of write data, the total increment of read times and the total increment of write times; accumulate the duration increment in the performance data queue to obtain the total duration increment; compare the total increment of read data, the total increment of write data, the total increment of read times and the total increment of write times with the total duration increment respectively to obtain the read bandwidth, write bandwidth, read times per second and write times per second; determine the read bandwidth, write bandwidth, read times per second and write times per second as the storage pool performance data.
8. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the performance data acquisition method according to any one of claims 1 to 6 when executing the computer program.
9. A readable storage medium, characterized in that: The readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the performance data acquisition method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Performance analysis method and device for storage equipment and readable storage medium
CN112269723A
Storage device parameter monitoring for load balancing
US20210334030A1