CN105515898A - Test method and system aiming at network storage system performance - Google Patents
Test method and system aiming at network storage system performance Download PDFInfo
- Publication number
- CN105515898A CN105515898A CN201510881803.7A CN201510881803A CN105515898A CN 105515898 A CN105515898 A CN 105515898A CN 201510881803 A CN201510881803 A CN 201510881803A CN 105515898 A CN105515898 A CN 105515898A
- Authority
- CN
- China
- Prior art keywords
- server
- target file
- feedback parameter
- target
- predetermined time
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000010998 test method Methods 0.000 title claims description 15
- 239000003999 initiator Substances 0.000 claims abstract description 44
- 238000012360 testing method Methods 0.000 claims abstract description 33
- 238000012544 monitoring process Methods 0.000 claims abstract description 8
- 230000000977 initiatory effect Effects 0.000 claims description 18
- 230000001960 triggered effect Effects 0.000 claims description 3
- 238000000034 method Methods 0.000 abstract description 10
- 238000012790 confirmation Methods 0.000 description 2
- 235000008694 Humulus lupulus Nutrition 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000005764 inhibitory process Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1097—Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Environmental & Geological Engineering (AREA)
- Debugging And Monitoring (AREA)
Abstract
本发明公开了一种针对网络存储系统性能的测试方法及系统,包括:发起端服务器以预定时间为间隔持续向目标端服务器发起第一数据读取请求,接受目标端服务器根据数据读取请求打开相应目标文件后所返回的反馈参数,并将反馈参数放至监听队列;发起端服务器依次扫描监听队列中的反馈参数,判断与反馈参数相对应的目标文件的打开时间间隔是否超过第一预定时间值;若否,则根据反馈参数判断与反馈参数相对应的目标文件是否可读;若可读,则读取目标文件的数据,可见,在本实施例中,以预定时间间隔向目标端发起请求,使发起端服务器发起的请求量能够比较容易的超过目标端服务器最大负载,从而更接近实际的访问情况,实现了对网络存储的精准测试。
The invention discloses a method and system for testing the performance of a network storage system, comprising: the initiator server continuously initiates a first data reading request to the target server at intervals of a predetermined time, and accepts that the target server opens according to the data reading request. The feedback parameters returned after corresponding target files, and put the feedback parameters into the monitoring queue; the initiator server scans the feedback parameters in the monitoring queue in turn, and judges whether the opening time interval of the target file corresponding to the feedback parameters exceeds the first predetermined time value; if not, then judge whether the target file corresponding to the feedback parameter is readable according to the feedback parameter; if readable, then read the data of the target file, it can be seen that in the present embodiment, initiate the Request, so that the amount of requests initiated by the originating server can easily exceed the maximum load of the target server, so that it is closer to the actual access situation and realizes accurate testing of network storage.
Description
技术领域technical field
本发明涉及计算机软件领域,更具体地说,涉及一种针对网络存储系统性能的测试方法及系统。The invention relates to the field of computer software, more specifically, to a testing method and system for network storage system performance.
背景技术Background technique
使用传统的测试工具对网络存储系统进行测试,测试工具能够向服务器发起不同的请求。这些请求类型在一定程度上接近于实际的访问情况,但是由于不是针对网络存储系统而设计的,使用这些工具进行测试时,其测试结果不够准确。如IOMeter,它主要是对传统磁盘进行测试,也是现在网络存储中广泛使用的测试工具,但是它没有考虑网络存储系统中网络对I/O的影响。在实际访问环境中,访问量可能会超过服务器所能承受的最大负载,IOMeter没有考虑到这种情况。在请求量接近服务器最大负载时,由于网络的影响,发起端服务器受服务器抑制,很难产生超过服务器最大负载的请求量,这种测试结果偏离实际的访问情况。Use traditional test tools to test the network storage system, and the test tools can initiate different requests to the server. These request types are close to the actual access conditions to a certain extent, but because they are not designed for network storage systems, the test results are not accurate enough when using these tools for testing. For example, IOMeter is mainly used to test traditional disks, and it is also a widely used test tool in network storage, but it does not consider the impact of the network on I/O in the network storage system. In the actual access environment, the amount of access may exceed the maximum load that the server can bear, and IOMeter does not take this into account. When the amount of requests is close to the maximum load of the server, due to the influence of the network, the initiator server is suppressed by the server, and it is difficult to generate requests exceeding the maximum load of the server. This test result deviates from the actual access situation.
因此,如何更精准的对网络存储进行测试,是现在需要解决的问题。Therefore, how to test network storage more accurately is a problem that needs to be solved now.
发明内容Contents of the invention
本发明的目的在于提供一种针对网络存储系统性能的测试方法及系统,以更精准的对网络存储进行测试。The purpose of the present invention is to provide a method and system for testing the performance of a network storage system, so as to test the network storage more accurately.
为实现上述目的,本发明实施例提供了如下技术方案:In order to achieve the above object, the embodiment of the present invention provides the following technical solutions:
一种针对网络存储系统性能的测试方法,包括:A test method for network storage system performance, comprising:
发起端服务器以预定时间为间隔持续向目标端服务器发起第一数据读取请求,接受所述目标端服务器根据数据读取请求打开相应目标文件后所返回的反馈参数,并将所述反馈参数放至监听队列;The initiator server continuously initiates the first data read request to the target server at intervals of predetermined time, accepts the feedback parameter returned by the target server after opening the corresponding target file according to the data read request, and puts the feedback parameter in to the listening queue;
所述发起端服务器依次扫描所述监听队列中的反馈参数,判断与反馈参数相对应的目标文件的打开时间间隔是否超过第一预定时间值;The initiator server sequentially scans the feedback parameters in the monitoring queue, and judges whether the opening time interval of the target file corresponding to the feedback parameters exceeds the first predetermined time value;
若没有超过所述第一预定时间值,则根据所述反馈参数判断与所述反馈参数相对应的目标文件是否可读;若可读,则读取所述目标文件的数据。If it does not exceed the first predetermined time value, it is judged according to the feedback parameter whether the target file corresponding to the feedback parameter is readable; if it is readable, the data of the target file is read.
优选的,若与反馈参数相对应的目标文件的打开时间间隔超过所述第一预定时间值,则所述发起端服务器重新向所述目标端服务器发送第二数据读取请求;其中,所述第二数据读取请求为获取打开时间间隔超过预定时间值的目标文件的数据读取请求。Preferably, if the opening time interval of the target file corresponding to the feedback parameter exceeds the first predetermined time value, the initiator server resends a second data read request to the target server; wherein, the The second data reading request is a data reading request for obtaining target files whose open time interval exceeds a predetermined time value.
优选的,所述发起端服务器依次扫描所述监听队列中的反馈参数之前,还包括:Preferably, before the initiator server sequentially scans the feedback parameters in the listening queue, it further includes:
判断所述监听队列中是否有所述目标端服务器发送的反馈参数;Judging whether there is a feedback parameter sent by the target server in the listening queue;
若所述监听队列中有所述目标端服务器发送的反馈参数,则执行所述发起端服务器依次扫描所述监听队列中的反馈参数的步骤。If there is a feedback parameter sent by the target server in the listening queue, the step of sequentially scanning the feedback parameters in the listening queue by the initiator server is performed.
优选的,所述读取所述目标文件的数据之后,包括:Preferably, after reading the data of the target file, it includes:
关闭所述目标文件,并将与所述目标文件相对应的反馈参数从所述监听队列清除。Closing the target file, and clearing the feedback parameters corresponding to the target file from the listening queue.
优选的,若根据所述反馈参数判断与所述反馈参数相对应的目标文件不可读,则判断所述反馈参数的连接时间是否超过第二预定时间值;Preferably, if it is judged according to the feedback parameter that the target file corresponding to the feedback parameter is unreadable, it is judged whether the connection time of the feedback parameter exceeds a second predetermined time value;
若是,则关闭所述目标文件,并将与所述目标文件相对应的反馈参数从所述监听队列清除。If yes, close the target file, and clear the feedback parameter corresponding to the target file from the listening queue.
一种针对网络存储系统性能的测试系统,包括:A test system for network storage system performance, including:
发起端服务器和目标端服务器;Initiating server and target server;
其中,所述发起端服务器包括:Wherein, the initiator server includes:
数据请求模块,用于以预定时间为间隔持续向目标端服务器发起第一数据读取请求;A data request module, configured to continuously initiate a first data read request to the target server at predetermined time intervals;
接收模块,用于接受所述目标端服务器根据数据读取请求打开相应目标文件后所返回的反馈参数,并将所述反馈参数放至监听队列;The receiving module is used to accept the feedback parameter returned by the target server after opening the corresponding target file according to the data reading request, and put the feedback parameter into the listening queue;
第一判断模块,用于依次扫描所述监听队列中的反馈参数,判断与反馈参数相对应的目标文件的打开时间间隔是否超过第一预定时间值;若没有超过所述第一预定时间值,则触发第二判断模块;The first judging module is used to sequentially scan the feedback parameters in the listening queue, and judge whether the opening time interval of the target file corresponding to the feedback parameter exceeds the first predetermined time value; if it does not exceed the first predetermined time value, Then trigger the second judging module;
所述第二判断模块,用于根据所述反馈参数判断与所述反馈参数相对应的目标文件是否可读;若可读,则触发读取模块读取所述目标文件的数据。The second judging module is configured to judge whether the target file corresponding to the feedback parameter is readable according to the feedback parameter; if readable, trigger the reading module to read the data of the target file.
优选的,若所述第一判断模块判断与反馈参数相对应的目标文件的打开时间间隔超过所述第一预定时间值,则触发所述数据请求模块;Preferably, if the first judgment module judges that the opening time interval of the target file corresponding to the feedback parameter exceeds the first predetermined time value, the data request module is triggered;
所述数据请求模块还用于重新向所述目标端服务器发送第二数据读取请求;其中,所述第二数据读取请求为获取打开时间间隔超过预定时间值的目标文件的数据读取请求。The data request module is further configured to resend a second data read request to the target server; wherein, the second data read request is a data read request for obtaining a target file whose opening time interval exceeds a predetermined time value .
优选的,所述发起端服务器还包括:Preferably, the initiator server also includes:
第三判断模块,用于判断所述监听队列中是否有所述目标端服务器发送的反馈参数;若所述监听队列中有所述目标端服务器发送的反馈参数,则触发所述第一判断模块。A third judging module, configured to judge whether there is a feedback parameter sent by the target server in the listening queue; if there is a feedback parameter sent by the target server in the listening queue, trigger the first judging module .
优选的,所述发起端服务器还包括,包括:Preferably, the initiator server also includes:
执行模块,用于关闭所述目标文件,并将与所述目标文件相对应的反馈参数从所述监听队列清除。An execution module, configured to close the target file, and clear the feedback parameter corresponding to the target file from the listening queue.
优选的,若所述第二判断模块判断与所述反馈参数相对应的目标文件不可读,则触发第四判断模块;Preferably, if the second judging module judges that the target file corresponding to the feedback parameter is unreadable, trigger the fourth judging module;
所述第四判断模块用于判断所述反馈参数的连接时间是否超过第二预定时间值;若是,则触发所述执行模块。The fourth judging module is used to judge whether the connection time of the feedback parameter exceeds a second predetermined time value; if so, trigger the executing module.
通过以上方案可知,本发明实施例提供的一种针对网络存储系统性能的测试方法及系统,包括:发起端服务器以预定时间为间隔持续向目标端服务器发起第一数据读取请求,接受所述目标端服务器根据数据读取请求打开相应目标文件后所返回的反馈参数,并将所述反馈参数放至监听队列;所述发起端服务器依次扫描所述监听队列中的反馈参数,判断与反馈参数相对应的目标文件的打开时间间隔是否超过第一预定时间值;若没有超过所述第一预定时间值,则根据所述反馈参数判断与所述反馈参数相对应的目标文件是否可读;若可读,则读取所述目标文件的数据。It can be seen from the above solutions that the embodiment of the present invention provides a method and system for testing the performance of a network storage system, including: the initiator server continuously initiates a first data read request to the target server at intervals of a predetermined time, and accepts the The target server opens the feedback parameter returned after the corresponding target file according to the data read request, and puts the feedback parameter into the monitoring queue; Whether the opening time interval of the corresponding target file exceeds the first predetermined time value; if it does not exceed the first predetermined time value, then judge whether the target file corresponding to the feedback parameter is readable according to the feedback parameter; if readable, read the data of the target file.
可见,本实施例提供的测试方法,能以预定时间间隔向目标端发起请求,从而使得发起端服务器发起请求的步伐不再受目标端服务器端的抑制,它只负责发起请求,从而降低发起请求的时间间隔,使发起端服务器发起的请求量能够比较容易的超过目标端服务器最大负载,从而更接近实际的访问情况,实现了对网络存储的精准测试。It can be seen that the test method provided by this embodiment can initiate a request to the target at a predetermined time interval, so that the pace of the initiator server initiating the request is no longer restricted by the target server, and it is only responsible for initiating the request, thereby reducing the time required for initiating the request. The time interval makes it easier for the amount of requests initiated by the initiator server to exceed the maximum load of the target server, which is closer to the actual access situation and realizes accurate testing of network storage.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without creative work.
图1为本发明实施例公开的一种针对网络存储系统性能的测试方法流程示意图;FIG. 1 is a schematic flowchart of a test method for performance of a network storage system disclosed in an embodiment of the present invention;
图2为本发明实施例公开的另一种针对网络存储系统性能的测试方法流程示意图;FIG. 2 is a schematic flowchart of another test method for network storage system performance disclosed by an embodiment of the present invention;
图3为本发明实施例公开的一种针对网络存储系统性能的测试系统结构示意图。FIG. 3 is a schematic structural diagram of a test system for network storage system performance disclosed by an embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.
本发明实施例公开了一种针对网络存储系统性能的测试方法及系统,以更精准的对网络存储进行测试。The embodiment of the invention discloses a method and system for testing the performance of a network storage system, so as to test the network storage more accurately.
参见图1,本发明实施例提供的一种针对网络存储系统性能的测试方法,包括:Referring to Fig. 1, a kind of test method for the performance of network storage system provided by the embodiment of the present invention includes:
S101、发起端服务器以预定时间为间隔持续向目标端服务器发起第一数据读取请求;S101. The initiator server continuously initiates a first data read request to the target server at intervals of a predetermined time;
具体的,在本实施例中,发起端服务器以预定时间为间隔即以固定频率向目标端服务器循环的发起请求,而不管服务端是否能够再接收新的请求。从而使发起请求的步伐不再受服务器端抑制,即发起端服务器只负责发起请求,从而降低发起请求的时间间隔,可以使请求发起的速度不断提高,直到超过服务器的最大可承受负载,继续提高发起请求的速度,可以使被测系统进入活锁状态。Specifically, in this embodiment, the initiating server cyclically initiates requests to the target server at intervals of a predetermined time, that is, at a fixed frequency, regardless of whether the server can receive new requests. In this way, the pace of initiating requests is no longer restrained by the server, that is, the initiating server is only responsible for initiating requests, thereby reducing the time interval for initiating requests, and continuously increasing the speed of initiating requests until it exceeds the maximum acceptable load of the server. The speed at which requests can be initiated can put the system under test into a livelock state.
其中,在传统测试工具生成负载的方法主要是使用多个并发的线程向服务器发起读写请求,每个线程完成的任务依次为:发起请求、建立连接、读取数据、关闭连接。所有步骤都是顺序执行,这些步骤完成后会立刻发起另外一个请求。目标端接收请求的队列长度取决于发起端发起请求的速度以及请求的往返时间,即如果发起端发起的请求的速度超过存储系统对接收队列请求的处理速度,队列滞留的请求会越来越多,直到队列再也不能存储新接收的任何请求,目标端会丢掉最新接收的所有请求,而不对发起端返回任何确认信息。发起端请求的重传时间会不断增加,发起进程会陷入下一个循环,等待时间越来越长,会以越来越低的速度重传请求信息。基于这一点,传统测试工具请求生产方法只能使负载接近于服务器最大负载,但很难超过它。Among them, the method of generating load in traditional testing tools is mainly to use multiple concurrent threads to initiate read and write requests to the server. The tasks completed by each thread are: initiate a request, establish a connection, read data, and close the connection. All steps are performed sequentially, and another request is initiated immediately after the completion of these steps. The length of the queue for receiving requests on the target side depends on the speed of the request initiated by the initiator and the round-trip time of the request. That is, if the speed of the request initiated by the initiator exceeds the processing speed of the storage system for receiving queue requests, more and more requests will be stranded in the queue. , until the queue can no longer store any newly received requests, the target end will discard all newly received requests without returning any confirmation information to the initiator. The retransmission time of the initiator's request will continue to increase, and the initiator process will fall into the next cycle. The waiting time will become longer and longer, and the request information will be retransmitted at a lower and lower speed. Based on this, the traditional test tool request production method can only make the load close to the maximum load of the server, but it is difficult to exceed it.
即传统测试中超量负载产生困难的关键是让发起端摆脱TCP重传机制的抑制,而在本实施例中,通过发起端服务器以一定时间间隔不断向目标端服务器发起请求,而不管是否会接收到TCP三次握手的确认信息,时间间隔以CPU的跳数来度量,可以使时间的精度很高。当时间间隔足够小时请求量很容易达到服务器承受的最大负载。That is, the key to the difficulty of excessive load in the traditional test is to let the initiator get rid of the inhibition of the TCP retransmission mechanism. To the confirmation information of the TCP three-way handshake, the time interval is measured by the number of CPU hops, which can make the time accuracy very high. When the time interval is small enough, the amount of requests can easily reach the maximum load on the server.
S102、发起端服务器接受所述目标端服务器根据数据读取请求打开相应目标文件后所返回的反馈参数,并将所述反馈参数放至监听队列;S102. The initiator server accepts the feedback parameter returned by the target server after opening the corresponding target file according to the data read request, and puts the feedback parameter into the listening queue;
其中,所述发起端服务器依次扫描所述监听队列中的反馈参数之前,还包括:Wherein, before the initiator server sequentially scans the feedback parameters in the listening queue, it also includes:
判断所述监听队列中是否有所述目标端服务器发送的反馈参数;Judging whether there is a feedback parameter sent by the target server in the listening queue;
若所述监听队列中有所述目标端服务器发送的反馈参数,则执行所述发起端服务器依次扫描所述监听队列中的反馈参数的步骤。If there is a feedback parameter sent by the target server in the listening queue, the step of sequentially scanning the feedback parameters in the listening queue by the initiator server is performed.
具体的,本实施例中,在发起端服务器扫描监听队列之前,可以先判断发起端服务器发送的请求是否到达目标端服务器,即发起端服务器与目标端服务器是否建立连接。因为当发起端服务器与目标端服务器建立连接后,目标端服务器会向发起端服务器发送反馈参数,因此,在此通过检测监听队列中是否有目标端服务器发送的反馈参数来判断是否执行S102。其中,可以通过系统的select方法,来监听请求是否完成。Specifically, in this embodiment, before the initiating server scans the listening queue, it may first be determined whether the request sent by the initiating server reaches the target server, that is, whether the initiating server establishes a connection with the target server. Because when the initiator server establishes a connection with the target server, the target server will send feedback parameters to the initiator server. Therefore, whether to execute S102 is determined by detecting whether there is a feedback parameter sent by the target server in the listening queue. Among them, the select method of the system can be used to monitor whether the request is completed.
S103、所述发起端服务器依次扫描所述监听队列中的反馈参数,判断与反馈参数相对应的目标文件的打开时间间隔是否超过第一预定时间值;S103. The initiator server sequentially scans the feedback parameters in the listening queue, and judges whether the opening time interval of the target file corresponding to the feedback parameters exceeds a first predetermined time value;
其中,若与反馈参数相对应的目标文件的打开时间间隔超过所述第一预定时间值,则所述发起端服务器重新向所述目标端服务器发送第二数据读取请求;其中,所述第二数据读取请求为获取打开时间间隔超过预定时间值的目标文件的数据读取请求。Wherein, if the opening time interval of the target file corresponding to the feedback parameter exceeds the first predetermined time value, the initiator server resends a second data read request to the target server; wherein, the first The second data reading request is a data reading request for obtaining target files whose open time interval exceeds a predetermined time value.
具体的,在本实施例中,当发起端服务器发送的请求很多时,目标端服务器有可能不能及时的处理请求,因此当发起端服务器发送请求到目标端打开目标文件的时间大于第一预定时间值时,则会发起端服务器会重新向目标端服务器发送请求。Specifically, in this embodiment, when the request sent by the initiator server is large, the target server may not be able to process the request in time, so when the initiator server sends a request to the target end to open the target file, the time is greater than the first predetermined time When the value is set, the originating server will resend the request to the target server.
S104、若没有超过所述第一预定时间值,则根据所述反馈参数判断与所述反馈参数相对应的目标文件是否可读;若可读,则读取所述目标文件的数据。S104. If the first predetermined time value is not exceeded, judge whether the target file corresponding to the feedback parameter is readable according to the feedback parameter; if readable, read data of the target file.
其中,所述读取所述目标文件的数据之后,包括:Wherein, after reading the data of the target file, it includes:
关闭所述目标文件,并将与所述目标文件相对应的反馈参数从所述监听队列清除。Closing the target file, and clearing the feedback parameters corresponding to the target file from the listening queue.
具体的,在本实施中,为了重复读取反馈参数所对应的目标文件,每次读取目标文件后,则会在监听队列中清除与已经读取过数据的目标文件相对应的反馈参数。其中,在本实施例中可以通过FD_ISSET方法确认反馈参数所对应的目标文件是否可读,如果可读则从文件中读取,如果不可读则判断该请求是否超时,发现超时则关闭该连接。Specifically, in this implementation, in order to repeatedly read the target file corresponding to the feedback parameter, after each target file is read, the feedback parameter corresponding to the target file whose data has been read will be cleared in the listening queue. Wherein, in this embodiment, the FD_ISSET method can be used to confirm whether the target file corresponding to the feedback parameter is readable, if readable, read from the file, if unreadable, judge whether the request has timed out, and close the connection if found timed out.
其中,若根据所述反馈参数判断与所述反馈参数相对应的目标文件不可读,则判断所述反馈参数的连接时间是否超过第二预定时间值;Wherein, if it is judged according to the feedback parameter that the target file corresponding to the feedback parameter is unreadable, it is judged whether the connection time of the feedback parameter exceeds a second predetermined time value;
若是,则关闭所述目标文件,并将与所述目标文件相对应的反馈参数从所述监听队列清除。If yes, close the target file, and clear the feedback parameter corresponding to the target file from the listening queue.
具体的,由于反馈参数在连接时会返回不同值,所以当反馈参数的连接时间超过第二预定时间值后,则关闭所述目标文件,若反馈参数的连接时间没有超过第二预定时间值,则重新发起连接请求。Specifically, since the feedback parameter will return different values during connection, when the connection time of the feedback parameter exceeds the second predetermined time value, the target file is closed. If the connection time of the feedback parameter does not exceed the second predetermined time value, Then re-initiate the connection request.
为了方便理解,本实施例提供一个完整的网络存储系统性能的测试方法,详见图2,包括:For the convenience of understanding, this embodiment provides a complete test method for network storage system performance, see Figure 2 for details, including:
S201、调用open()函数指定要打开目标文件,并返回文件描述符;S201, call the open () function to designate the target file to be opened, and return the file descriptor;
具体的,这里的文件描述符即为本实施例中的反馈参数。Specifically, the file descriptor here is the feedback parameter in this embodiment.
S202、调用FD_SET将所述文件描述符加到监听队列;S202. Call FD_SET to add the file descriptor to the listening queue;
S203、调用select()监听是否有可用的设备;S203, call select () to monitor whether there is an available device;
其中,从S203-S210为本实施例的主循环,在这里可以设置主循环的循环次数,并根据循环次数循环执行步骤S203-S210。Wherein, steps S203-S210 are the main loop of this embodiment, where the number of cycles of the main loop can be set, and steps S203-S210 are cyclically executed according to the number of cycles.
若否,则执行S204、提示错误并程序结束;若是,则执行S205、判断目标文件的打开时间是否超过第一预定时间值;If not, then execute S204, prompt an error and end the program; if so, execute S205, judge whether the opening time of the target file exceeds the first predetermined time value;
其中,S205-S209为本实施例的内循环;Wherein, S205-S209 is the inner loop of this embodiment;
若目标文件的打开时间超过第一预定时间值,则重新执行S201;若目标文件的打开时间没有超过第一预定时间值,则执行S206、根据文件描述符判断目标文件是否可读;If the opening time of the target file exceeds the first predetermined time value, then re-execute S201; if the opening time of the target file does not exceed the first predetermined time value, then execute S206, judge whether the target file is readable according to the file descriptor;
若目标文件不可读,则执行S207;若目标文件可读,则执行S208;If the target file is unreadable, execute S207; if the target file is readable, execute S208;
S207、判断文件描述符连接请求的时间是否超过第二预定时间值;若是,则执行S209;若否,则重新执行S201;S207. Determine whether the time of the file descriptor connection request exceeds the second predetermined time value; if yes, execute S209; if not, execute S201 again;
S208、读取目标文件的数据;S208. Read the data of the target file;
S209、关闭目标文件,并将与目标文件相对应的文件描述符从监听队列清除;S209. Close the target file, and clear the file descriptor corresponding to the target file from the monitoring queue;
S210、判断内循环是否结束;若是,则执行S211,若否,则继续执行S205;S210. Determine whether the inner loop ends; if yes, execute S211; if not, continue to execute S205;
S211、判断主循环是否结束;若是,则结束程序;若否,则继续执行S203。S211. Determine whether the main loop ends; if yes, end the program; if not, continue to execute S203.
其中,判断主循环是否结束的标准是主循环的循环次数是否达到预定的循环次数,若达到则主循环结束,若没有达到,则继续执行主循环。Wherein, the criterion for judging whether the main loop ends is whether the number of loops of the main loop reaches a predetermined number of loops. If reached, the main loop ends; if not, the main loop continues to be executed.
本发明实施例提供的一种针对网络存储系统性能的测试方法,包括:发起端服务器以预定时间为间隔持续向目标端服务器发起第一数据读取请求,接受所述目标端服务器根据数据读取请求打开相应目标文件后所返回的反馈参数,并将所述反馈参数放至监听队列;所述发起端服务器依次扫描所述监听队列中的反馈参数,判断与反馈参数相对应的目标文件的打开时间间隔是否超过第一预定时间值;若没有超过所述第一预定时间值,则根据所述反馈参数判断与所述反馈参数相对应的目标文件是否可读;若可读,则读取所述目标文件的数据。A test method for the performance of a network storage system provided by an embodiment of the present invention includes: the initiator server continuously initiates a first data read request to the target server at intervals of a predetermined time, and accepts the target server according to the data read request. After requesting to open the corresponding target file, return the feedback parameter, and put the feedback parameter into the monitoring queue; the initiator server scans the feedback parameters in the monitoring queue in turn, and judges the opening of the target file corresponding to the feedback parameter. Whether the time interval exceeds the first predetermined time value; if it does not exceed the first predetermined time value, then judge whether the target file corresponding to the feedback parameter is readable according to the feedback parameter; if readable, then read the Describe the data of the target file.
可见,本实施例提供的测试方法,能以预定时间间隔向目标端发起请求,从而使得发起端服务器发起请求的步伐不再受目标端服务器端的抑制,它只负责发起请求,从而降低发起请求的时间间隔,使发起端服务器发起的请求量能够比较容易的超过目标端服务器最大负载,从而更接近实际的访问情况,实现了对网络存储的精准测试。It can be seen that the test method provided by this embodiment can initiate a request to the target at a predetermined time interval, so that the pace of the initiator server initiating the request is no longer restricted by the target server, and it is only responsible for initiating the request, thereby reducing the time required for initiating the request. The time interval makes it easier for the amount of requests initiated by the initiator server to exceed the maximum load of the target server, which is closer to the actual access situation and realizes accurate testing of network storage.
下面对本发明实施例提供的一种针对网络存储系统性能的测试系统进行介绍,下文描述的一种针对网络存储系统性能的测试系统与上文描述的一种针对网络存储系统性能的测试方法可以相互参照。The following is an introduction to a test system for the performance of a network storage system provided by an embodiment of the present invention. A test system for the performance of a network storage system described below and a test method for the performance of a network storage system described above can be used for each other. refer to.
参见图3本发明实施例提供的一种针对网络存储系统性能的测试系统,包括:Referring to Fig. 3, a test system for network storage system performance provided by an embodiment of the present invention includes:
发起端服务器100和目标端服务器200;Initiating server 100 and target server 200;
其中,所述发起端服务器100包括:Wherein, the originating server 100 includes:
数据请求模块110,用于以预定时间为间隔持续向目标端服务器发起第一数据读取请求;A data request module 110, configured to continuously initiate a first data read request to the target server at predetermined time intervals;
接收模块120,用于接受所述目标端服务器根据数据读取请求打开相应目标文件后所返回的反馈参数,并将所述反馈参数放至监听队列;The receiving module 120 is used to accept the feedback parameter returned by the target server after opening the corresponding target file according to the data reading request, and put the feedback parameter into the listening queue;
第一判断模块130,用于依次扫描所述监听队列中的反馈参数,判断与反馈参数相对应的目标文件的打开时间间隔是否超过第一预定时间值;若没有超过所述第一预定时间值,则触发第二判断模块;The first judging module 130 is used to sequentially scan the feedback parameters in the listening queue, and judge whether the opening time interval of the target file corresponding to the feedback parameter exceeds the first predetermined time value; if it does not exceed the first predetermined time value , trigger the second judging module;
所述第二判断模块140,用于根据所述反馈参数判断与所述反馈参数相对应的目标文件是否可读;若可读,则触发读取模块读取所述目标文件的数据。The second judging module 140 is configured to judge whether the target file corresponding to the feedback parameter is readable according to the feedback parameter; if it is readable, trigger the reading module to read the data of the target file.
优选的,若所述第一判断模块判断与反馈参数相对应的目标文件的打开时间间隔超过所述第一预定时间值,则触发所述数据请求模块;Preferably, if the first judgment module judges that the opening time interval of the target file corresponding to the feedback parameter exceeds the first predetermined time value, the data request module is triggered;
所述数据请求模块还用于重新向所述目标端服务器发送第二数据读取请求;其中,所述第二数据读取请求为获取打开时间间隔超过预定时间值的目标文件的数据读取请求。The data request module is further configured to resend a second data read request to the target server; wherein, the second data read request is a data read request for obtaining a target file whose opening time interval exceeds a predetermined time value .
优选的,所述发起端服务器,还包括:Preferably, the initiator server also includes:
第三判断模块,用于判断所述监听队列中是否有所述目标端服务器发送的反馈参数;若所述监听队列中有所述目标端服务器发送的反馈参数,则触发所述第一判断模块。A third judging module, configured to judge whether there is a feedback parameter sent by the target server in the listening queue; if there is a feedback parameter sent by the target server in the listening queue, trigger the first judging module .
优选的,所述发起端服务器还包括,包括:Preferably, the initiator server also includes:
执行模块,用于关闭所述目标文件,并将与所述目标文件相对应的反馈参数从所述监听队列清除。An execution module, configured to close the target file, and clear the feedback parameter corresponding to the target file from the listening queue.
优选的,若所述第二判断模块判断与所述反馈参数相对应的目标文件不可读,则触发第四判断模块;Preferably, if the second judging module judges that the target file corresponding to the feedback parameter is unreadable, trigger the fourth judging module;
所述第四判断模块用于判断所述反馈参数的连接时间是否超过第二预定时间值;若是,则触发所述执行模块。The fourth judging module is used to judge whether the connection time of the feedback parameter exceeds a second predetermined time value; if so, trigger the executing module.
本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。Each embodiment in this specification is described in a progressive manner, each embodiment focuses on the difference from other embodiments, and the same and similar parts of each embodiment can be referred to each other.
对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本发明。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本发明的精神或范围的情况下,在其它实施例中实现。因此,本发明将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。The above description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention will not be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510881803.7A CN105515898A (en) | 2015-12-03 | 2015-12-03 | Test method and system aiming at network storage system performance |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510881803.7A CN105515898A (en) | 2015-12-03 | 2015-12-03 | Test method and system aiming at network storage system performance |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105515898A true CN105515898A (en) | 2016-04-20 |
Family
ID=55723557
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510881803.7A Pending CN105515898A (en) | 2015-12-03 | 2015-12-03 | Test method and system aiming at network storage system performance |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105515898A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108075931A (en) * | 2016-11-10 | 2018-05-25 | 北京金山云网络技术有限公司 | A kind of test system, test method, control server and execute server |
CN113608974A (en) * | 2021-06-29 | 2021-11-05 | 济南浪潮数据技术有限公司 | Performance pressure measurement method and system of distributed storage system and related components |
CN115480107A (en) * | 2021-05-31 | 2022-12-16 | 比亚迪股份有限公司 | Feedback method, terminal, background system and feedback platform for vehicle state |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1447254A (en) * | 2003-04-04 | 2003-10-08 | 清华大学 | Networked mass storage device and implementation approach |
US20050204049A1 (en) * | 2004-03-10 | 2005-09-15 | Hitachi, Ltd. | Connectivity confirmation method for network storage device and host computer |
CN101090345A (en) * | 2007-07-20 | 2007-12-19 | 哈尔滨工程大学 | Performance Test Method of Network Storage System |
CN103064778A (en) * | 2011-10-20 | 2013-04-24 | 阿里巴巴集团控股有限公司 | Method, device and system of server performances testing |
-
2015
- 2015-12-03 CN CN201510881803.7A patent/CN105515898A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1447254A (en) * | 2003-04-04 | 2003-10-08 | 清华大学 | Networked mass storage device and implementation approach |
US20050204049A1 (en) * | 2004-03-10 | 2005-09-15 | Hitachi, Ltd. | Connectivity confirmation method for network storage device and host computer |
CN101090345A (en) * | 2007-07-20 | 2007-12-19 | 哈尔滨工程大学 | Performance Test Method of Network Storage System |
CN103064778A (en) * | 2011-10-20 | 2013-04-24 | 阿里巴巴集团控股有限公司 | Method, device and system of server performances testing |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108075931A (en) * | 2016-11-10 | 2018-05-25 | 北京金山云网络技术有限公司 | A kind of test system, test method, control server and execute server |
CN108075931B (en) * | 2016-11-10 | 2020-11-03 | 北京金山云网络技术有限公司 | Test system, test method, control server and execution server |
CN115480107A (en) * | 2021-05-31 | 2022-12-16 | 比亚迪股份有限公司 | Feedback method, terminal, background system and feedback platform for vehicle state |
CN113608974A (en) * | 2021-06-29 | 2021-11-05 | 济南浪潮数据技术有限公司 | Performance pressure measurement method and system of distributed storage system and related components |
CN113608974B (en) * | 2021-06-29 | 2023-12-22 | 济南浪潮数据技术有限公司 | Performance pressure measurement method and system of distributed storage system and related components |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111176803B (en) | Service processing method, device, server and storage medium | |
WO2021197392A1 (en) | Task queue generation | |
JP2017539039A5 (en) | ||
CN105451260B (en) | Network request method, network fluctuation measuring method and device | |
CN107992738B (en) | Account login abnormity detection method and device and electronic equipment | |
US11570201B2 (en) | System and method for detecting and blocking malicious attacks on a network | |
CN100542108C (en) | Performance Test Method of Network Storage System | |
CN106886494A (en) | A kind of automatic interface testing method and its system | |
RU2014136808A (en) | METHOD AND DEVICE FOR ADVANCED LOCK PASS TECHNOLOGIES | |
WO2021052098A1 (en) | Blockchain transaction method, apparatus and device, and computer readable storage medium | |
JP6855428B2 (en) | Methods, devices, and computer devices that scan the information to be scanned. | |
CN105515898A (en) | Test method and system aiming at network storage system performance | |
CN110119307B (en) | Data processing request processing method and device, storage medium and electronic device | |
CN113656178B (en) | Data processing method, device, equipment and readable storage medium | |
CN112506751A (en) | Method, device, equipment and medium for contrast test of overall performance of server | |
CN106033422A (en) | A database operation control method, device and system | |
US10469558B2 (en) | Website server request rerouting | |
CN110825493A (en) | A method and device for tuning a virtual machine | |
CN111258765A (en) | Load balancing method and device, computing equipment and storage medium | |
CN111159138B (en) | Asynchronous data storage method, device, equipment and readable storage medium | |
CN106341345B (en) | Concurrent request processing method and device | |
CN116319416A (en) | A performance testing method and device suitable for multi-node blockchain systems | |
CN112905320A (en) | System, method and device for executing tasks of Internet of things | |
CN115454819A (en) | Test method, device, equipment and storage medium of blockchain cross-chain system | |
CN107169133B (en) | Snapshot capturing method, device, server and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20160420 |