Port performance parameter statistics method and device, storage medium and program product
By using the target service components and performance statistics threads in the main network attached storage server, the performance parameters of the logical port in the NAS are obtained, and the average performance parameters are calculated by the target management component, the existing technology cannot perform performance statistics on the logical port in the NAS. Problem, real-time monitoring and efficient data processing are realized.
Patent Information
- Application Number
- CN202411807497.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-12-10
AI Technical Summary
The prior art cannot perform performance statistics on logical ports in NAS, resulting in the inability to monitor and manage the performance of network storage systems in real time.
The performance parameters of the logical port are obtained through the target service component of the main network attached storage server, and the corresponding performance parameters are obtained from the network attached storage server through the performance statistics thread, and finally the average performance parameters are calculated by the target management component.
Real-time performance monitoring and statistics of logical ports in NAS are realized, and performance bottlenecks and abnormalities can be quickly identified, improving data processing efficiency and system scalability and reliability.
Smart Images

Figure CN119276888B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application are applied to the computer field, and specifically, relate to a method and device for counting port performance parameters, a storage medium, and a program product. Background Art
[0002] In today's data center and enterprise network environments, Network Attached Storage (NAS) systems are key data sharing platforms, and real-time monitoring of their performance parameters is becoming increasingly important. Although traditional NAS systems can provide file-level network storage services, they face significant challenges when counting the performance parameters of logical ports (such as IOPS, read and write bandwidth, and latency). Specifically, since logical ports are defined by software in user mode, the existing NAS architecture cannot directly query and provide real-time performance data of these ports.
[0003] Therefore, there is a technical problem in the prior art that it is impossible to perform performance statistics on logical ports in NAS. Summary of the invention
[0004] The embodiments of the present application provide a method and device for counting port performance parameters, a storage medium, and a program product, so as to at least solve the technical problem that performance statistics cannot be performed on logical ports in NAS.
[0005] According to an embodiment of the present application, a method for counting port performance parameters is provided, including: a master network attached storage server obtains a first performance parameter of a first logical port through a target service component, wherein the master network attached storage server belongs to a target server cluster, the first logical port is a network port of a file sharing service configured in the master network attached storage server, and the target service component is a service implementation component of a network file system of the master network attached storage server; the master network attached storage server obtains a second performance parameter of a second logical port sent from the network attached storage server through a performance statistics thread, wherein the slave network attached storage server belongs to the target server cluster, and the second logical port is a network port of a file sharing service configured in the network attached storage server; the master network attached storage server determines a first average performance parameter of the first logical port within a target time period based on the first performance parameter through the target management component, and determines a second average performance parameter of the second logical port within the target time period based on the second performance parameter.
[0006] According to another embodiment of the present application, a statistical device for port performance parameters is provided, including: a first acquisition unit, used to acquire a first performance parameter of a first logical port through a target service component, wherein a primary network attached storage server belongs to a target server cluster, the first logical port is a network port of a file sharing service configured in the primary network attached storage server, and the target service component is a service implementation component of a network file system of the primary network attached storage server; a second acquisition unit, used to acquire a second performance parameter of a second logical port sent from a network attached storage server through a performance statistics thread, wherein the secondary network attached storage server belongs to the target server cluster, and the second logical port is a network port of a file sharing service configured in the network attached storage server; a determination unit, used to determine a first average performance parameter of the first logical port within a target time period based on the first performance parameter through the target management component, and determine a second average performance parameter of the second logical port within the target time period based on the second performance parameter.
[0007] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.
[0008] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0009] According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps of the method described in each embodiment of the present application are implemented.
[0010] Through the embodiment provided by the present application, the master network attached storage server obtains the first performance parameter of the first logical port through the target service component, wherein the master network attached storage server belongs to the target server cluster, the first logical port is the network port of the file sharing service configured in the master network attached storage server, and the target service component is the service implementation component of the network file system of the master network attached storage server; the master network attached storage server obtains the second performance parameter of the second logical port sent from the network attached storage server through the performance statistics thread, wherein the slave network attached storage server belongs to the target server cluster, and the second logical port is the network port of the file sharing service configured from the network attached storage server; the master network attached storage server determines the first average performance parameter of the first logical port within the target time period based on the first performance parameter through the target management component, and determines the second average performance parameter of the second logical port within the target time period based on the second performance parameter. In other words, using the embodiment of the present application, on the one hand, through the target service component and the performance statistics thread, the master network attached storage server can obtain the performance parameters of the first logical port and the second logical port in real time, which include the number of read and write operations, the amount of data, and the key indicators such as delay. The acquisition of real-time data ensures the timeliness of performance monitoring, enabling administrators to quickly identify performance bottlenecks or abnormal situations. On the other hand, the master network attached storage server calculates the average performance parameters of the first logical port and the second logical port within the target time period, such as IOPS, read and write bandwidth, and latency, based on the obtained first and second performance parameters through the target management component. This method not only reduces the complexity of data processing, but also avoids direct operation of the original data, thereby improving the efficiency of data processing. On the other hand, the master network attached storage server and the slave network attached storage server exchange data through the performance statistics thread to achieve distributed performance statistics. This design allows multiple servers to work together, ensuring accurate statistics of performance parameters even in a high-load environment, thereby enhancing the scalability and reliability of the system. This solves the technical problem in the related art that performance statistics cannot be performed on logical ports in NAS. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 is a flow chart of a method for calculating the statistics of port performance parameters according to an embodiment of the present application;
[0012] Figure 2 is a schematic diagram of a statistical method for port performance parameters according to an embodiment of the present application;
[0013] Figure 3 is a schematic diagram of a statistical method for port performance parameters according to an embodiment of the present application;
[0014] Figure 4It is a structural block diagram of a device for collecting statistics of port performance parameters according to an embodiment of the present application. DETAILED DESCRIPTION
[0015] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0016] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0017] As an optional solution, the statistical method of the above port performance parameters has the following specific steps: Figure 1 Shown include:
[0018] S102, the main network attached storage server obtains a first performance parameter of a first logical port through a target service component, wherein the main network attached storage server belongs to a target server cluster, the first logical port is a network port of a file sharing service configured in the main network attached storage server, and the target service component is a service implementation component of a network file system of the main network attached storage server.
[0019] It should be noted that the above statistical method of port performance parameters can be applied to at least the following scenarios but is not limited to:
[0020] 1) Performance optimization of network attached storage (NAS) servers in data centers: In large data centers, NAS servers are often used to provide file-level shared storage services to support file access requirements of multiple servers and applications. Administrators need to monitor the performance of storage servers in real time to identify potential bottlenecks or failure points. Through the method of the present invention, the master network attached storage server can obtain the real-time performance parameters of the first logical port (the port configured by itself) and the second logical port (the port configured by the slave server) and calculate the average performance index. This enables administrators to quickly evaluate the overall performance of the storage server and the specific performance of different ports, thereby optimizing storage resource allocation and improving data access efficiency.
[0021] 2) Performance guarantee of storage services: In cloud storage services, NAS servers, as key storage components, need to ensure high availability and high performance. Cloud service providers can use the method of the present invention to monitor and analyze the performance parameters of multiple logical ports in real time. In this way, even when user access volume surges or abnormal access behavior occurs, it can be quickly identified and adjusted to ensure service continuity and responsiveness. For example, when it is detected that the average IOPS or bandwidth of a logical port is far below normal levels, the cloud service provider can adjust the load balancing strategy to direct traffic to ports with better performance.
[0022] Optionally, the master network attached storage server can be, but is not limited to, designated as a NAS server responsible for specific tasks in the target server cluster, such as statistics and management of performance parameters. Further, the target server cluster includes multiple NAS servers, but the master server refers to a server with specific control authority or main responsibility.
[0023] It should be noted that the target service component may be, but is not limited to, a software component running on a primary network attached storage server, used to implement a Network File System (NFS) service, enabling clients in the network to access files stored on the server. The target service component may be, but is not limited to, an open source NFS server implementation such as NFS-Ganesha, configured in a NAS server. NFS service is a distributed file system protocol that allows computer systems to share files over a network. NFS allows users and programs to access files stored on remote systems as if they were accessing local storage.
[0024] Optionally, the first logical port may be, but is not limited to, used to indicate a virtual network interface defined on the NAS server for providing file sharing services. Unlike physical ports, logical ports are usually configured through software and can receive access requirements of different services or clients by binding network addresses.
[0025] Furthermore, the above-mentioned first performance parameter can be but is not limited to being used to indicate the performance indicators of the first logical port collected at a specific time point, including but not limited to the number of read and write times within a certain time period, the size of read and write data within a certain time period, the delay in performing read and write operations within a certain time period, etc., and no limitation is imposed on this in the present embodiment.
[0026] S104, the master network attached storage server obtains a second performance parameter of a second logical port sent by a slave network attached storage server through a performance statistics thread, wherein the slave network attached storage server belongs to a target server cluster, and the second logical port is a network port of a file sharing service configured in the network attached storage server.
[0027] Optionally, in this embodiment, the slave NAS server may be, but is not limited to, used to indicate other NAS servers in the server cluster except the master NAS server, which share performance data or receive instructions by communicating with the master NAS server.
[0028] Further, the second logical port is used to indicate a logical port configured in the slave network attached storage server for providing a file sharing service, which is similar to the first logical port but belongs to a different server. The second performance parameter is similar to the first performance parameter, which is a performance indicator of the second logical port collected at a specific time point, obtained by the slave network attached storage server and transmitted to the master server.
[0029] Optionally, the performance statistics thread is a software thread running on the primary NAS server, responsible for periodically acquiring performance parameters from other servers in the cluster (from the NAS server).
[0030] S106: The primary NAS server determines, through the target management component, a first average performance parameter of the first logical port within the target time period based on the first performance parameter, and determines a second average performance parameter of the second logical port within the target time period based on the second performance parameter.
[0031] It should be noted that the above-mentioned target management component can be, but is not limited to, a component running on the main network attached storage server, which is used to manage and calculate the average performance parameters of all logical ports within the target time period. The target management component is responsible for generating and maintaining the average performance parameters. Optionally, the above-mentioned target management component can be, but is not limited to, the following components, or other specific components with similar functions, which are not limited in this embodiment: Performance Monitoring Agent: This is a software component running on the NAS server, responsible for collecting system performance data, including CPU usage, memory usage, disk I / O, network traffic, etc., as well as specific performance indicators of the file system. These data may be obtained through system logs, hardware monitoring interfaces or special performance monitoring protocols. Performance Statistics Service: This service is responsible for collecting performance statistics from storage backends such as Ganesha, such as IOPS, read and write bandwidth and latency, and then performing data analysis and calculations, such as calculating the average performance indicators every 5 seconds. The results of these data processing will be saved in the database inside the NAS system for subsequent query and analysis. Performance Data Analysis Engine: It may be responsible for more advanced data analysis, such as trend prediction and anomaly detection, to help system administrators understand the performance status of the storage system and make optimization decisions.
[0032] Furthermore, the target time period may be, but is not limited to, a fixed or configurable time window, and the data collected during this time period will be used to calculate the average performance parameter. For example, the target time period may be set to 5 seconds to calculate the average performance within 5 seconds.
[0033] As an optional example, it is possible but not limited to Figure 2 The following example illustrates the statistical method of the above port performance parameters:
[0034] like Figure 2 As shown, when ganehsa1 of the primary network attached storage server 202 determines that a read / write request from the user client 206 is received through the first logical port, it determines a first performance parameter of the first logical port and stores the first performance parameter in the target database 208 through the performance statistics thread 210 .
[0035] Correspondingly, when ganehsa2 of the slave network attached storage server 204 determines that a read or write request from the user client is received through the second logical port, it determines a second performance parameter of the second logical port, and sends the second performance parameter to the performance statistics thread 210 of the master network attached storage server to store it in the target database, and then stores the second performance parameter in the target database 208 through the performance statistics thread 210.
[0036] Optionally, in some embodiments, when the above-mentioned first performance parameter includes the number of read and write times, read and write size, and read and write delay, the above-mentioned first average performance parameter may include but is not limited to the number of input / output operations per second (IOPS) of the first logical port within the above-mentioned target time period, the read and write bandwidth of the first logical port within the above-mentioned target time period, and the read and write delay of the first logical port within the above-mentioned target time period.
[0037] By adopting the embodiment of the present application, on the one hand, through the target service component and the performance statistics thread, the main network attached storage server can obtain the performance parameters of the first logical port and the second logical port in real time, including the number of read and write operations, the amount of data, and the key indicators such as delay. The acquisition of real-time data ensures the timeliness of performance monitoring, so that the administrator can quickly identify performance bottlenecks or abnormal situations. On the other hand, the main network attached storage server calculates the average performance parameters of the first logical port and the second logical port in the target time period based on the first and second performance parameters obtained by the target management component, such as IOPS, read and write bandwidth and delay. This method not only reduces the complexity of data processing, but also avoids direct operation of the original data, thereby improving the efficiency of data processing. On the other hand, the main network attached storage server and the slave network attached storage server exchange data through the performance statistics thread to realize distributed performance statistics. This design allows multiple servers to work together, ensuring accurate statistics of performance parameters even in a high-load environment, and enhancing the scalability and reliability of the system. Thereby solving the technical problem that the performance statistics of the logical ports in the NAS cannot be performed in the related art.
[0038] As an optional solution, the primary network attached storage server obtains the first performance parameter of the first logical port through the target service component, including:
[0039] In case a read request for a shared directory in a primary network attached storage server is received through a first logical port, a read performance parameter of the first logical port is determined.
[0040] In case a write request to a shared directory in a primary network attached storage server is received through a first logical port, a write performance parameter of the first logical port is determined.
[0041] Optionally, in some embodiments, the shared directory may be, but is not limited to, used to indicate a directory on the NAS server for access by multiple clients in the network. Through NFS-Ganesha, these directories can be exported and read and written by the client through the network. It should be noted that the read performance parameters may include, but are not limited to: read times, read size, read delay, etc. Correspondingly, the write performance parameters may include, but are not limited to: write times, write size, write delay, etc.
[0042] Furthermore, the above read request and write request are used to indicate the network request sent by the user client to NFS-Ganesha for accessing files in the shared directory. The read request is a request to read data, while the write request is a request to write data.
[0043] Optionally, in the above-mentioned case where a read request for a shared directory in the primary network attached storage server is received through the first logical port, determining the read performance parameters of the first logical port may include but is not limited to: in the case where a read request is received through a target logical port in the first logical port, determining the network address corresponding to the target logical port; in the case where historical performance parameters corresponding to the network address are found in the first parameter linked list, determining the read performance parameters of the target logical port, and replacing the historical read performance parameters in the historical performance parameters with the read performance parameters; in the case where the historical performance parameters corresponding to the network address are not found in the first parameter linked list, determining the read performance parameters, and adding the read performance parameters to the first parameter linked list.
[0044] Optionally, in the above-mentioned case where a write request to a shared directory in the primary network attached storage server is received through the first logical port, determining the write performance parameters of the first logical port may include but is not limited to: in the case where a write request is received through a target logical port in the first logical port, determining the network address corresponding to the target logical port; in the case where historical performance parameters corresponding to the network address are found in the first parameter linked list, determining the write performance parameters of the target logical port, and replacing the historical write performance parameters in the historical performance parameters with the write performance parameters; in the case where the historical performance parameters corresponding to the network address are not found in the first parameter linked list, determining the write performance parameters, and adding the write performance parameters to the first parameter linked list.
[0045] By using the embodiments of the present application, by separately counting the read and write performance parameters, it is easier to find out whether there is a performance bottleneck in the read operation or the write operation. For example, if the latency of the read operation is significantly higher than that of the write operation, this may indicate that the storage system has difficulty reading data and needs to optimize the cache strategy or data reading path.
[0046] As an optional solution, when a read request for a shared directory in the primary network attached storage server is received through the first logical port, determining the read performance parameter of the logical port includes:
[0047] S1, when a read request is received through a target logical port in the first logical port, determining a network address corresponding to the target logical port.
[0048] Optionally, in some embodiments, the network address corresponding to the above-mentioned target logical port can be but is not limited to being used to indicate the IP address corresponding to the above-mentioned target logical port, and the user client can access the target logical port through the IP address corresponding to the target logical port to read and write data in the above-mentioned shared directory through the target logical port.
[0049] S2-1, when the historical performance parameters corresponding to the network address are found in the first parameter linked list, the read performance parameters of the target logical port are determined, and the historical read performance parameters in the historical performance parameters are replaced with the read performance parameters.
[0050] It should be noted that the first parameter linked list may be, but is not limited to, a data structure for storing the corresponding relationship between the IP of the logical port and the parameters corresponding to the logical port. Specifically, the data structure may include, but is not limited to, the historical read performance parameters of the logical port and the update time of the historical read performance parameters.
[0051] For example, the above data structure may include but is not limited to:
[0052] structvirtip_stats{structgsh_statss;structgsh_virtipvirtip;}, structgsh_stats{uint64_tr_ops;uint64_tw_ops;uint64_tr_bw;uint64_tw_bw;utime_tr_latency;utime_tw_latency}, structgsh_virtip{utime_tupdate_time;stringvirtip;}.
[0053] Among them, the above-mentioned structgsh_statsst is used to store performance parameters, the above-mentioned structgsh_virtipvirtip is used to store the IP address information of the logical port and the latest update time of the performance parameters; uint64_tr_ops is used to indicate the number of read operations, uint64_tw_ops is used to indicate the number of write operations, uint64_tr_bw is used to indicate the amount of read data (bytes), uint64_tw_bw is used to indicate the amount of written data (bytes), utime_tr_latency is used to indicate the read delay (seconds), and utime_tw_latency is used to indicate the write delay (seconds); utime_tupdate_time is used to indicate the update time, and stringvirtip is used to indicate the IP address of the logical port.
[0054] Optionally, in some embodiments, in the first parameter linked list, if the time interval between the last update time of the performance parameters stored in the data structure corresponding to a certain logical port and the current time exceeds a certain time interval (such as 30 minutes), the target service component will clear the structure to avoid occupying unnecessary system resources.
[0055] It should be noted that the above historical read performance parameters may include but are not limited to the following stored in the above data structure: number of read operations, number of write operations, amount of read data, amount of written data, read delay, and write delay.
[0056] S2-2, when the historical performance parameters corresponding to the network address are not found in the first parameter linked list, the read performance parameters are determined and added to the first parameter linked list.
[0057] Optionally, in some embodiments, historical performance parameters corresponding to the network address found in the first parameter linked list can be used for indication, but is not limited to, searching the data structure corresponding to the network address in the first parameter linked list, obtaining the historical performance parameters if the data structure exists, obtaining updated performance parameters based on the determined read performance parameters and historical performance parameters, and storing the updated performance parameters in the data structure; if the data structure does not exist, initializing the data structure of the target logical port, and adding the determined read performance parameters to the data structure.
[0058] By using the embodiment of the present application, by determining the specific network address corresponding to the read request, the read performance parameters of the first logical port can be accurately counted and monitored. This method ensures the accuracy and pertinence of the performance data, avoids confusing the read operations of different ports, and can provide independent and detailed read performance indicators for each logical port.
[0059] As an optional solution, when the historical performance parameters corresponding to the network address are found in the first parameter linked list, determining the read performance parameters of the target logical port includes:
[0060] S1, determining the amount of read data requested by the read request.
[0061] It should be noted that when a read request arrives, the main thread of the target service component will record the amount of data required to be read by the request, usually expressed in bytes. For example, if the client requests to read 10MB of data, the system will record the amount of data read as 10MB.
[0062] S2, determining the read time taken to complete the read request.
[0063] It should be noted that when a read request arrives, the main thread of the target service component will record the time it takes from receiving the read request to completing the read operation, usually expressed in seconds. For example, it may take 1 second to complete the read operation of the above 10MB of data.
[0064] S3, obtain the historical read count, historical read data volume, and historical read time of the target logical port recorded in the historical performance parameters, wherein the historical read count is the total number of historical read requests received by the target logical port in the first time period, the historical read data volume is the total requested read data volume of the historical read requests, and the historical read time is the total time taken to complete the historical read requests.
[0065] Optionally, the above historical read times may be, but are not limited to, used to indicate the total number of all read requests received by the target logical port within a certain period of time. The above historical read data volume may be, but are not limited to, used to indicate the total data volume of all read requests completed during this period of time. The above historical read time may be, but are not limited to, used to indicate the total time to complete all historical read requests.
[0066] S4, generating a target reading number based on the historical reading number and the target value.
[0067] It should be noted that the target value may be 1, and each time the target logical port obtains a read request, the number of reads will be accumulated by 1. The above-mentioned generation of the target read number based on the historical read number and the target value may be used, but not limited to, to include: summing the historical read number and the target value to obtain the above-mentioned target read number.
[0068] S5, generating a target read data volume based on the historical read data volume and the read data volume.
[0069] It should be noted that the above-mentioned generation of the target read data volume based on the historical read data volume and the read data volume may include, but is not limited to: summing the historical read data volume and the read data volume to obtain the above-mentioned target read data volume.
[0070] S6, generating a target reading time based on the historical reading time and reading time;
[0071] It should be noted that the above-mentioned generation of the target reading time based on the historical reading time and the reading time is not limited to including: summing the historical reading time and the reading time to obtain the above-mentioned target reading time.
[0072] The read performance parameters include target read times, target read data volume, and target read time.
[0073] For example, the above steps can be explained by the following examples, but are not limited to:
[0074] Assume that the target data structure of the target logical port in the first parameter linked list records the historical read performance data of the target logical port in the past 30 minutes as follows: historical read times: 200 times, historical read data volume: 2GB, historical read time: 200s.
[0075] When a new read request is received, the amount of data requested to be read by the read request and the read time taken to complete the read request are determined. Assume that the read data amount is 10 MB and the read time is 1 second.
[0076] Then calculate the target read performance parameters as follows: target read times: 200 times (historical) + 1 time (current) = 201 times; target read data volume: 2GB (historical) + 10MB (current) = 2.01GB; target read time: 200s (historical) + 1s (current) = 201s.
[0077] Next, the updated data will be recorded in the above target structure for use in subsequent calculation of read performance parameters.
[0078] It should be noted that the above example is an optional example provided for the convenience of explaining the above steps, and there is no limitation on the specific implementation of the above method for collecting statistics on port performance parameters.
[0079] By using the embodiment of the present application, on the one hand, by determining the amount of data for each read request and the time taken to complete the read, the system can record the specific performance data of each read operation in real time, which provides a basis for subsequent performance analysis and historical data comparison. On the other hand, the historical performance parameters of the corresponding network address are searched in the first parameter linked list, including the historical number of reads, the historical amount of read data, and the historical read time. This step ensures that the statistics of the read performance parameters include not only the current operation, but also the data in the past period of time, making the statistical results more comprehensive and accurate.
[0080] As an optional solution, when the historical performance parameter corresponding to the network address is not found in the first parameter linked list, determining the reading performance parameter includes:
[0081] S1, determining the amount of read data requested by the read request.
[0082] It should be noted that when a read request arrives, the main thread of the target service component will record the amount of data required to be read by the request, usually expressed in bytes. For example, if the client requests to read 10MB of data, the system will record the amount of data read as 10MB.
[0083] S2, determining the amount of read data requested by the read request;
[0084] It should be noted that when a read request arrives, the main thread of the target service component will record the time it takes from receiving the read request to completing the read operation, usually expressed in seconds. For example, it may take 1 second to complete the read operation of the above 10MB of data.
[0085] The read performance parameters include the number of reads, the amount of read data, and the target value.
[0086] For example, the above steps can be explained by the following examples, but are not limited to:
[0087] Assume that the target data structure of the target logical port in the first parameter linked list does not record any historical performance data of the target logical port;
[0088] When a new read request is received, the amount of data requested to be read by the read request and the read time taken to complete the read request are determined. Assume that the read data amount is 10 MB and the read time is 1 second.
[0089] Then calculate the target read performance parameters as follows: target read times: 1 (currently); target read data volume: 10MB (currently) = 2.01GB; target read time: 1s (currently) = 201s.
[0090] Next, the updated data will be recorded in the above target structure for use in subsequent calculation of read performance parameters.
[0091] It should be noted that the above example is an optional example provided for the convenience of explaining the above steps, and there is no limitation on the specific implementation of the above method for collecting statistics on port performance parameters.
[0092] For example, the above steps can be explained by, but not limited to, the following examples:
[0093] Assume that the target data structure of the target logical port does not exist in the first parameter linked list;
[0094] When a new read request is received, the amount of data requested to be read by the read request and the read time taken to complete the read request are determined. Assume that the read data amount is 10 MB and the read time is 1 second.
[0095] Then calculate the target read performance parameters as follows: target read times: 1 (currently); target read data volume: 10MB (currently) = 2.01GB; target read time: 1s (currently) = 201s.
[0096] Next, a target data structure is created for the target logical port in the first reference linked list, and the updated data is recorded in the target structure for subsequent calculation of the read performance parameters.
[0097] It should be noted that the above example is an optional example provided for the convenience of explaining the above steps, and there is no limitation on the specific implementation of the above method for collecting statistics on port performance parameters.
[0098] According to an embodiment of the present application, when the historical performance parameters corresponding to the network address are not found in the first parameter linked list, determining the read performance parameters includes: determining the amount of read data requested by the read request; determining the read time taken to complete the read request; wherein the read performance parameters include the number of reads, the amount of read data, and the target value. Through the above steps, even in the early stage of system startup or when the logical port is just configured, when there are no historical performance parameters, it is possible to immediately start counting and updating the read performance parameters to ensure the continuity and accuracy of performance monitoring. This is particularly important for discovering and resolving performance bottlenecks, because even in the early stages of service, data can be collected and analyzed in a timely manner, so that responses and optimizations can be made quickly.
[0099] As an optional solution, when a write request to a shared directory in the primary network attached storage server is received through the first logical port, determining a first write performance parameter of the first logical port includes:
[0100] S1, when a write request is received through a target logical port in the first logical port, determining a network address corresponding to the target logical port.
[0101] S2-1, when the historical performance parameters corresponding to the network address are found in the first parameter linked list, the write performance parameters of the target logical port are determined, and the historical write performance parameters in the historical performance parameters are replaced with the write performance parameters.
[0102] S2-2, when the historical performance parameters corresponding to the network address are not found in the first parameter linked list, determine the write performance parameters and add the write performance parameters to the first parameter linked list.
[0103] Optionally, in some embodiments, historical performance parameters corresponding to the network address found in the first parameter linked list can be used for indication, but is not limited to, searching the data structure corresponding to the network address in the first parameter linked list, obtaining the historical performance parameters if the data structure exists, obtaining updated performance parameters based on the determined read performance parameters and historical performance parameters, and storing the updated performance parameters in the data structure; if the data structure does not exist, initializing the data structure of the target logical port, and adding the determined read performance parameters to the data structure.
[0104] By adopting the embodiment of the present application, on the one hand, the historical performance parameters of each logical port are stored and updated through the first parameter linked list, thereby avoiding the waste of allocating fixed-size memory for each logical port. Especially for those logical ports that are not frequently used, this method can significantly reduce memory usage and improve the efficiency of system resource utilization. On the other hand, if the historical performance parameters corresponding to the network address are found in the first parameter linked list, the method will update these historical performance parameters instead of simply overwriting or creating new data records. This helps to maintain the consistency and continuity of the data, and ensures the accuracy and integrity of the performance parameters even after network fluctuations or system failures. On the other hand, by maintaining the first parameter linked list, even if the main network attached storage server fails or needs to be switched, the network attached storage server or other cluster members can quickly recover and continue to update the performance parameters based on the network address, ensuring the high availability of the statistical method in a cluster environment.
[0105] As an optional solution, when the historical performance parameters corresponding to the network address are found in the first parameter linked list, determining the write performance parameters of the target logical port includes:
[0106] S1, determining the amount of write data requested by the write request.
[0107] It should be noted that when a write request arrives, the main thread of the target service component will record the amount of data required to be written by the request, usually expressed in bytes. For example, if the client requests to write 10MB of data, the system will record the amount of data written as 10MB.
[0108] S2, determining the write time taken to complete the write request.
[0109] It should be noted that when a write request arrives, the main thread of the target service component will record the time it takes from receiving the write request to completing the write operation, usually expressed in seconds. For example, it may take 1 second to complete the write operation of the above 10MB of data.
[0110] S3, obtain the historical write count, historical write data volume, and historical write time of the target logical port recorded in the historical performance parameters, wherein the historical write count is the total number of historical write requests received by the target logical port in the first time period, the historical write data volume is the total requested write data volume of the historical write requests, and the historical write time is the total time taken to complete the historical write requests.
[0111] Optionally, the above historical write times may be, but are not limited to, used to indicate the total number of all write requests received by the target logical port within a certain period of time. The above historical write data volume may be, but are not limited to, used to indicate the total data volume of all write requests completed during this period of time. The above historical write time may be, but are not limited to, used to indicate the total time to complete all historical write requests.
[0112] S4, generating a target write count based on the historical write count and the target value.
[0113] It should be noted that the target value may be 1, and each time the target logical port obtains a read request, the number of reads will be accumulated by 1. The above-mentioned generation of the target read number based on the historical read number and the target value may be used, but not limited to, to include: summing the historical read number and the target value to obtain the above-mentioned target read number.
[0114] S5, generating a target write data volume based on the historical write data volume and the write data volume.
[0115] It should be noted that the above-mentioned generation of the target written data volume based on the historical written data volume and the written data volume may include, but is not limited to: summing the historical written data volume and the written data volume to obtain the above-mentioned target written data volume.
[0116] S6, generating a target write time based on the historical write time and the write time; wherein the write performance parameters include a target number of writes, a target amount of write data, and a target write time.
[0117] It should be noted that the above-mentioned generation of the target writing time based on the historical writing time and the writing time may include but is not limited to: summing the historical writing time and the writing time to obtain the above-mentioned target writing time.
[0118] By using the embodiments of the present application, on the one hand, by immediately counting the amount of data and completion time of each write request, the write performance parameters of the logical port can be updated in real time, which ensures the immediacy and accuracy of the write performance data, and facilitates the administrator to quickly identify potential performance bottlenecks under high load. On the other hand, after finding the historical performance parameters corresponding to the network address in the first parameter linked list, the historical data (historical write times, historical write data volume, and historical write time) can be integrated with the data of the current write operation to generate the target write times, target write data volume, and target write time. This integration mechanism not only reflects the current state of the write operation, but also takes into account the write performance trend over the past period of time, making the performance statistics more comprehensive, which is helpful for analyzing long-term performance and optimizing storage strategies.
[0119] As an optional solution, when the historical performance parameter corresponding to the network address is not found in the first parameter linked list, determining the write performance parameter includes:
[0120] Determines the amount of write data requested by the write request.
[0121] It should be noted that when a write request arrives, the main thread of the target service component will record the amount of data required to be written by the request, usually expressed in bytes. For example, if the client requests to write 10MB of data, the system will record the amount of data written as 10MB.
[0122] Determines the write time it took to complete a write request.
[0123] It should be noted that when a write request arrives, the main thread of the target service component will record the time it takes from receiving the write request to completing the write operation, usually expressed in seconds. For example, it may take 1 second to complete the write operation of the above 10MB of data.
[0124] The write performance parameters include the amount of written data, the write time, and the target value.
[0125] As an optional example, it is possible but not limited to Figure 3 The following example illustrates the statistical method of the above port performance parameters:
[0126] Step S302 is executed, the target service component receives the read / write request sent by the user client through the target logical port, and determines the read / write performance parameters corresponding to the target logical port when processing a single read / write request.
[0127] Execute step S304, the target service component determines whether there is a target data structure of the target logical port in the first parameter linked list.
[0128] If the target data structure does not exist, step S306-1 is executed to create a data structure for the target logical port in the first parameter linked list, and the corresponding read / write performance parameters when processing a single read / write request are added to the newly created data structure. Then step S310 is executed.
[0129] If the target data structure exists, step S306 - 2 is executed to determine whether the target data structure stores historical performance parameters of the target logical port.
[0130] If the historical performance parameters of the target logical port are stored, step S308-1 is executed to generate target performance parameters based on the historical performance parameters and the read / write performance parameters corresponding to a single read / write request, and the historical performance parameters in the target data structure are replaced with the target performance parameters. Then step S310 is executed.
[0131] If the historical performance parameters of the target logical port are not stored, step S308-2 is executed to add the read / write performance parameters corresponding to the single read / write request to the target data structure. Then step S310 is executed.
[0132] Step S310: when the time interval between the storage time of the performance data stored in the target data structure and the current time exceeds the target interval, the performance data stored in the target data structure is cleared.
[0133] According to the embodiment of the present application, when the historical performance parameters corresponding to the network address are not found in the first parameter linked list, determining the write performance parameters includes: determining the amount of write data requested by the write request; determining the write time taken to complete the write request; wherein the write performance parameters include the amount of write data, the write time, and the target value. Through the above steps, even if the logical port has just been configured and there is no historical performance data, the write performance parameters can be counted immediately to ensure the immediacy and effectiveness of monitoring and statistics.
[0134] As an optional solution, determining the average performance parameter of the first logical port within the target time period based on the first performance parameter by the target management component, and determining the average performance parameter of the first logical port within the target time period based on the second performance parameter includes:
[0135] A first average performance parameter is determined by the target management component based on the first performance parameter obtained at the first time, the first performance parameter obtained at the second time, and a time interval between the first time and the second time.
[0136] Optionally, in some embodiments, the determination of the first average performance parameter based on the first performance parameter acquired at the first time and the first performance parameter acquired at the second time, and the time interval between the first time and the second time may refer to, but is not limited to, the following implementations:
[0137] 1) Based on a first number of readings obtained at T1 (used to represent a first time) and a second number of readings obtained at T2 (used to represent a first time), and a time interval between T1 and T2, the number of readings per second in a target time period is obtained.
[0138] For example, taking the time interval between T1 and T2 as 5 seconds, the above steps can be illustrated with reference to, but not limited to, the following examples:
[0139] r_iops=(cur_r_iops-last_r_iops)÷5(1)
[0140] In formula (1), cur_r_iops is used to represent the second read count, last_r_iops is used to represent the first read count, and r_iops is used to represent the read count per second in the target time period.
[0141] It should be noted that the above example is an optional example provided for the convenience of explaining the above steps, and there is no limitation on the specific implementation of the above method for collecting statistics on port performance parameters.
[0142] 2) Based on a first number of writes obtained at T1 (used to represent the first time), a second number of writes obtained at T2 (used to represent the first time), and a time interval between T1 and T2, the number of writes per second in the target time period is obtained.
[0143] For example, taking the time interval between T1 and T2 as 5 seconds, the above steps can be illustrated with reference to, but not limited to, the following examples:
[0144] w_iops=(cur_w_iops-last_w_iops)÷5(2)
[0145] In formula (2), w_iops is used to represent the number of writes per second in the target time period, cur_w_iops is used to represent the second number of writes, and last_w_iops is used to represent the first number of writes.
[0146] It should be noted that the above example is an optional example provided for the convenience of explaining the above steps, and there is no limitation on the specific implementation of the above method for collecting statistics on port performance parameters.
[0147] 3) Based on the number of reads per second and the number of writes per second, generate the sum of the number of read and write operations occurring per second during the target time period, i.e., IOPS.
[0148] For example, taking the time interval between T1 and T2 as 5 seconds, the above steps can be illustrated with reference to, but not limited to, the following examples:
[0149] iops = r_iops + w_iops (3)
[0150] In formula (3), iops is used to represent the total number of read and write operations occurring per second in the target time period, r_iops is used to represent the number of reads per second, and w_iops is used to represent the number of writes per second.
[0151] It should be noted that the above example is an optional example provided for the convenience of explaining the above steps, and there is no limitation on the specific implementation of the above method for collecting statistics on port performance parameters.
[0152] 4) Based on the first reading time obtained at T1 (used to represent the first time) and the second reading time obtained at T2 (used to represent the first time), and the first reading number and the second reading number, obtain an average reading delay in the target time period.
[0153] For example, taking the time interval between T1 and T2 as 5 seconds, the above steps can be illustrated with reference to, but not limited to, the following examples:
[0154] r_rrt=(cur_r_rtt-last_r_rtt)÷(cur_r_iops-last_r_iops)(4)
[0155] In formula (4), r_rrt is used to represent the average read delay in the target time period, cur_r_rtt is used to represent the second read time, and last_r_rttt is used to represent the first read time.
[0156] It should be noted that the above example is an optional example provided for the convenience of explaining the above steps, and there is no limitation on the specific implementation of the above method for collecting statistics on port performance parameters.
[0157] 5) Based on the first writing time obtained at T1 (used to represent the first time) and the second writing time obtained at T2 (used to represent the first time), and the first number of writings and the second number of writings, obtain an average writing delay in the target time period.
[0158] For example, taking the time interval between T1 and T2 as 5 seconds, the above steps can be illustrated with reference to, but not limited to, the following examples:
[0159] w_rrt=(cur_w_rtt-last_w_rtt)÷(cur_w_iops-last_w_iops)(5)
[0160] In formula (5), w_rrt is used to represent the average write delay in the target time period, ur_w_rtt is used to represent the second write time, and last_w_rtt is used to represent the first write time.
[0161] It should be noted that the above example is an optional example provided for the convenience of explaining the above steps, and there is no limitation on the specific implementation of the above method for collecting statistics on port performance parameters.
[0162] 6) Based on the above average read latency and average write latency, generate the total latency for read and write operations.
[0163] For example, taking the time interval between T1 and T2 as 5 seconds, the above steps can be illustrated with reference to, but not limited to, the following examples:
[0164] rrt_total=(r_iops×r_rrt+w_iops×w_rrt)÷iops (6)
[0165] Wherein, in formula (6), rrt_total is used to represent the total delay of read and write operations.
[0166] It should be noted that the above example is an optional example provided for the convenience of explaining the above steps, and there is no limitation on the specific implementation of the above method for collecting statistics on port performance parameters.
[0167] 7) Based on a first read data volume obtained at T1 (used to represent a first time), a second read data volume obtained at T2 (used to represent the first time), and a time interval between T1 and T2, an average read bandwidth in a target time period is obtained.
[0168] For example, taking the time interval between T1 and T2 as 5 seconds, the above steps can be illustrated with reference to, but not limited to, the following examples:
[0169] r_mbps=(cur_r_mbps-last_r_mbps)÷5÷1024÷1024(7)
[0170] In formula (7), r_mbps is used to represent the average read bandwidth in the target time period, cur_r_mbps is used to represent the second read data volume, and last_r_mbps is used to represent the first read data volume.
[0171] It should be noted that the above example is an optional example provided for the convenience of explaining the above steps, and there is no limitation on the specific implementation of the above method for collecting statistics on port performance parameters.
[0172] 8) Based on a first write data volume obtained at T1 (used to represent a first time), a second write data volume obtained at T2 (used to represent the first time), and a time interval between T1 and T2, an average write bandwidth in a target time period is obtained.
[0173] For example, taking the time interval between T1 and T2 as 5 seconds, the above steps can be illustrated with reference to, but not limited to, the following examples:
[0174] w_mbps=(cur_w_mbps-last_w_mbps)÷5÷1024÷1024(8)
[0175] In formula (8), w_mbps is used to represent the average write bandwidth in the target time period, cur_w_mbps is used to represent the second write data volume, and last_w_mbps is used to represent the first write data volume.
[0176] It should be noted that the above example is an optional example provided for the convenience of explaining the above steps, and there is no limitation on the specific implementation of the above method for collecting statistics on port performance parameters.
[0177] 9) Generate average read and write bandwidths based on the average read bandwidth and the average write bandwidth.
[0178] For example, taking the time interval between T1 and T2 as 5 seconds, the above steps can be illustrated with reference to, but not limited to, the following examples:
[0179] mbps = r_mbps + w_mbps (9)
[0180] In formula (9), mbps is used to represent the average read and write bandwidth.
[0181] It should be noted that the above example is an optional example provided for the convenience of explaining the above steps, and there is no limitation on the specific implementation of the above method for collecting statistics on port performance parameters.
[0182] Among them, the above-mentioned first average performance parameter includes: the above-mentioned number of reads per second, the above-mentioned number of writes per second, the sum of the number of read and write operations occurring per second, the above-mentioned average read delay, the above-mentioned average write delay, the above-mentioned total delay of read and write operations, the above-mentioned average read bandwidth, the above-mentioned average write bandwidth and the above-mentioned average read and write bandwidth.
[0183] By using the embodiment of the present application, the target management component can determine the average performance parameter of the first logical port within the target time period based on the first performance parameter and the second performance parameter, as well as the time interval between the two time points. This realizes continuous monitoring and averaging of the performance parameters of the logical port, helps to smooth short-term fluctuations, and provides stable and representative performance indicators.
[0184] As an optional solution, after the primary network attached storage server determines the first average performance parameter of the first logical port within the target time period based on the first performance parameter through the target management component, and determines the second average performance parameter of the second logical port within the target time period based on the second performance parameter, the method further includes:
[0185] S1, the performance statistics thread adds the first average performance parameter and the second average performance parameter to the second parameter linked list.
[0186] It should be noted that, in some embodiments, the second parameter linked list stores another data structure of the logical port, which is different from the data structure in the first reference linked list. The elements included in the data structure of each logical port in the second parameter linked list are as follows:
[0187] 1) The serial number of the data structure in the second parameter linked list;
[0188] 2) The time when the data structure was last updated;
[0189] 3) The performance parameters of the logical port corresponding to the data structure (e.g., read and write time, number of read and write times, amount of read and write data, etc.);
[0190] 4) Average performance parameters of the logical port corresponding to the data structure (e.g., read / write latency, read / write bandwidth, IOPS, etc.);
[0191] 5) Port information of the logical port corresponding to the data structure, such as IP address, etc.
[0192] It should be noted that, in some embodiments, the above-mentioned performance statistics thread can be but is not limited to being used to indicate the process run by the above-mentioned target management component. That is, the above-mentioned main network attached storage server determines the first average performance parameter of the first logical port within the target time period based on the first performance parameter through the target management component, and determines the second average performance parameter of the second logical port within the target time period based on the second performance parameter. It can be but is not limited to including: determining the first average performance parameter of the first logical port within the target time period based on the first performance parameter through the performance statistics thread, and determining the second average performance parameter of the second logical port within the target time period based on the second performance parameter.
[0193] It should be noted that the above-mentioned adding of the first average performance parameter and the second average performance parameter to the second parameter linked list may include but is not limited to: adding the first average performance parameter to the first data structure corresponding to the first logical port in the second parameter linked list, and adding the first average performance parameter to the second data structure corresponding to the second logical port in the second parameter linked list.
[0194] S2, determining a first number of average performance parameters belonging to the first logical port recorded in the second parameter linked list, and determining a second number of average performance parameters belonging to the second logical port recorded in the second parameter linked list.
[0195] S3-1, when the first number is greater than the number threshold, clear i first average performance parameters belonging to the first logical port recorded in the second parameter linked list, where the recording time of the i first average performance parameters is earlier than the first reference time, and i is a positive integer.
[0196] S3-2, when the second number is greater than the number threshold, clear i second average performance parameters belonging to the second logical port recorded in the second parameter linked list, wherein the recording time of the i second average performance parameters is earlier than the second reference time.
[0197] It should be noted that the i first historical performance parameters here refer to the i earliest recorded historical performance parameters among the average performance parameters stored in the first data structure corresponding to the first logical port in the second parameter linked list. Correspondingly, the i second historical performance parameters here refer to the i earliest recorded historical performance parameters among the average performance parameters stored in the second data structure corresponding to the second logical port in the second parameter linked list.
[0198] It should be noted that, in some embodiments, the above-mentioned quantity threshold can be but is not limited to being set to 360, that is, the first average performance parameter and the second average performance parameter within 30 minutes are counted. It should be noted that the above-mentioned determination of the first quantity of the first average performance parameters recorded in the second parameter linked list and the determination of the second quantity of the second average performance parameters recorded in the second parameter linked list can include but is not limited to: determining the first quantity of each type of average performance parameters of the first logical port recorded in the second parameter linked list (the quantity of each type of average performance parameters is the same here), and determining the second quantity of each type of average performance parameters of the second logical port (the quantity of each type of average performance parameters is also the same here). In other words, the quantity counted here is not the total quantity of parameters corresponding to a certain logical port, but the quantity corresponding to each type of parameter, such as the quantity of IOPS.
[0199] It should be further explained that the i first historical performance parameters here refer to the i historical performance parameters recorded earliest in the average performance parameters stored in the first data structure corresponding to the first logical port in the second parameter linked list. Correspondingly, the i second historical performance parameters here refer to the i historical performance parameters recorded earliest in the average performance parameters stored in the second data structure corresponding to the second logical port in the second parameter linked list.
[0200] Optionally, in some embodiments, when the above-mentioned main network attached storage server is started, the performance statistics thread will obtain the M (e.g., 360) most recently updated average performance parameters of each logical port from the above-mentioned target database, and initialize a linked list with a fixed length (the value indicates the longest time that the average performance parameters can be displayed, for example, 30 minutes, then 360 average performance parameters can be stored).
[0201] Furthermore, the performance statistics thread is started after the second parameter list is initialized. It will obtain the total data value (such as the first performance parameter and the second performance parameter) from Ganesha every 5 seconds, and update the calculated average performance statistics within 5 seconds (such as the first average performance parameter and the second average performance data) to the current node of the second parameter list (i.e., the data structure of the logical port corresponding to the parameter). The specific update steps are as follows:
[0202] S1, compare the acquired IP with the IP addresses in each node (ie, data structure) in the second parameter linked list to find the corresponding logical port.
[0203] S2, fill the performance statistics of each IP into the corresponding structure. Specifically, once it is determined which logical port the total value of the statistics corresponds to, the data obtained from Ganesha (such as IOPS, read and write bandwidth, latency, etc.) will be filled into the structure of the corresponding port in the linked list. These structures are used to store the real-time performance data of each logical port. Each structure contains a timestamp and a series of performance indicator data. Updating the structure means recording the latest 5-second performance statistics in the current node of the linked list.
[0204] S3, add or update the data of the current node to the database according to the sequence number. Specifically, each node in the linked list has a unique sequence number, which is used to identify its position in the linked list and its storage position in the database. After the performance statistics thread updates the current node data in the linked list, it will add or update this data to the database according to this sequence number to persistently store these performance statistics. If the node data in the linked list already exists in the database, an update operation will be performed; if there is no corresponding record in the database, an add operation will be performed. In this way, even after a system restart or failure, the latest performance statistics can be restored from the database.
[0205] S4 points to the next node. If the next node is the tail node, it points to the head node again. Specifically, the nodes in the linked list are updated in a cyclic manner, that is, after the performance statistics thread updates the current node, it will move to the next node in the linked list to perform the same performance data update work. If the current node is the last node (tail node) of the linked list, the performance statistics thread will return to the head node of the linked list again and start a new round of updates. This cyclic update mechanism ensures that each node in the linked list is updated periodically, thereby continuously recording the performance data within the last 30 minutes, while avoiding excessive consumption of memory resources by the infinitely growing linked list. The length of the linked list is designed to be a fixed value (for example, 360 nodes), and each node stores 5 seconds of data, so that the entire linked list records 30 minutes of data. The above steps can achieve fixed statistics of 360 parameter data, that is, performance data within 30 minutes. And it can be recorded cyclically in the database. When a user queries port performance statistics, the performance statistics corresponding to all nodes in the linked list are obtained and arranged in order according to the update time.
[0206] The above steps can realize the fixed statistics of 360 parameter data, that is, the performance data within 30 minutes. And it can be recorded cyclically in the database. When the user queries the port performance statistics, the performance statistics data corresponding to all nodes in the linked list are obtained and arranged in order according to the update time.
[0207] Optionally, in some embodiments, when the primary network attached storage server fails, another secondary network attached storage server will be set as the primary node and can read data from the target database to initialize the linked list, thereby ensuring the continued operation of performance statistics and being able to query 30 minutes of performance statistics, thereby ensuring the high availability of the program.
[0208] According to the embodiment of the present application, on the one hand, the average performance parameter of the logical port in the target time period is calculated and added to the second parameter linked list, which ensures that the linked list stores the latest performance data. In this way, the performance change trend of the logical port can be continuously reflected, providing a basis for real-time performance monitoring and diagnosis.
[0209] As an optional solution, after adding the first average performance parameter and the second average performance parameter to the second parameter linked list, the method further includes:
[0210] When the primary network attached storage server receives an acquisition request sent by the target client for acquiring the first average performance parameter, the primary network attached storage server acquires the first average performance parameter from the second parameter linked list and sends the first average performance parameter to the target client.
[0211] Optionally, the above-mentioned obtaining the first average performance parameter from the second parameter linked list and sending the first average performance parameter to the target client may but is limited to including: obtaining the IP address of the first logical port carried in the above-mentioned acquisition request for obtaining the first average performance parameter; determining the first data structure corresponding to the first logical port from the second parameter linked list based on the IP address of the first logical port; and obtaining the first average performance parameter in the first data structure.
[0212] When the primary network attached storage server receives an acquisition request sent by the target client for acquiring the second average performance parameter, the primary network attached storage server acquires the second average performance parameter from the second parameter linked list and sends the second average performance parameter to the target client.
[0213] Optionally, the above-mentioned obtaining the second average performance parameter from the second parameter linked list and sending the second average performance parameter to the target client may but is limited to including: obtaining the IP address of the second logical port carried in the above-mentioned acquisition request for obtaining the second average performance parameter; determining the second data structure corresponding to the second logical port from the second parameter linked list based on the IP address of the second logical port; and obtaining the second average performance parameter in the second data structure.
[0214] With the embodiment of the present application, the statistical processing of performance parameters is placed on the server side, and the target management component calculates the average value based on the first performance parameter and the second performance parameter obtained, instead of transmitting all the original performance data to the client. This method reduces the amount of network data transmission and improves the efficiency of data transmission, especially in the scenario of high concurrent read and write operations, which can significantly reduce network latency and bandwidth consumption. The target client can perform more in-depth performance analysis, such as performance trend prediction, anomaly detection, etc., based on the received first average performance parameter and second average performance parameter.
[0215] As an optional solution, after the primary network attached storage server determines the first average performance parameter of the first logical port within the target time period based on the first performance parameter through the target management component, and determines the second average performance parameter of the second logical port within the target time period based on the second performance parameter, the method further includes:
[0216] The primary network attached storage server transmits the first average performance parameter and the second average performance parameter to a target database corresponding to the target server cluster.
[0217] By adopting the embodiment of the present application, the average performance parameters are stored in the database, ensuring the persistence of data, and even if the main network attached storage server or the target management component fails, the performance data will not be lost. This is crucial for long-term monitoring and historical data analysis, helping system administrators to gain in-depth understanding of performance trends and potential problems of network storage systems.
[0218] Optionally, the statistical method of the above-mentioned performance parameters may include but is not limited to:
[0219] A performance visualization module is integrated into the NAS system, which can read performance statistics from the database and convert them into charts and graphs for users to understand intuitively. For example, a time series chart can be used to show the trend of IOPS, bandwidth and latency over time. Furthermore, users can select multiple logical ports through the visualization module and compare their performance indicators in the same time window to identify performance differences and potential problems. For example, users can view the average IOPS of multiple logical ports at the same time and quickly identify the port with the lowest performance through color coding or legends. Further, users are allowed to set alarm thresholds for different performance indicators. When the real-time performance data of a port exceeds or falls below these thresholds, the system displays an alarm through the visualization module and notifies the administrator through email or SMS. This helps to respond to performance anomalies in a timely manner and avoid the deterioration of data access problems. Further, data analysis functions such as trend prediction and anomaly detection are integrated into the visualization module. It can predict future performance trends based on historical performance data, and automatically identify and mark performance anomalies, providing data-driven decision-making basis for optimizing storage systems.
[0220] As an optional example, the statistical method of the above-mentioned port performance parameters can be explained as a whole by way of example but not limited to the following example:
[0221] S1, create a file system in NAS and export the NFS share of the file system.
[0222] S2, set the NAS service IP on the logical port in the NAS. The user client can mount the NFS share through the service IP and can read and write. The configuration data of the service IP is saved in the database of the NAS system.
[0223] S3: The logical port obtains performance statistics and calculates the average value within 5 seconds. Specifically, the following steps are included:
[0224] S3-1, Ganesha collects the total value of read and write operation data performed by the NAS service IP;
[0225] S3-2, Ganesha sends the total data statistics to the NAS client;
[0226] S3-3, the performance statistics thread of the master node obtains data from each node;
[0227] S3-4, calculate the average value of the data within 5 seconds by the 5-second data difference of the total data value;
[0228] S3-5, save the performance statistics data to the database.
[0229] In this embodiment, a statistical device for port performance parameters is also provided, which is used to implement the above embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0230] Figure 4 is a structural block diagram of a device for collecting statistics of port performance parameters according to an embodiment of the present application, such as Figure 4 As shown, the device comprises:
[0231] A first acquisition unit 402 is configured to acquire a first performance parameter of a first logical port through a target service component, wherein the primary network attached storage server belongs to a target server cluster, the first logical port is a network port of a file sharing service configured in the primary network attached storage server, and the target service component is a service implementation component of a network file system of the primary network attached storage server;
[0232] A second acquiring unit 404 is configured to acquire, through a performance statistics thread, a second performance parameter of a second logical port sent from a network attached storage server, wherein the network attached storage server belongs to a target server cluster, and the second logical port is a network port of a file sharing service configured in the network attached storage server;
[0233] The determination unit 406 is configured to determine, through the target management component, a first average performance parameter of the first logical port within a target time period based on the first performance parameter, and determine a second average performance parameter of the second logical port within the target time period based on the second performance parameter.
[0234] As an optional solution, the above-mentioned first acquisition unit includes: a first determination module, which is used to determine the read performance parameters of the first logical port when a read request for a shared directory in the primary network attached storage server is received through the first logical port; and a second determination module, which is used to determine the write performance parameters of the first logical port when a write request for a shared directory in the primary network attached storage server is received through the first logical port.
[0235] As an optional scheme, the above-mentioned first determination module is also used to: when a read request is received through the target logical port in the first logical port, determine the network address corresponding to the target logical port; when the historical performance parameters corresponding to the network address are found in the first parameter linked list, determine the read performance parameters of the target logical port, and replace the historical read performance parameters in the historical performance parameters with the read performance parameters; when the historical performance parameters corresponding to the network address are not found in the first parameter linked list, determine the read performance parameters, and add the read performance parameters to the first parameter linked list.
[0236] As an optional scheme, the above-mentioned first determination module is also used to: determine the amount of read data requested by the read request; determine the read time taken to complete the read request; obtain the historical read count of the target logical port, the historical read data amount of the target logical port, and the historical read time of the target logical port recorded in the historical performance parameters, wherein the historical read count is the total number of historical read requests received by the target logical port within the first time period, the historical read data amount is the total read data amount requested by the historical read requests, and the historical read time is the total time taken to complete the historical read requests; generate a target read count based on the historical read count and the target value; generate a target read data amount based on the historical read data amount and the read data amount; generate a target read time based on the historical read time and the read time; wherein the read performance parameters include the target read count, the target read data amount, and the target read time.
[0237] As an optional solution, the first determination module is further used to: determine the amount of read data requested by the read request; determine the read time taken to complete the read request; wherein the read performance parameters include the amount of read data, the read time and the target value.
[0238] As an optional scheme, the above-mentioned second determination module is also used to: when a write request is received through the target logical port in the first logical port, determine the network address corresponding to the target logical port; when the historical performance parameters corresponding to the network address are found in the first parameter linked list, determine the write performance parameters of the target logical port, and replace the historical write performance parameters in the historical performance parameters with the write performance parameters; when the historical performance parameters corresponding to the network address are not found in the first parameter linked list, determine the write performance parameters, and add the write performance parameters to the first parameter linked list.
[0239] As an optional scheme, the above-mentioned second determination module is also used to: determine the amount of write data requested by the write request; determine the write time taken to complete the write request; obtain the historical write count, historical write data amount, and historical write time of the target logical port recorded in the historical performance parameters, wherein the historical write count is the total number of historical write requests received by the target logical port within the first time period, the historical write data amount is the total write data amount requested by the historical write requests, and the historical write time is the total time taken to complete the historical write requests; generate a target write count based on the historical write count and the target value; generate a target write data amount based on the historical write data amount and the write data amount; generate a target write time based on the historical write time and the write time; wherein the write performance parameters include the target write count, the target write data amount, and the target write time.
[0240] As an optional solution, the second determination module is also used to: determine the amount of write data requested by the write request; determine the write time taken to complete the write request; wherein the write performance parameters include the amount of write data, the write time and the target value.
[0241] As an optional scheme, the above-mentioned determination unit includes: a first acquisition module, used to determine the first average performance parameter through the target management component based on the first performance parameter obtained at the first time and the first performance parameter obtained at the second time, and the time interval between the first time and the second time; a second acquisition module, used to determine the second average performance parameter through the target management component based on the second performance parameter obtained at the first time and the second performance parameter obtained at the first time, and the time interval; wherein the target time period is a time segment between the first time and the second time.
[0242] As an optional solution, the above-mentioned device also includes: a first adding unit, used to add the first average performance parameter and the second average performance parameter to the second parameter linked list; a first determining unit, used to determine the first number of average performance parameters belonging to the first logical port recorded in the second parameter linked list, and determine the second number of average performance parameters belonging to the second logical port recorded in the second parameter linked list; a first clearing unit, used to clear i first average performance parameters belonging to the first logical port recorded in the second parameter linked list when the first number is greater than a number threshold, wherein the recording time of the i first average performance parameters is earlier than a first reference time, and i is a positive integer; a second clearing unit, used to clear i second average performance parameters belonging to the second logical port recorded in the second parameter linked list when the second number is greater than a number threshold, wherein the recording time of the i second average performance parameters is earlier than the second reference time.
[0243] As an optional solution, the above-mentioned device also includes: a receiving unit, which is used to obtain the first average performance parameter from the second parameter linked list and send the first average performance parameter to the target client when the main network attached storage server receives an acquisition request sent by the target client to obtain the first average performance parameter; a sending unit, which is used to obtain the second average performance parameter from the second parameter linked list and send the second average performance parameter to the target client when the main network attached storage server receives an acquisition request sent by the target client to obtain the second average performance parameter.
[0244] As an optional solution, the above-mentioned device further includes: a second adding unit, which is used for the main network attached storage server to transmit the first average performance parameter and the second average performance parameter to the target database corresponding to the target server cluster.
[0245] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0246] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0247] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0248] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0249] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0250] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0251] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0252] An embodiment of the present application further provides a computer program product, comprising a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program product, and when the computer program is executed by a processor, the steps of the method described in each embodiment of the present application are implemented.
[0253] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0254] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0255] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A statistical method for port performance parameters, characterized in that: include: The primary network attached storage server obtains a first performance parameter of a first logical port through a target service component, wherein the primary network attached storage server belongs to a target server cluster, the first logical port is a network port of a file sharing service configured in the primary network attached storage server, and the target service component is a service implementation component of a network file system of the primary network attached storage server; The master NAS server acquires, through a performance statistics thread, a second performance parameter of a second logical port sent by a slave NAS server, wherein the slave NAS server belongs to the target server cluster, and the second logical port is a network port of a file sharing service configured in the slave NAS server; The primary NAS server determines a first average performance parameter of the first logical port in a target time period based on a first performance parameter through a target management component, and determines a second average performance parameter of the second logical port in the target time period based on the second performance parameter.
2. The method for calculating the port performance parameters according to claim 1, characterized in that: The primary network attached storage server obtains the first performance parameter of the first logical port through the target service component, including: In case a read request for a shared directory in the primary network attached storage server is received through the first logical port, determining a read performance parameter of the first logical port; In case a write request to a shared directory in the primary network attached storage server is received through the first logical port, a write performance parameter of the first logical port is determined.
3. The statistical method of port performance parameters according to claim 2, characterized in that: In the case where a write request to a shared directory in the primary network attached storage server is received through the first logical port, determining the write performance parameter of the first logical port includes: In case the read request is received through a target logical port in the first logical port, determining a network address corresponding to the target logical port; When the historical performance parameter corresponding to the network address is found in the first parameter linked list, the read performance parameter of the target logical port is determined, and the historical read performance parameter in the historical performance parameter is replaced with the read performance parameter; When the historical performance parameter corresponding to the network address is not found in the first parameter linked list, the read performance parameter of the target logical port is determined and the read performance parameter is added to the first parameter linked list.
4. The statistical method of port performance parameters according to claim 3, characterized in that: In the case where the historical performance parameter corresponding to the network address is found in the first parameter linked table, determining the read performance parameter of the target logical port includes: Determining the amount of read data requested by the read request; determining a read time taken to complete the read request; Obtaining the historical read count, the historical read data volume, and the historical read time of the target logical port recorded in the historical performance parameters, wherein the historical read count is the total number of historical read requests received by the target logical port within a first time period, the historical read data volume is the total amount of data requested to be read by the historical read requests, and the historical read time is the total time taken to complete the historical read requests; generating a target number of reads based on the historical number of reads and the target value; generating a target read data amount based on the historical read data amount and the read data amount; generating a target read time based on the historical read time and the read time; The read performance parameters include the target read times, the target read data volume and the target read time.
5. The method for calculating the statistics of port performance parameters according to claim 4, characterized in that: In the case where the historical performance parameter corresponding to the network address is not found in the first parameter linked table, determining the read performance parameter of the target logical port includes: Determining the amount of read data requested by the read request; determining a read time taken to complete the read request; The read performance parameters include the read data volume, the read time and the target value.
6. The statistical method of port performance parameters according to claim 2, characterized in that: In the case where a write request to a shared directory in the primary network attached storage server is received through the first logical port, determining the write performance parameter of the first logical port includes: In case the write request is received through a target logical port in the first logical port, determining a network address corresponding to the target logical port; In the case where the historical performance parameter corresponding to the network address is found in the first parameter linked list, determining the write performance parameter of the target logical port, and replacing the historical write performance parameter in the historical performance parameters with the write performance parameter; When the historical performance parameter corresponding to the network address is not found in the first parameter linked list, the write performance parameter of the target logical port is determined and the write performance parameter is added to the first parameter linked list.
7. The method for calculating the statistics of port performance parameters according to claim 6, characterized in that: In the case where the historical performance parameter corresponding to the network address is found in the first parameter linked table, determining the write performance parameter of the target logical port includes: Determining the amount of write data requested by the write request; determining a write time taken to complete the write request; Obtaining the historical write count, the historical write data volume, and the historical write time of the target logical port recorded in the historical performance parameters, wherein the historical write count is the total number of historical write requests received by the target logical port within a first time period, the historical write data volume is the total amount of data requested to be written by the historical write requests, and the historical write time is the total time taken to complete the historical write requests; Generate a target number of write times based on the historical number of write times and the target value; generating a target write data amount based on the historical write data amount and the write data amount; A target write time is generated based on the historical write time and the write time; wherein the write performance parameters include the target number of writes, the target amount of write data, and the target write time.
8. The method for calculating the statistics of port performance parameters according to claim 7, characterized in that: When the historical performance parameter corresponding to the network address is not found in the first parameter linked list, determining the write performance parameter of the target logical port includes: Determining the amount of write data requested by the write request; Determine the write time it takes to complete the write request; The write performance parameters include the write data volume, the write time and the target value.
9. The method for calculating the statistics of port performance parameters according to any one of claims 1 to 8, characterized in that: The determining, by the target management component, a first average performance parameter of the first logical port within a target time period based on the first performance parameter, and determining a second average performance parameter of the second logical port within the target time period based on the second performance parameter includes: Determining, by the target management component, the first average performance parameter based on the first performance parameter acquired at the first time and the first performance parameter acquired at the second time, and a time interval between the first time and the second time; Determining, by the target management component, the second average performance parameter based on the second performance parameter acquired at the first time and the second performance parameter acquired at the second time, and the time interval; The target time period is a time segment between the first time and the second time.
10. The method for calculating the statistics of port performance parameters according to any one of claims 1 to 8, characterized in that: After the primary network attached storage server determines, through the target management component, a first average performance parameter of the first logical port within a target time period based on the first performance parameter, and determines, based on the second performance parameter, a second average performance parameter of the second logical port within the target time period, the method further includes: The performance statistics thread adds the first average performance parameter and the second average performance parameter to a second parameter linked list; Determine a first number of the first average performance parameters belonging to the first logical port recorded in the second parameter linked list, and determine a second number of the second average performance parameters belonging to the second logical port recorded in the second parameter linked list; When the first number is greater than a number threshold, clearing i first average performance parameters belonging to the first logical port recorded in the second parameter linked list, wherein the recording time of the i first average performance parameters is earlier than a first reference time, and i is a positive integer; When the second number is greater than the number threshold, i second average performance parameters belonging to the second logical port recorded in the second parameter linked list are cleared, wherein the recording time of the i second average performance parameters is earlier than the second reference time.
11. The method for calculating the statistics of port performance parameters according to claim 10, characterized in that: After adding the first average performance parameter and the second average performance parameter to the second parameter linked list, the method further includes: When the primary NAS server receives an acquisition request sent by a target client for acquiring the first average performance parameter, acquiring the first average performance parameter from the second parameter linked list, and sending the first average performance parameter to the target client; When the primary network attached storage server receives the acquisition request sent by the target client for acquiring the second average performance parameter, the primary network attached storage server acquires the second average performance parameter from the second parameter linked list and sends the second average performance parameter to the target client.
12. The method for calculating the statistics of port performance parameters according to any one of claims 1 to 8, characterized in that: After the primary network attached storage server determines, through the target management component, a first average performance parameter of the first logical port within a target time period based on the first performance parameter, and determines, based on the second performance parameter, a second average performance parameter of the second logical port within the target time period, the method further includes: The primary network attached storage server transmits the first average performance parameter and the second average performance parameter to a target database corresponding to the target server cluster.
13. A statistical device for port performance parameters, characterized in that: include: A first acquisition unit is configured to acquire a first performance parameter of a first logical port through a target service component, wherein the primary network attached storage server belongs to a target server cluster, the first logical port is a network port of a file sharing service configured in the primary network attached storage server, and the target service component is a service implementation component of a network file system of the primary network attached storage server; A second acquisition unit is configured to acquire, through a performance statistics thread, a second performance parameter of a second logical port sent from a slave network attached storage server, wherein the slave network attached storage server belongs to the target server cluster, and the second logical port is a network port of a file sharing service configured in the slave network attached storage server; The determination unit is used to determine a first average performance parameter of the first logical port within a target time period based on the first performance parameter through a target management component, and to determine a second average performance parameter of the second logical port within the target time period based on the second performance parameter.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method according to any one of claims 1 to 12 when executed by a processor.
15. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 12 are implemented.
16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.
Citation Information
Patent Citations
Method and device for management for network attached storage (NAS) device
CN109120443A
Automatic deployment method and device based on MySQL cluster and related equipment
CN113138882A