A kind of server stress test method and device based on player's distribution
Technical field
The present invention relates to technical field of the computer network more particularly to a kind of server stress tests based on player's distribution
Method and apparatus.
Background technology
With the development of electronic entertainment industry, online game is liked be subject to more and more game players.Such game one
As pursue more people and play online simultaneously.For popular online game, in peak period, often there are hundreds thousand of or even millions of grades
Other player plays online simultaneously.However, the framework of such network game generally use client-side/server-side.When in face of above-mentioned
During the player of number of levels, server can at a time bear the thousands of access requests sent by different clients,
So as to form huge pressure to server.At this point, the Performance Optimization technique scheme slightly mistakes and omissions of server-side, that is, be amplified to be formed
Apparent performance bottleneck influences the stability of server.The bottleneck of such aspect of performance is general in the case of smaller visit capacity
Be not in.Only when server is subject to fully big access pressure, relevant issues can just highlight, so as to add net
The test of network game and the difficulty of verification, positioning and the reparation of relevant issues.
Traditional pressure test mode is the communications protocol based on client and server-side.Specifically, client passes through frequency
Communications protocol is called to send to server-side numerously to ask, and according to the response time of server-side, feedback information accuracy and data
The technical indicators such as the Loss Rate of bag weigh performance of the server-side in the case where being asked in face of magnanimity.However, above-mentioned test mode is general only
It is that environment difference is larger in the calling consumption and real line for merely test associated communication interface.For example, due to every player
Account data and behavioral trait etc. difference, there may also be larger differences for the magnitude of associated communication interface call number.
The content of the invention
Present invention aim to address server stress test environment in the prior art and true environment exist compared with
The deficiency of big difference provides a kind of server stress test method and device based on player's distribution, can obtain reduction service
The internal pressure test of device and the effect of pressure testing differentia under true environment.
To achieve these goals, the present invention uses following technical solution.
First, the present invention proposes a kind of server stress test method based on player's distribution, comprises the following steps:Referring to
The load right played in scope to actual player open network is determined, to perform closed test;It is collected according to predeterminated frequency actual
The account data of player and the operation data of real server, and the distribution of account data is counted, wherein account data is at least wrapped
The virtual assets quantity, landing time section and online game progress of the account are included, operation data, which include at least, participates in test player
Quantity, current online number of players and server hardware configuration information;According to collected account data and statistics account data
Distribution writes and the corresponding test case of online game is performed in test server, and the setting of wherein test case is adjusted
So that the operation data of test server are consistent with the operation data of real server;According to actual player within the specified range
The distribution of account data proportionally expands after performing expansion in the scale and test server after the adjustment of test case
Test case.
In the embodiment of the method for the present invention, following pre-treatment step is further included before the above method is performed:Initially
Change test case, and in real server implementation of test cases to obtain initial operation data;Based on initial operation number
According to the configuration of initialization test server.
In the above method embodiment of the present invention, surveyed when performing pre-treatment step in real server according to closing
It tries consistent predeterminated frequency and collects operation data.
In the embodiment of the method for the present invention, the scale of test case is that successive ignition is extended to default registration player
Quantity.
In the embodiment of the method for the present invention, operation data at least further include real server or testing service receives
Request and real server or test server return to response.
In the above method embodiment of the present invention, request and actual clothes are received based on real server or testing service
Business device or test server return to frequency and the time of response statistics interaction response.
In the embodiment of the method for the present invention, test server is according to the default frequency consistent in real server
Rate collects operation data.
Secondly, the present invention also proposes a kind of server stress test device based on player's distribution, including with lower module:It opens
Dynamic model block, for the load right played within the specified range to actual player open network, to perform closed test;Collect mould
Block for collecting the account data of actual player and the operation data of real server according to predeterminated frequency, and counts account number
According to distribution, wherein account data include at least the account virtual assets quantity, landing time section and online game progress, fortune
Row data include at least registration number of players, current online number of players and server hardware configuration information;Analysis module is used for
It is distributed according to collected account data and statistics account data, writes and online game is performed in test server and is corresponding
The setting of test case, wherein test case is adapted so that the operation data of test server and the operation number of real server
According to consistent;Test module for the distribution according to actual player account data within the specified range, proportionally expands test
The test case after expanding is performed in the scale of use-case and test server after the adjustment.
In the device embodiment of the present invention, the startup of the above-mentioned server stress test device based on player's distribution
Module further includes following submodule:First initialization module for initialization test use-case, and performs survey in real server
Example is tried out to obtain initial operation data;Second initialization module, for based on initial operation data, initialization test clothes
The configuration of business device.
The present invention above device embodiment in, the first initialization module in real server according to closed test
Consistent predeterminated frequency collects operation data.
In the device embodiment of the present invention, test case scale is that successive ignition is extended to default registration player
Quantity.
In the device embodiment of the present invention, operation data at least further include real server or testing service receives
Request and real server or test server return to response.
In the above device embodiment of the present invention, analysis module be based on real server or testing service receive request with
And real server or test server return to frequency and the time of response statistics interaction response.
In the device embodiment of the present invention, test server is according to the default frequency consistent in real server
Rate collects operation data.
Finally, the invention also discloses a kind of computer readable storage medium, computer instruction is stored thereon with, the instruction
It is realized when being executed by processor such as the step of any one of foregoing the method.
Beneficial effects of the present invention are:Account data and the active service of actual player are collected by real test environment
The operation data of device, and test case is write based on account data and operation data, so as to more accurately perform on the server
Pressure test.
Description of the drawings
Fig. 1 show the method flow diagram of the server stress test method disclosed in this invention based on player's distribution;
Fig. 2 show the method flow diagram of pre-treatment step in one embodiment of the invention;
Fig. 3 show the schematic diagram of test case grey iterative generation in one embodiment of the invention;
Fig. 4 show the function structure chart of the server stress test device disclosed in this invention based on player's distribution.
Specific embodiment
The technique effect of the design of the present invention, concrete structure and generation is carried out below with reference to embodiment and attached drawing clear
Chu, complete description, to be completely understood by the purpose of the present invention, scheme and effect.It should be noted that in situation about not conflicting
Under, the feature in embodiment and embodiment in the application can be mutually combined.The identical attached drawing mark used everywhere in attached drawing
Note indicates the same or similar part.
With reference to method flow diagram shown in FIG. 1, in one embodiment of the invention, the server pressure based on player's distribution
Force test method comprises the following steps:The load right played within the specified range to actual player open network, to perform envelope
Close test;The account data of actual player and the operation data of real server are collected according to predeterminated frequency, and counts account number
According to distribution, wherein account data include at least the account virtual assets quantity, landing time section and online game progress, fortune
Row data, which include at least, participates in test number of players, current online number of players and server hardware configuration information;According to being received
The account data of collection and statistics account data distribution write and the corresponding test of online game are performed in test server and use
Example, the setting of wherein test case are adapted so that the operation data of test server and the operation data one of real server
It causes;According to the distribution of actual player account data within the specified range, proportionally expand the scale of test case and adjusting
The test case after expanding is performed in test server after whole.
Specifically, the developer of online game or operator can be sent with charge free by player of certain mode into specified range
Default account, and by the monitoring to this batch of default account, actual player is collected with predeterminated frequency (such as when 1 is small)
The operation data of account data (such as quantity of current online player) and real server (such as the CPU usage of server,
The service condition of each PORT COM and caching quantity), and count account data distribution (such as each collection data when
It carves, the player of the virtual assets total amount of this batch of account in some segment accounts for the ratio of all accounts).Above-mentioned closed test can
To continue 1 to 10 day.After closed test, the test case for being performed in test server can be based on account data
Creating a batch has opposite real account numbers, makes it have the distribution of identical account data.Usually, the hardware of test server
Configuring should be consistent with the hardware configuration of real server.Test case in test server when performing, the operation number of generation
It is compared according to by the operation data with real server, and based on the setting of above-mentioned comparing result adjustment test case.When
The operation data collected in test server and the operation data collected in real server are basically identical (such as more than 90%
Operation data measurement differ with reduced value no more than 5%) when, then can according to account data be distributed expansion account data rule
Mould.
With reference to method flow diagram shown in Fig. 2, because compared with closed test, close beta (the i.e. network of online game
The test that the developer of game is performed using the traditional approach described in background technology) be relatively convenient efficiently;So
In one embodiment of the invention, following pre-treatment step is further included before the above method is performed:Initialization test use-case, and
Implementation of test cases is to obtain initial operation data in real server;Based on initial operation data, initialization test
The configuration of server.The developer of online game can be used existing test mode and modules and system carried out in inside
Preliminary pressure test.And hardware configuration based on the acquired appropriate optimal inspection server of operation data or to each specific net
The module of network game adjusts.Further, in order to improve with the operation data comparability collected by closed test, perform pre-
During processing step operation data are collected according to the predeterminated frequency consistent with closed test in real server.It is above-mentioned to be based on tradition
The test of mode and the adjustment of server can be realized with the prior art.The present invention not limits this.
With reference to the generation schematic diagram of test case shown in Fig. 3, in one embodiment of the invention, the rule of test case
Mould is the quantity that successive ignition is extended to default registration player.During each iteration, when closed test, obtains account
The scale of data will proportionally amplify.In other words, in each iteration the quantity of account by increase and the distribution of account data protect
Hold it is constant (for example, for example at the time of each collection data, the object for appreciation of the virtual assets total amount of this batch of account in some segment
The ratio that family accounts for all accounts is consistent).By a series of iteration, in performance bottleneck the problem of, will be progressively apparent.Net
The developer of network game can configure the server of correct amount according to the online game actual player quantity of different phase, with
The game experiencing of player and actual operating cost are balanced, so as to fulfill the maximization of profit.
In one embodiment of the invention, operation data at least further include real server or testing service receives request
And real server or test server return to response, so as to determine client kimonos according to the particular content of request and response
The call number of all kinds of communications protocol and calling frequency between business end.Further, connect based on real server or testing service
It receives request and real server or test server returns to frequency and the time of response statistics interaction response, for from whole weighing apparatus
Measure the current game experiencing for weighing situation or user of server.
In one embodiment of the invention, run to improve collected by real server in data and test server
The comparability of collected operation data, test server collect operation according to the predeterminated frequency consistent in real server
Data.
With reference to function structure chart shown in Fig. 4, in one embodiment of the invention, the server pressure based on player's distribution
Force test device is included with lower module:Starting module, for being logged within the specified range to what actual player open network was played
Permission, to perform closed test;Collection module, for collecting account data and the active service of actual player according to predeterminated frequency
The operation data of device, and the distribution of account data is counted, wherein account data includes at least the virtual assets quantity of the account, steps on
Land period and online game progress, operation data include at least registration number of players, current online number of players and server
Hardware configuration information;Analysis module, for according to collected account data and statistics account data distribution, writing and testing
The corresponding test case of online game is performed on server, the setting of wherein test server is adapted so that test server
It is consistent with the operation data of real server to run data;Test module, for according to actual player account within the specified range
The distribution of number proportionally expands the survey performed in the scale and test server after the adjustment of test case after expansion
Example on probation.
Specifically, the developer of online game or operator can be by starting modules in some way into specified range
Player send default account with charge free, and pass through monitoring of the collection module to this batch of default account, with predeterminated frequency (such as every 1
Hour) collect the account data (such as quantity of current online player) of actual player and the operation data (example of real server
The service condition of CPU usage, each PORT COM such as server and caching quantity), and count the distribution (example of account data
Such as at the time of each collection data, the player of the virtual assets total amount of this batch of account in some segment accounts for all accounts
Ratio).Above-mentioned closed test can continue 1 to 10 day.After closed test, analysis module can surveyed based on account data
A batch is created in the test case performed on examination server has opposite real account numbers, makes it have point of identical account data
Cloth.Usually, the hardware configuration of the hardware configuration of test server and real server should be consistent.Test case takes in test
When being performed on business device, the operation data of generation compare the operation data with real server, and based on above-mentioned comparison knot
Fruit adjusts the setting of test case.When the operation number collected in the operation data and real server collected in test server
It, then can be according to account during according to basically identical (such as the operation data measurement more than 90% is differed with reduced value no more than 5%)
The distribution of data expands the scale of account data.
Because compared with closed test, (i.e. the developer of online game uses background skill for the close beta of online game
The test that traditional approach described in art performs) be relatively convenient efficiently;So in one embodiment of the invention,
The starting module of the above-mentioned server stress test device based on player's distribution further includes following submodule:First initialization mould
Block, for initialization test use-case, and in real server implementation of test cases to obtain initial operation data;At the beginning of second
Beginningization module, for based on initial operation data, the configuration of initialization test server.The developer of online game can adopt
Preliminary pressure test is carried out to modules and system in inside with existing test mode.Second initialization module is based on institute
The hardware configuration of the appropriate optimal inspection server of operation data of acquisition adjusts the module of each specific online game.Into one
Step ground, in order to improve with the operation data comparability collected by closed test, the first initialization module is in real server
Operation data are collected according to the predeterminated frequency consistent with closed test.The above-mentioned test based on traditional approach and the tune to server
It is whole to be realized with the prior art.The present invention not limits this.
In one embodiment of the invention, the scale of test case is the number that successive ignition is extended to default registration player
Amount.During each iteration, the scale that when closed test obtains account data will proportionally amplify.In other words, often
In secondary iteration the quantity of account by increase and the distribution of account data remain unchanged (for example, for example it is each collection data when
It carves, the ratio that the player of the virtual assets total amount of this batch of account in some segment accounts for all accounts is consistent).Pass through one
The iteration of series, in performance bottleneck the problem of, will be progressively apparent.The developer of online game can be according to the net of different phase
Network play actual player quantity and configure the server of correct amount, to balance the game experiencing of player and actual operating cost,
So as to fulfill the maximization of profit.
In one embodiment of the invention, operation data at least further include real server or testing service receives request
And real server or test server return to response, so as to determine client kimonos according to the particular content of request and response
The call number of all kinds of communications protocol and calling frequency between business end.Further, analysis module is based on real server or survey
Examination service receives request and real server or test server returns to frequency and the time of response statistics interaction response, is used for
From the whole current game experiencing for weighing situation or user for weighing server.
In one embodiment of the invention, run to improve collected by real server in data and test server
The comparability of collected operation data, test server collect operation according to the predeterminated frequency consistent in real server
Data.
Although description of the invention is quite detailed and especially several embodiments are described, it is not
These any details or embodiment or any specific embodiments are intended to be limited to, but it is by reference to appended that should be considered as
Claim considers that the prior art provides the possibility explanation of broad sense for these claims, so as to effectively cover the present invention
Preset range.In addition, with the foreseeable embodiment of inventor, present invention is described above, its purpose is to be provided with
Description, and those unsubstantiality changes to the present invention still unforeseen at present can still represent the equivalent modifications of the present invention.