CN109743229A - Based on distributed performance test methods, device and system - Google Patents
Based on distributed performance test methods, device and system Download PDFInfo
- Publication number
- CN109743229A CN109743229A CN201910026588.0A CN201910026588A CN109743229A CN 109743229 A CN109743229 A CN 109743229A CN 201910026588 A CN201910026588 A CN 201910026588A CN 109743229 A CN109743229 A CN 109743229A
- Authority
- CN
- China
- Prior art keywords
- target
- pressing machine
- machine
- control machine
- performance test
- 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
Abstract
The embodiment of the invention discloses one kind to be based on distributed performance test methods, device and system.This method comprises: target control machine determines each target pressing machine of execution performance test assignment according to the list of target pressing machine, wherein, the target control machine is control machine corresponding with the performance test task in control machine cluster, and the pressing machine of HTTP long connection is established in the target pressing machine list storage according to the control machine cluster domain name of the control machine cluster and the target control machine;The target control machine distributes the performance test task to each target pressing machine according to the Current resource occupied information of each target pressing machine, so that each target pressing machine executes the performance test task.Through the above technical solutions, realizing the quick dilatation of Performance Test System and the quick discovery of target pressing machine, the stability and efficiency of performance test are improved.
Description
Technical field
The present embodiments relate to computer technologies, more particularly to one kind to be based on distributed performance test methods, device
And system.
Background technique
With the development of technology, more and more suitable for the application program of user client, just in order to ensure application program
Often work, the performances such as pressure test of the functional test and load-carrying amount that need to carry out it function whether normal operation
Test.
For the ease of the performance test of application program, has the distributed performance test platform based on web services at present, such as
NGrinder Testing Platform.The frame of nGrinder Testing Platform includes a control machine and multiple pressing machines, is somebody's turn to do
Control machine is such as established and the connection relationship of each pressing machine (referred to as pressing machine hair for managing pressing machine and performance test task
It is existing), pressing machine appropriate is distributed for each performance test task, and by the test script and test resource of performance test task
It is sent to the pressing machine of each adaptation, and starts control test stream;Pressing machine is used to be used according to the test script simulation received
Family behavioral data, and analogue data is sent to tested application program, to test tested application program.Wherein, pressing machine
Discovery mechanism are as follows: the control machine Internet protocol address (Internet Protocol Address, IP address) of fixed control machine
With control machine service port number, each pressing machine is according to the control machine IP address and control machine service recorded in configuration file in it
Port numbers initiate TCP long connection to control machine, so that control machine is connected to each pressing machine.
Although nGrinder Testing Platform can be based on web services convenient for multi-user and be tested for the property task,
It is to only have a control machine in the Testing Platform, is limited to the resource of control machine, which can only accommodate
The performance test task of limit, when the performance test task of operation is excessive, it may appear that the unstable problem of performance test.In addition,
The service port number that machine is controlled in above-mentioned pressing machine discovery procedure must fix and cannot be occupied, on the one hand pressing machine be found
The execution of process depends on the correctness of control machine service port number, on the other hand further limits nGrinder performance test
Platform increase control machine with dilatation a possibility that so that nGrinder Testing Platform using inflexible.
Summary of the invention
The embodiment of the present invention provides one kind based on distributed performance test methods, device and system, to realize that performance is surveyed
The quick dilatation of test system and the quick discovery of target pressing machine, improve the stability and efficiency of performance test.
In a first aspect, the embodiment of the invention provides one kind to be based on distributed performance test methods, comprising:
Target control machine determines each target pressing machine of execution performance test assignment according to the list of target pressing machine,
In, the target control machine is control machine corresponding with the performance test task in control machine cluster, the target pressing machine
List, which is stored, establishes applying for HTTP long connection with the target control machine according to the control machine cluster domain name of the control machine cluster
Press;
The target control machine presses according to the Current resource occupied information of each target pressing machine to each target
Machine distributes the performance test task, so that each target pressing machine executes the performance test task.
Second aspect, the embodiment of the invention also provides one kind to be based on distributed performance testing device, configures in target
In control machine, which includes:
Target pressing machine determining module, for determining each mesh of execution performance test assignment according to the list of target pressing machine
Mark pressing machine, wherein the target control machine is control machine corresponding with the performance test task in control machine cluster, described
Target pressing machine list, which is stored, establishes HTTP according to the control machine cluster domain name of the control machine cluster and the target control machine
The pressing machine of long connection;
Performance test module, for the Current resource occupied information according to each target pressing machine, to each target
Pressing machine distributes the performance test task, so that each target pressing machine executes the performance test task.
The third aspect, the embodiment of the invention also provides one kind to be based on distributed Performance Test System, which includes:
Load balancer, control machine cluster and at least one target pressing machine with load balancer communication connection;Wherein,
The load balancer, for determining the corresponding target control of performance test assignment from the control machine cluster
Machine;
The target control machine, for determining each mesh for executing the performance test task according to the list of target pressing machine
Pressing machine is marked, and according to the Current resource occupied information of each target pressing machine, to described in each target pressing machine distribution
Performance test task, so that each target pressing machine executes the performance test task, wherein the target pressing machine list
Store the pressing machine that HTTP long connection is established according to the control machine cluster domain name of the control machine cluster and the target control machine.
The embodiment of the present invention according to control machine cluster domain name and controls the target control in machine cluster by each pressing machine
Machine establishes HTTP long connection, so that corresponding target pressing machine list is built for target control mechanism, so that can in control machine cluster
To increase new control machine at any time, the dilatation of Testing Platform is realized, and then improve the stability of performance test.Pass through control
Target control machine corresponding with performance test task determines execution performance test assignment according to the list of target pressing machine in machine cluster
Each target pressing machine;Target control machine is according to the Current resource occupied information of each target pressing machine, to each target pressing machine
Allocation performance test assignment, so that each target pressing machine execution performance test assignment, so that the resource of each target pressing machine obtains
To utilize sufficiently and reasonably, to improve the efficiency of performance test.
Detailed description of the invention
Fig. 1 is flow chart of one of the embodiment of the present invention one based on distributed performance test methods;
Fig. 2 is structure of one of the embodiment of the present invention two based on performance test network in distributed performance test methods
The flow chart of construction method;
Fig. 3 is structural schematic diagram of one of the embodiment of the present invention three based on distributed performance testing device;
Fig. 4 is structural schematic diagram of one of the embodiment of the present invention four based on distributed Performance Test System.
Specific embodiment
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched
The specific embodiment stated is used only for explaining the present invention rather than limiting the invention.It also should be noted that in order to just
Only the parts related to the present invention are shown in description, attached drawing rather than entire infrastructure.
Embodiment one
It is provided in this embodiment to be applicable to the application program based on web services based on distributed performance test methods
Performance test.This method can be by being executed based on distributed performance testing device, which can be by software and/or hardware
Mode realize that the device can integrate in computer equipment, such as laptop, desktop computer or server etc..Ginseng
See Fig. 1, the method for the present embodiment includes:
S110, target control machine determine each target pressure of execution performance test assignment according to the list of target pressing machine
Machine.
Wherein, target control machine is control machine corresponding with performance test task in control machine cluster.The embodiment of the present invention
In Testing Platform/system in contain at least two control machine, each control machine can handle multiple performance tests simultaneously
Task.These control machines form a control machine cluster, and the load for corresponding to the same domain name (i.e. control machine cluster domain name) is equal
Weighing apparatus.When a performance test assignment issues, the control machine that the performance test task is specifically responsible in control machine cluster is
Target control machine.
Pressing machine list is the list for storing pressure machine information, such as can store the title of pressing machine, IP address
(i.e. pressing machine Internet protocol address) and service port number (i.e. pressing machine service port number) etc..It is each in pressing machine list
Pressing machine is to establish HTTP long connection by some control machine in control machine cluster domain name and control machine cluster.Target
Each pressing machine in pressing machine list is by control machine cluster domain name and to control the target control machine foundation in machine cluster
HTTP long connection, i.e. target pressing machine list storage is built according to the control machine cluster domain name of control machine cluster with target control machine
The pressing machine of vertical HTTP long connection.Pressing machine list can store in corresponding control machine, also can store in control machine collection
The corresponding common region of group, such as can be common server or load balancer.
It specifically, can be to distribute target control for the performance test task after performance test assignment issues
Machine.The target control machine determines that operation can be load balancer and select from control machine cluster according to load balancing;
It is also possible to each control machine according to preset task processing strategie to automatically determine, such as when according to the addition of each control machine
Between or available resources accounting determine the sequence of each control machine, later just according to control machine sequence sequentially receptivity test assignment
Deng.
After determining target control machine, which just determines the performance according to its corresponding target pressing machine list
Each target pressing machine required for test assignment.Such as it can be and be determined as all pressing machines in target pressing machine list
Target pressing machine improves performance test task treatment effeciency so that equilibrium utilizes each pressing machine;It is also possible to according to the performance
The system resource situation of each pressing machine, determines that the part in list is applied in the task amount of test assignment and target pressing machine list
Press improves the utilization rate of pressing machine as target pressing machine to make full use of each pressing machine.
S120, target control machine are distributed according to the Current resource occupied information of each target pressing machine to each target pressing machine
Performance test task, so that each target pressing machine execution performance test assignment.
Wherein, Current resource occupied information refers to the system resource occupied information of current time pressing machine, such as can be
CPU usage and/or memory usage etc..
Specifically, target control machine is after performance test task selectes each target pressing machine, to be applied according to each target
The Current resource occupied information for the pressing machine that press reports determines the performance test task that each target pressing machine can be accepted
Performance test task, is allocated, so that each target pressing machine is held by amount according to the task amount of accepting of above-mentioned determination later
The performance test task that row is assigned to, such as simulates the required amount of user behavior data, presses to tested service, to obtain the property
The performance test results of energy test assignment.
During above-mentioned performance test, there is no performance test task is evenly distributed to each target to apply for target control machine
Press, but using the Current resource occupied information of target pressing machine as foundation, carry out the task amount distribution of rational proportion, Neng Gouping
Weigh the utilization rate of each pressing machine, reduces the obstruction of the pressing machine of high load, further increases performance test efficiency.
The technical solution of the present embodiment according to control machine cluster domain name and controls the mesh in machine cluster by each pressing machine
Mark control machine establishes HTTP long connection, so that corresponding target pressing machine list is built for target control mechanism, so that control machine collection
New control machine can be increased at any time in group, realize the dilatation of Testing Platform, and then improve the stability of performance test.It is logical
It crosses target control machine foundation target pressing machine list corresponding with performance test task in control machine cluster and determines that execution performance is surveyed
Each target pressing machine of trial business;Target control machine is according to the Current resource occupied information of each target pressing machine, to each target
Pressing machine allocation performance test assignment, so that each target pressing machine execution performance test assignment, so that each target pressing machine
Resource is able to sufficiently and reasonably utilize, to improve the efficiency of performance test.
Based on techniques described above scheme, before S120, further includes: each target pressing machine is according to resource reporting frequency
Rate reports Current resource to occupy by the TCP long connection established between target control machine and target pressing machine to target control machine
Information.
Wherein, resource reporting frequency refers to that pressing machine reports the frequency of resource occupation information to control machine, can be preparatory
It is set as a fixed frequency, also can be adjusted according to the actual situation.
Specifically, according to the above description, each target pressing machine can be mass-sended according to control machine cluster domain name to control machine collection
HTTP connection is played, and establishes HTTP long connection with target control machine, the process is primarily to realize pressing machine discovery, thus really
Set the goal pressing machine list.After HTTP long connection is established, target pressing machine can be applied according to the target in target pressing machine list
Press information and each target pressing machine establish TCP long connection.Hereafter, the Current resource that each target pressing machine monitors itself accounts for
With information, and according to corresponding resource reporting frequency, the Current resource obtained is monitored by the TCP long connection of foundation
Occupied information reports to target control machine.The advantages of this arrangement are as follows target control machine can be made to obtain each mesh in time
Mark the Current resource occupied information of pressing machine, so as to the distribution of timely tuning performance test assignment, enterprising to a certain degree one
Step improves performance test efficiency.
In the above process, target control machine obtains in the configuration file that needs to store out of it before initiating TCP connection
Initial control generator terminal slogan, and verify port numbers availability.When initially control generator terminal slogan is occupied and unavailable, target control
Machine processed needs to adjust rule according to the port numbers of setting, new control generator terminal slogan is determined, and verify availability, until determining
Available control generator terminal slogan.Such as initial control generator terminal slogan is set as 65001, the port numbers set adjust rule setting as
Backward reduces port numbers, and port numbers subtract one every time, until obtaining available service port number.The advantages of this arrangement are as follows
Port numbers conflict caused by fixed control generator terminal slogan is avoided, the flexibility that control generator terminal slogan determines is increased, to realize
The in due course increase of machine is controlled in Performance Test System.And the port numbers adjustment rule that backward reduces port numbers is set, it can reduce
Port numbers conflict, to improve control generator terminal slogan constant speed degree really.
Illustratively, target pressing machine is according to resource reporting frequency, by building between target control machine and target pressing machine
Vertical TCP long connection, reporting Current resource occupied information to target control machine includes: that target pressing machine was detected whether in the free time
State;If so, target pressing machine determines that resource reporting frequency is first frequency, and according to first frequency, pass through target control
The TCP long connection established between machine and target pressing machine, reports Current resource occupied information to target control machine;If it is not, then mesh
Mark pressing machine determines that resource reporting frequency is second frequency, and according to second frequency, passes through target control machine and target pressing machine
Between the TCP long connection established, report Current resource occupied information to target control machine.
Specifically, for each target pressing machine, report the process of Current resource occupied information can be with are as follows: target is applied
Press monitors the operating status for whether having run pressure process in it, and then having judged target pressing machine.If monitoring result be it is yes,
It determines that target pressing machine is in a busy state, resource reporting frequency is at this moment determined as second frequency (such as 5s), and according to second
Frequency reports Current resource to account for by the TCP long connection established between target control machine and target pressing machine to target control machine
Use information.The processing load of network broadband and target control machine can be reduced in this way.If monitoring result is no, it is determined that target is applied
Press is in idle condition, and is at this moment determined as resource reporting frequency first frequency (such as 200ms), and according to first frequency, is led to
The TCP long connection established between target control machine and target pressing machine is crossed, reports Current resource occupied information to target control machine,
The timeliness of target control machine tuning performance test assignment distribution can be improved in this way.Above-mentioned first frequency and second frequency are not
Deng first frequency or second frequency can report frequency consistent with initial resource, can also be inconsistent.Initial resource reports frequency
It is obtained from the configuration file stored in target pressing machine, first frequency and second frequency can then be issued by target control machine
It obtains.
Based on techniques described above scheme, in target control machine according to the Current resource occupied information of each target pressing machine,
To before each target pressing machine allocation performance test assignment, further includes: target pressing machine is collected provided by packet from system information
In all dynamic link libraries, the target dynamic chained library for adapting to the operating system of target pressing machine is determined;Target pressing machine base
Current resource occupied information is obtained in target dynamic chained library.
Wherein, system information, which collects to wrap, refers to that system information collects basis packet (System Information Gatherer
And Reporter, Sigar), it is used to from each operating platform collection system and processing information.
Specifically, in order to more easily obtain the Current resource occupied information of target pressing machine, in the embodiment of the present invention
Using Sigar tool.When it is implemented, all dynamic links that target pressing machine according to its operating system, is provided from Sigar
The target dynamic chained library for the operating system for adapting to target pressing machine is found in library, and is saved to target pressing machine and stored sky
Between.Later, the Current resource occupied information of target pressing machine can be obtained using Sigar tool.
Embodiment two
The present embodiment on the basis of the above embodiments, increases the correlation step of " performance test network struction ".Wherein
Details are not described herein for the explanation of term identical or corresponding with the various embodiments described above.Referring to fig. 2, provided in this embodiment to be based on dividing
The construction method of performance test network includes: in the performance test methods of cloth
S210, for each pressing machine in pressing machine cluster, the pressing machine is based on the operation system for adapting to the pressing machine
The dynamic link library of system determines pressing machine Internet protocol address.
Specifically, Performance Test System includes control machine cluster and pressing machine cluster, two clusters in the embodiment of the present invention
Between performance test network Constructed wetlands substantially are as follows: each pressing machine to control machine cluster initiate HTTP long connection, then
Each control machine safeguards pressing machine list according to received HTTP long link information.Later, it is right to be based on its for each control machine
The pressing machine list answered establishes TCP long connection with each pressing machine.So far the connection between control machine and pressing machine can be completed
Relationship constructs performance test network.
When actual implementation performance test network, it is necessary first to initiate HTTP long connection by each pressing machine, i.e., to pressure
Each pressing machine in machine cluster is performed both by the operation of S210~S240.When it is implemented, executive chairman, which connects, initiates applying for operation
Press (referred to as current pressing machine) is on the basis of having determined the dynamic link library for adapting to the operating system of current pressing machine, benefit
The pressing machine Internet protocol address of current pressing machine is obtained with Sigar tool.
S220, the pressing machine determine the initial service port numbers and control machine cluster of the pressing machine based on target configuration file
Domain name.
Wherein, target configuration file refers to the file that parameters initial value is stored in current pressing machine.
Specifically, current pressing machine obtains target configuration file, and current pressing machine is read from target configuration file
Service port number, the initial service port numbers as current pressing machine.In addition, current pressing machine is read from target configuration file
Take control machine cluster domain name.It should be noted that including journal file and log rank in target configuration file, target is being read
When above- mentioned information in configuration file, log system can be equally loaded.
Illustratively, the initial service port numbers and control of the pressing machine are determined based on target configuration file in the pressing machine
Before machine cluster domain name, further includes: the pressing machine is set according to the first configuration file, the second configuration file and third configuration file
Determine to determine target configuration file in priority.Wherein, the first configuration file, the second configuration file and third configuration file are respectively
Three configuration files stored in current pressing machine, store the initial value information of parameters in each configuration file, and three
The initial value information stored in a configuration file can be consistent, can also be inconsistent.These three configuration files are provided with difference
Priority, priority relationship be the first configuration file > second configuration file > third configuration file.Before executing S220, when
Preceding pressing machine needs to obtain the configuration file of all storages from memory space, and according to the setting priority of three configuration files
Determine target configuration file.For example, if there was only third configuration file (at least to store third configuration file) in memory space,
So using third configuration file as target configuration file;If having two of them or three configuration files in memory space, then
Using the higher configuration file of priority as target configuration file, as having the first configuration file and third configuration text in memory space
Part, then using the first configuration file as target configuration file.
Illustratively, the first configuration file is stored in the user's space of pressing machine, and the second configuration file is stored in pressing machine
Project space, third configuration file is stored in the resource space of pressing machine.
S230, the pressing machine determine the pressing machine of the pressing machine according to initial service port numbers and port numbers adjustment rule
Service port number.
Wherein, port numbers adjustment rule is consistent with the setting of initial service port numbers.For example, if initial service port numbers are set
It is set to lesser a port number, then port numbers adjustment rule just increases port numbers for positive sequence, each port numbers add 1 or 2 etc.
Compared with fractional value;If initial service port numbers are set as biggish a port number, then port numbers adjustment rule just subtracts for backward
Small end slogan, each port numbers subtract 1 or 2 etc. compared with fractional value.The latter is preferably arranged in the embodiment of the present invention.
Specifically, since the service port number of pressing machine each in the embodiment of the present invention is not pre-set fixed port
Number, therefore current pressing machine needs to adjust rule according to the S220 initial service port numbers obtained and port numbers, to current pressing machine
Service port number carry out availability verification, until determine the available port number of Lothrus apterus, the pressure as current pressing machine
Generator terminal slogan.
S240, the pressing machine are according to pressing machine Internet protocol address, pressing machine service port number and control machine cluster of domain
Name initiates HTTP long connection to the corresponding load balancer of control machine cluster domain name.
Specifically, current pressing machine is according to pressing machine Internet protocol address and pressing machine service port number, to control machine
Cluster domain name initiates HTTP long connection, which can be resolved and then the preposition load of direction control machine cluster is equal
Weighing apparatus.
S250, load balancer control in machine cluster according to load balancing is preset for each HTTP long matching connection
A control machine, so as to establish HTTP long connection between pressing machine and control machine.
Specifically, after a pressing machine initiates HTTP long connection to the corresponding load balancer of control machine cluster domain name,
Load balancer is according to load balancing, such as the strategy of Balance route machine resource or quiver control machine resource, by the HTTP long
Connection request is sent to the control machine filtered out, then the control machine is just established with the pressing machine for initiating the HTTP long connection
HTTP long connection.
When each of pressing machine cluster pressing machine is initiated to the corresponding load balancer of control machine cluster domain name
When HTTP long connection request, load balancer matches a control machine as procedure described above, for each HTTP long connection request.Root
According to load balancing, multiple HTTP long connection requests may be assigned to the same control machine, it is also possible to which each HTTP long connects
It connects request and corresponds to different control machines.It should be noted that point of the above-mentioned HTTP long connection request based on load balancer
With process, the dilatation at any time of control machine is naturally supported.
S260, for control machine cluster in each control machine, which will be with the control machine with HTTP long connection
The pressing machine of relationship is added to the pressing machine list of the control machine.
Specifically, each control machine controlled in machine cluster can be corresponding with a pressing machine list, for controlling machine collection
Each in group executes the control machine (referred to as currently control machine) of pressing machine list maintenance operation, the maintenance of the pressing machine list
Journey are as follows: it is corresponding that current control machine will be added to current control machine with the information of its pressing machine with HTTP long connection relationship
In pressing machine list.
Illustratively, which with the control machine will there is the pressing machine of HTTP long connection relationship to be added to the control machine
The pressing machine list pressing machine Internet protocol address that include: the control machine carry according to each HTTP long connection received
With pressing machine service port number, TCP long connection is established respectively with each pressing machine for initiating HTTP long connection, and is monitored each
Whether TCP long connection survives;If so, when the TCP long corresponding pressing machine of connection of survival being not present in the pressing machine list,
The corresponding pressing machine of TCP long connection of survival is added to the pressing machine list by the control machine;If it is not, then in the pressing machine list
It is middle exist failure TCP long connection corresponding pressing machine when, the control machine by the corresponding pressing machine of TCP long connection of failure from this
It is deleted in pressing machine list.
Specifically, currently control machine parses the HTTP long for some received HTTP long connection request first
Connection request is to obtain the pressing machine Internet protocol address and pressing machine service of the corresponding pressing machine of HTTP long connection request
Port numbers.Then, TCP long is initiated to above-mentioned pressing machine according to pressing machine Internet protocol address and pressing machine service port number to connect
Request is connect, to establish TCP long connection with above-mentioned pressing machine.Later, whether the TCP long connection that real-time monitoring is established survives.If
Survival then illustrates that above-mentioned pressing machine can be with execution performance test assignment, and further judgement is current controls the corresponding pressing machine column of machine
Whether above-mentioned pressure machine information is had existed in table, if it is not, above-mentioned pressure machine information is then added to pressing machine list;If so,
Then continue to monitor whether TCP long connection survives.If not surviving (TCP long Joint failure), illustrate above-mentioned pressing machine delay machine, it can not
Subsequent performance test is carried out, is further judged at this time with the presence or absence of above-mentioned pressure machine information in pressing machine list, if so, by upper
Pressure machine information is stated to delete from pressing machine list.Each the HTTP long connection request received for currently controlling machine, is pressed
It is handled according to the above process, the corresponding complete pressing machine list of current control machine can be obtained.The benefit being arranged in this way exists
In can safeguard the real-time effectiveness of pressing machine list, guarantee that each pressing machine is in available mode.
It should be noted that do not limit S210 and S220~S230 herein executes sequence, only need so that S210 in S240
It executes before.
The technical solution of the present embodiment, the dynamic link library by pressing machine based on the operating system for adapting to pressing machine,
Determine pressing machine Internet protocol address;The initial service port numbers and control machine collection of pressing machine are determined based on target configuration file
Group's domain name;According to initial service port numbers and port numbers adjustment rule, pressing machine service port number is determined.It is fast to realize pressing machine
It is fast and neatly determine pressing machine Internet protocol address, pressing machine service port number and control machine cluster domain name, further mention
The high application flexibility of Performance Test System.By the way that for each pressing machine in pressing machine cluster, pressing machine is according to pressure
Machine Internet protocol address, pressing machine service port number and control machine cluster domain name, to the corresponding load of control machine cluster domain name
Balanced device initiates HTTP long connection;Load balancer is controlled according to load balancing is preset for each HTTP long matching connection
A control machine in machine cluster, so as to establish HTTP long connection between pressing machine and control machine;For in control machine cluster
Each control machine, control machine arrange the pressing machine for being added to control machine with the pressing machine of HTTP long connection relationship with control machine
Table.The establishment for realizing performance test network further improves the expandability and real-time effectiveness of performance test network.
The embodiment provided in an embodiment of the present invention based on distributed performance testing device below, the device with it is above-mentioned
Each embodiment belongs to the same inventive concept based on distributed performance test methods, fills based on distributed performance test
The detail content of not detailed description in the embodiment set can refer to the above-mentioned implementation based on distributed performance test methods
Example.
Embodiment three
The present embodiment provides one kind to be based on distributed performance testing device, is configured in target control machine, referring to Fig. 3,
The device specifically includes:
Target pressing machine determining module 310, for determining each of execution performance test assignment according to the list of target pressing machine
A target pressing machine, wherein target control machine is control machine corresponding with performance test task in control machine cluster, target pressure
The pressing machine of HTTP long connection is established in machine list storage according to the control machine cluster domain name and target control machine of control machine cluster;
Performance test module 320, for the Current resource occupied information according to each target pressing machine, to each target pressing machine
Allocation performance test assignment, so that each target pressing machine execution performance test assignment.
Optionally, on the basis of above-mentioned apparatus, which further includes pressing machine list maintenance module, is used for:
It, will be with control before determining each target pressing machine of execution performance test assignment according to the list of target pressing machine
The pressing machine list that there is machine the pressing machine of HTTP long connection relationship to be added to control machine.
Further, pressing machine list maintenance module is specifically used for:
The pressing machine Internet protocol address and pressing machine serve port carried according to each HTTP long connection received
Number, TCP long connection is established respectively with each pressing machine for initiating HTTP long connection, and monitors whether each TCP long connection survives;
If so, when the TCP long corresponding pressing machine of connection of survival being not present in pressing machine list, by the TCP of survival
Length connects corresponding pressing machine and is added to pressing machine list;
If it is not, when then there is the TCP long corresponding pressing machine of connection of failure in pressing machine list, by the TCP long of failure
Corresponding pressing machine is connected to delete from pressing machine list.
Three one of the target control machine that is configured at is based on distributed performance testing device through the embodiment of the present invention,
The quick dilatation of Performance Test System and the quick discovery of target pressing machine are realized, the stability and effect of performance test are improved
Rate.
It is worth noting that, in the above-mentioned embodiment based on distributed performance testing device, included each unit
It is only divided according to the functional logic, but is not limited to the above division with module, as long as can be realized corresponding function
Energy;In addition, the specific name of each functional unit is also only for convenience of distinguishing each other, the guarantor being not intended to restrict the invention
Protect range.
Example IV
Referring to fig. 4, it present embodiments provides a kind of based on distributed Performance Test System comprising: load balancer
410, the control machine cluster 420 and at least one target pressing machine 430 communicated to connect with load balancer 410;Wherein,
Load balancer 410, for determining the corresponding target control machine of performance test assignment from control machine cluster 420
421;
Target control machine 421, for determining that each target of execution performance test assignment is applied according to the list of target pressing machine
Press 430, and according to the Current resource occupied information of each target pressing machine 430, it is tested to each 430 allocation performance of target pressing machine
Task, so that 430 execution performance test assignment of each target pressing machine, wherein target pressing machine list storage is according to control machine collection
The control machine cluster domain name and target control machine of group 420 establish the pressing machine of HTTP long connection.
Optionally, target pressing machine 430 includes resource occupation information reporting module, is used for:
In target control machine 421 according to the Current resource occupied information of each target pressing machine 430, to each target pressing machine
Before 430 allocation performance test assignments, according to resource reporting frequency, by between target control machine 421 and target pressing machine 430
The TCP long connection of foundation, reports Current resource occupied information to target control machine 421.
Further, resource occupation information reporting module is specifically used for:
It detects whether to be in idle condition;
If so, determine that resource reporting frequency is first frequency, and according to first frequency, by target control machine 421 with
The TCP long connection established between target pressing machine 430, reports Current resource occupied information to target control machine 421;
If not, it is determined that resource reporting frequency is second frequency, and according to second frequency, by target control machine 421 with
The TCP long connection established between target pressing machine 430, reports Current resource occupied information to target control machine 421.
Optionally, target pressing machine 430 includes that the first information obtains module, is used for:
In target control machine 421 according to the Current resource occupied information of each target pressing machine 430, to each target pressing machine
Before 430 allocation performance test assignments, collected from system information in all dynamic link libraries provided by wrapping, determination adapts to mesh
Mark the target dynamic chained library of the operating system of pressing machine 430;
Current resource occupied information is obtained based on target dynamic chained library.
Optionally, target pressing machine 430 includes HTTP long connection initiation module, is used in target control machine 421 according to mesh
Before mark pressing machine list determines each target pressing machine 430 of execution performance test assignment, according to pressing machine Internet protocol
Address, pressing machine service port number and control machine cluster domain name, initiate HTTP long connection to load balancer 410;
Correspondingly, load balancer 410 includes HTTP long connection distribution module, presets load balancing for foundation,
A control machine in machine cluster 420 is controlled for each HTTP long matching connection, so as to establish between pressing machine and control machine
HTTP long connection;
Target control machine 421 includes pressing machine list maintenance module, for that will have HTTP long connection relationship with control machine
Pressing machine be added to the pressing machine list of control machine.
Further, pressing machine list maintenance module is specifically used for:
The pressing machine Internet protocol address and pressing machine serve port carried according to each HTTP long connection received
Number, TCP long connection is established respectively with each pressing machine for initiating HTTP long connection, and monitors whether each TCP long connection survives;
If so, when the TCP long corresponding pressing machine of connection of survival being not present in pressing machine list, by the TCP of survival
Length connects corresponding pressing machine and is added to pressing machine list;
If it is not, when then there is the TCP long corresponding pressing machine of connection of failure in pressing machine list, by the TCP long of failure
Corresponding pressing machine is connected to delete from pressing machine list.
Optionally, target pressing machine 430 includes the second data obtaining module, is used for:
It is equal to load in foundation pressing machine Internet protocol address, pressing machine service port number and control machine cluster domain name
Before weighing apparatus 410 initiates HTTP long connection, based on the dynamic link library for the operating system for adapting to pressing machine, determine that pressing machine is mutual
Networking protocol address;
The initial service port numbers and control machine cluster domain name of pressing machine are determined based on target configuration file;
According to initial service port numbers and port numbers adjustment rule, pressing machine service port number is determined.
Further, the second data obtaining module is specifically used for:
Before the initial service port numbers and control machine cluster domain name for determining pressing machine based on target configuration file, foundation
Target configuration file is determined in the setting priority of first configuration file, the second configuration file and third configuration file.
What Fig. 4 was shown is only an example based on distributed Performance Test System, should not be to the embodiment of the present invention
Function and use scope bring any restrictions.This controls machine based on the load balancer 410 in distributed Performance Test System
Cluster 420 can be connected at least one target pressing machine 430 by wired or wireless ways such as buses, with logical in Fig. 4
It crosses for the connection of bus 440.
The embodiment of the present invention four based on distributed Performance Test System, by based on load balancer, control machine collection
Group safeguards multiple control mechanism and the corresponding pressing machine of each control machine with the combination of pressing machine list, realizes lightweight
Control machine maintenance and pressing machine find scheme, simplified Performance Test System, reached the quick dilatation of Performance Test System
With the quick discovery of target pressing machine, and improve performance test stability and efficiency technical effect.
Note that the above is only a better embodiment of the present invention and the applied technical principle.It will be appreciated by those skilled in the art that
The invention is not limited to the specific embodiments described herein, be able to carry out for a person skilled in the art it is various it is apparent variation,
It readjusts and substitutes without departing from protection scope of the present invention.Therefore, although being carried out by above embodiments to the present invention
It is described in further detail, but the present invention is not limited to the above embodiments only, without departing from the inventive concept, also
It may include more other equivalent embodiments, and the scope of the invention is determined by the scope of the appended claims.
Claims (10)
1. one kind is based on distributed performance test methods characterized by comprising
Target control machine determines each target pressing machine of execution performance test assignment according to the list of target pressing machine, wherein institute
Stating target control machine is control machine corresponding with the performance test task in control machine cluster, and the target pressing machine list is deposited
Store up the pressing machine that HTTP long connection is established according to the control machine cluster domain name of the control machine cluster and the target control machine;
The target control machine divides according to the Current resource occupied information of each target pressing machine to each target pressing machine
With the performance test task, so that each target pressing machine executes the performance test task.
2. the method according to claim 1, wherein in the target control machine according to each target pressing machine
Current resource occupied information, distributed before the performance test task to each target pressing machine, further includes:
Each target pressing machine is according to resource reporting frequency, by between the target control machine and the target pressing machine
The TCP long connection of foundation, Xiang Suoshu target control machine report Current resource occupied information.
3. according to the method described in claim 2, it is characterized in that, the target pressing machine passes through according to resource reporting frequency
The TCP long connection established between the target control machine and the target pressing machine, Xiang Suoshu target control machine report current money
Source occupied information includes:
The target pressing machine detects whether to be in idle condition;
If so, the target pressing machine determines that resource reporting frequency is first frequency, and according to the first frequency, pass through institute
The TCP long connection established between target control machine and the target pressing machine is stated, Xiang Suoshu target control machine reports Current resource
Occupied information;
If it is not, then the target pressing machine determines that resource reporting frequency is second frequency, and according to the second frequency, pass through institute
The TCP long connection established between target control machine and the target pressing machine is stated, Xiang Suoshu target control machine reports Current resource
Occupied information.
4. according to the method described in claim 2, it is characterized in that, leading in the target pressing machine according to resource reporting frequency
The TCP long connection established between the target control machine and the target pressing machine is crossed, Xiang Suoshu target control machine reports currently
Before resource occupation information, further includes:
The target pressing machine is collected from system information to be wrapped in provided all dynamic link libraries, and determination adapts to the target
The target dynamic chained library of the operating system of pressing machine;
The target pressing machine is based on the target dynamic chained library and obtains the Current resource occupied information.
5. the method according to claim 1, wherein true according to the list of target pressing machine in the target control machine
Surely before each target pressing machine for executing the performance test task, further includes:
For each pressing machine in pressing machine cluster, the pressing machine takes according to pressing machine Internet protocol address, pressing machine
Port numbers of being engaged in and control machine cluster domain name initiate HTTP long connection to the corresponding load balancer of the control machine cluster domain name;
The load balancer controls one in machine cluster according to load balancing is preset, for each HTTP long matching connection
Control machine, so as to establish HTTP long connection between pressing machine and control machine;
For each control machine in the control machine cluster, the control machine will be closed with the control machine with HTTP long connection
The pressing machine of system is added to the pressing machine list of the control machine.
6. according to the method described in claim 5, it is characterized in that, the control machine will connect with the control machine with HTTP long
The pressing machine for connecing relationship is added to the pressing machine list of the control machine and includes:
The pressing machine Internet protocol address and pressing machine that the control machine is carried according to each HTTP long connection received take
Business port numbers establish TCP long connection with each pressing machine for initiating HTTP long connection, and monitor each TCP long connection to be respectively
No survival;
If so, the control machine will there is no when the TCP long connection corresponding pressing machine of survival in the pressing machine list
The corresponding pressing machine of TCP long connection of survival is added to the pressing machine list;
If it is not, the control machine will lose when then there is the TCP long corresponding pressing machine of connection of failure in the pressing machine list
The corresponding pressing machine of TCP long connection of effect is deleted from the pressing machine list.
7. according to the method described in claim 5, it is characterized in that, in the pressing machine foundation pressing machine Internet protocol
Location, pressing machine service port number and control machine cluster domain name, are initiated to the corresponding load balancer of the control machine cluster domain name
Before HTTP long connection, further includes:
Dynamic link library of the pressing machine based on the operating system for adapting to the pressing machine determines the pressing machine internet
Protocol address;
The pressing machine based on target configuration file determine the pressing machine initial service port numbers and the control machine cluster
Domain name;
The pressing machine determines the pressing machine serve port according to the initial service port numbers and port numbers adjustment rule
Number.
8. the method according to the description of claim 7 is characterized in that in the pressing machine based on described in target configuration file determination
Before the initial service port numbers of pressing machine and the control machine cluster domain name, further includes:
The pressing machine is according to determining institute in the setting priority of the first configuration file, the second configuration file and third configuration file
State target configuration file.
9. one kind is based on distributed performance testing device, configure in target control machine characterized by comprising
Target pressing machine determining module, for determining that each target of execution performance test assignment is applied according to the list of target pressing machine
Press, wherein the target control machine is control machine corresponding with the performance test task in control machine cluster, the target
Pressing machine list, which is stored, establishes HTTP long company according to the control machine cluster domain name of the control machine cluster and the target control machine
The pressing machine connect;
Performance test module presses for the Current resource occupied information according to each target pressing machine to each target
Machine distributes the performance test task, so that each target pressing machine executes the performance test task.
10. one kind is based on distributed Performance Test System characterized by comprising load balancer, with the load balancing
The control machine cluster and at least one target pressing machine of device communication connection;Wherein,
The load balancer, for determining the corresponding target control machine of performance test assignment from the control machine cluster;
The target control machine, for determining that each target for executing the performance test task is applied according to the list of target pressing machine
Press, and according to the Current resource occupied information of each target pressing machine, the performance is distributed to each target pressing machine
Test assignment, so that each target pressing machine executes the performance test task, wherein the target pressing machine list storage
The pressing machine of HTTP long connection is established according to the control machine cluster domain name of the control machine cluster and the target control machine.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910026588.0A CN109743229A (en) | 2019-01-11 | 2019-01-11 | Based on distributed performance test methods, device and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910026588.0A CN109743229A (en) | 2019-01-11 | 2019-01-11 | Based on distributed performance test methods, device and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109743229A true CN109743229A (en) | 2019-05-10 |
Family
ID=66364508
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910026588.0A Pending CN109743229A (en) | 2019-01-11 | 2019-01-11 | Based on distributed performance test methods, device and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109743229A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110990208A (en) * | 2019-12-12 | 2020-04-10 | 深圳市网心科技有限公司 | Cluster test file deployment and performance test method, computer equipment and medium |
CN111651329A (en) * | 2020-06-08 | 2020-09-11 | 中国工商银行股份有限公司 | Health check method and device for application, computer system and storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101018162A (en) * | 2007-01-15 | 2007-08-15 | 华为技术有限公司 | Simulated testing system and method of the business processing network element |
US20080072264A1 (en) * | 2006-08-02 | 2008-03-20 | Aaron Crayford | Distribution of content on a network |
CN103051500A (en) * | 2013-01-04 | 2013-04-17 | 北京邮电大学 | Test method and system of service network system |
US20130285739A1 (en) * | 2010-09-07 | 2013-10-31 | Corporation De L ' Ecole Polytechnique De Montreal | Methods, apparatus and system to support large-scale micro- systems including embedded and distributed power supply, thermal regulation, multi-distributedsensors and electrical signal propagation |
CN104077212A (en) * | 2013-03-26 | 2014-10-01 | 阿里巴巴集团控股有限公司 | Pressure test system and method |
US20150018242A1 (en) * | 2012-02-21 | 2015-01-15 | Mitsubishi Gas Chemical Company, Inc. | Methods and biomarkers for detection and prognosis of cervical cancer |
-
2019
- 2019-01-11 CN CN201910026588.0A patent/CN109743229A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080072264A1 (en) * | 2006-08-02 | 2008-03-20 | Aaron Crayford | Distribution of content on a network |
CN101018162A (en) * | 2007-01-15 | 2007-08-15 | 华为技术有限公司 | Simulated testing system and method of the business processing network element |
US20130285739A1 (en) * | 2010-09-07 | 2013-10-31 | Corporation De L ' Ecole Polytechnique De Montreal | Methods, apparatus and system to support large-scale micro- systems including embedded and distributed power supply, thermal regulation, multi-distributedsensors and electrical signal propagation |
US20150018242A1 (en) * | 2012-02-21 | 2015-01-15 | Mitsubishi Gas Chemical Company, Inc. | Methods and biomarkers for detection and prognosis of cervical cancer |
CN103051500A (en) * | 2013-01-04 | 2013-04-17 | 北京邮电大学 | Test method and system of service network system |
CN104077212A (en) * | 2013-03-26 | 2014-10-01 | 阿里巴巴集团控股有限公司 | Pressure test system and method |
Non-Patent Citations (5)
Title |
---|
(美)IAN F. DARWIN著,张晓坤,刘基诚译.: "《Java经典实例[M]. 》", 31 December 2002 * |
364434006: "《sigar介绍与使用》", 《ITEYE》 * |
DREAMSONMA: "《分布式压力测试平台nGrinder简介》", 《简书》 * |
卡佩兰 CAPELLAN等: "《NetWare环境下Windows NT的实现[M].》", 30 June 1998 * |
牟云飞,李锐等: "《微信公众平台商业应用搭建、支付开发与运维实践》", 31 December 2018 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110990208A (en) * | 2019-12-12 | 2020-04-10 | 深圳市网心科技有限公司 | Cluster test file deployment and performance test method, computer equipment and medium |
CN111651329A (en) * | 2020-06-08 | 2020-09-11 | 中国工商银行股份有限公司 | Health check method and device for application, computer system and storage medium |
CN111651329B (en) * | 2020-06-08 | 2023-08-01 | 中国工商银行股份有限公司 | Health check method and device for application, computer system and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109274707B (en) | Load scheduling method and device | |
CN107040407B (en) | High-performance computing cluster dynamic node operation method | |
CN107590075B (en) | Software testing method and device | |
CN103391312B (en) | Resource offline method for down loading and device | |
CN109246229A (en) | A kind of method and apparatus of distribution resource acquisition request | |
CN109542746B (en) | Pressure testing method and system and server pressure testing system | |
CN105376317A (en) | Load balancing control method and load balancing control device | |
CN108933829A (en) | A kind of load-balancing method and device | |
CN109743229A (en) | Based on distributed performance test methods, device and system | |
JP2012037935A (en) | Information processing device | |
CN112532687B (en) | Method and system for capacity expansion of kubernets load balancer | |
CN110795217B (en) | Task allocation method and system based on resource management platform | |
CN109951566A (en) | A kind of Nginx load-balancing method, device, equipment and readable storage medium storing program for executing | |
CN106790403B (en) | Method for realizing mobile cloud computing intermediate platform and method for realizing distribution | |
CN109522042A (en) | A kind of patch update method, system and associated component | |
CN109617966A (en) | A kind of cloud pipe Platform deployment system and method based on Openstack | |
CN105959411A (en) | Dynamic load balance distributed processing method in cloud computing environment based on coordination | |
CN106412030B (en) | A kind of selection storage resource method, apparatus and system | |
CN107070752A (en) | A kind of method of testing and test system of long connection capacity | |
CN111966556A (en) | Performance pressure measurement method and device, server and computer readable storage medium | |
CN110166544B (en) | Load balancing application creation method and device, computer equipment and storage medium | |
Li et al. | Research and application of server cluster load balancing technology | |
CN102217247A (en) | Method, apparatus and system for implementing multiple web application requests scheduling | |
CN114896025A (en) | Architecture optimization method and device of service grid, computer equipment and storage medium | |
CN112346980B (en) | Software performance testing method, system and readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190510 |
|
RJ01 | Rejection of invention patent application after publication |