CN103428042B - Server is carried out the method and system of stress test - Google Patents
Server is carried out the method and system of stress test Download PDFInfo
- Publication number
- CN103428042B CN103428042B CN201210159568.9A CN201210159568A CN103428042B CN 103428042 B CN103428042 B CN 103428042B CN 201210159568 A CN201210159568 A CN 201210159568A CN 103428042 B CN103428042 B CN 103428042B
- Authority
- CN
- China
- Prior art keywords
- response message
- server
- access
- measured
- access request
- 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.)
- Active
Links
Abstract
The invention provides the method and system that server carries out stress test, wherein, the method includes: obtain access log file, read access request from access log file from server to be measured;To server to be measured send access request, and receive server to be measured return access request is processed after response message;Reading the response message of corresponding described access request from access log file, whether the response message comparing reading is identical with the response message of reception, records comparative result。The present invention program can save the workload of stress test, and can obtain about the conforming test result of response message。
Description
Technical field
The present invention relates to field tests, particularly relate to the method and system that server is carried out stress test。
Background technology
The rhythm of the Internet exploitation is very fast, often has the business of a large amount of version to reach the standard grade in one day, and each business is by respective server providing services, and how these servers quickly carry out stress test is the thorny problem run in Internet enterprises test。Stress test namely imitates user and server is initiated a large amount of access request and then obtains the test of server response condition。
The existing method that server carries out stress test must complete by manual test, is required for experiencing formulation test plan, writes test case, implementation of test cases, writes the complete procedure of test report。In this process, for different servers to be measured, it is necessary to write different test cases, its workload is very big, and, implementation of test cases is also one and operates frequently, it is necessary to expend substantial amounts of manpower。It is retrieval server for server to be measured, it is necessary to artificially write the substantial amounts of access request with different terms, and artificially perform access request, to conduct interviews to retrieval server;Then, receive that retrieval server returns access request is processed after response message, artificial statistics record access result, specifically include: artificial statistics receives the access times of response message, described number of times is divided by with accessing total degree, using division result as pressure testing results。
Visible, existing scheme needs to consume substantial amounts of human resources, and, the test result whether receiving response message can only be counted, it is impossible to obtain about the conforming test result of response message。
Summary of the invention
The invention provides a kind of method that server is carried out stress test, the method can save the workload of stress test, and can obtain about the conforming test result of response message。
The invention provides a kind of system that server carries out stress test, this system can save the workload of stress test, and can obtain about the conforming test result of response message。
A kind of method that server is carried out stress test, the method includes:
Access log file, read access request from access log file is obtained from server to be measured;
To server to be measured send access request, and receive server to be measured return access request is processed after response message;
Reading the response message of corresponding described access request from access log file, whether the response message comparing reading is identical with the response message of reception, records comparative result。
A kind of system that server carries out stress test, this system includes proxy server and test and management subsystem;
Described proxy server, for obtaining access log file from server to be measured, cache access journal file, read access request from access log file, access request is sent to server to be measured, and receive server to be measured return access request is processed after response message, described access request and described response message are sent to described test and management subsystem;
Described test and management subsystem, for reading the response message of corresponding described access request from the access log file of described proxy server caches, whether the response message comparing reading is identical with the response message of reception, records comparative result。
From such scheme it can be seen that the present invention, obtain access log file from server to be measured, send access request according to the access request read from access log file to server to be measured;Then, reading the response message of corresponding described access request from access log file, whether the response message comparing reading is identical with the response message of reception, records comparative result。The present invention sends access request according to the access request read from access log file to server to be measured, utilizes truly accessing as test case of user in access log file, substantially reduces workload;Further, test path covers extensively, can imitate the true access of various network, various browser, makes test result more truly, accurately;And, the response message of the response message read from access log file with reception is also compared by the present invention, and then obtains about the conforming test result of response message。
Accompanying drawing explanation
Fig. 1 is the method indicative flowchart that server is carried out stress test by the present invention;
Fig. 2 is the system structure schematic diagram that server is carried out stress test by the present invention。
Detailed description of the invention
For making the object, technical solutions and advantages of the present invention clearly understand, below in conjunction with embodiment and accompanying drawing, the present invention is described in more detail。
Internet Server and the Internet provide the user the server of certain business service, each Internet Server has substantial amounts of user to access every day, including the access carried out with any network Anywhere, at any time from the whole world, these servers are conducted interviews by different users according to each different access habits, and the integrity of its complexity and covering is all better than the enterprises stress test to server;And these access information all record in the access log file of server, described access information includes access request and corresponding response message。This access log file is for recording the access information of user access server, including access request and corresponding response message。
The present invention, based on access log file, sends access request according to the access request read from access log file to server to be measured, so that server to be measured is carried out stress test。Referring to Fig. 1, testing system for the present invention and server carries out the method indicative flowchart of stress test, it comprises the following steps:
Step 101, obtains access log file, read access request from access log file from server to be measured。
If described server to be measured is search engine server, the access request read from access log file is the various access request comprising key word that user sends to server to be measured in access process, such as comprise the inquiry request in key word " Mount Huang ", comprise the inquiry request of key word " president ", etc.。
Actual user's client and server to be measured need to establish the link, confirm the identity of the other side respectively before carrying out data transmission。In the present invention, test system is equivalent to actual user's client, before test system obtains access log file from server to be measured, also need to establish the link between test system and server to be measured, confirm the identity of the other side respectively, test system preserves server identification to be measured, and server to be measured preserves test system banner。
Step 102, to server to be measured send access request, and receive server to be measured return access request is processed after response message。
Access request includes the Http information header (Header) accessed and request body data;Response message includes information header (Header) and the response contents volume data of Http response。Between test system and server to be measured, the access request of transmission, the information such as response message can specifically adopt socket protocol format。Response message is the message after the server to be measured access request to receiving processes, illustrate, if described server to be measured is search engine server, access request is the various access request comprising key word that user sends to server to be measured in access process, such as comprise the inquiry request in key word " Mount Huang ", then server to be measured carries out data search according to key word " Mount Huang ", data search obtained, as response contents volume data, comprise and feed back to subscription client in the response message。
Step 103, reads the response message of corresponding described access request from access log file, and whether the response message comparing reading is identical with the response message of reception, records comparative result。
Specifically, it is possible to the response message of reading is called the first response message, the response message of reception is called the second response message。
The method that relatively whether response message is identical has multiple, is set forth below two kinds and illustrates:
Method one:
Adopt Message Digest Algorithm 5 (md5, MessageDigestAlgorithm), compare the first response message character string whether identical with the second response message character string, if it is, the response message read is identical with the response message of reception。Adopt md5 to compare whether character string is all prior art mutually, do not repeat here。
Method two:
Read the key assignments that in response message, JS Object Notation (JSON, JavaScriptObjectNotation) field comprises respectively, whether identical compare key assignments, if it is, the first response message and the second response message are identical;Key assignments is exactly the value of certain field in data base。Response message comprises JSON field, comprises key assignments in JSON field, and every response message is a corresponding key assignments uniquely, if the key assignments in two response message is identical, then this two response message is identical。
Comparative result is recorded, including the mode whether multiple recording responses message is identical described in step 103, for instance:
Statistical result is identical access times, using these access times as pressure testing results;Or,
Statistical result is identical access times, then is divided by with accessing total degree by described number of times, using division result as pressure testing results。
After obtaining pressure testing results, pressure testing results can be notified tester and developer by test system with the form of mail or form, and then makes tester and developer quickly understand server situation of change。
The present invention sends access request according to the access request read from access log file to server to be measured, utilizes truly accessing as test case of user in access log file, need not write specific test case, substantially reduce workload;Further, test path covers extensively, can imitate the true access of various network, various browser, makes test result more truly, accurately;And, the response message of the response message read from access log file with reception is also compared by the present invention, and then obtains about the conforming test result of response message。
Referring to Fig. 2, server carrying out for the present invention system structure schematic diagram of stress test, this system i.e. aforesaid test system, it includes proxy server and test and management subsystem;
Described proxy server, for obtaining access log file from server to be measured, cache access journal file, read access request from access log file, access request is sent to server to be measured, and receive server to be measured return access request is processed after response message, described access request and described response message are sent to described test and management subsystem;
Described test and management subsystem, for reading the response message of corresponding described access request from the access log file of described proxy server caches, whether the response message comparing reading is identical with the response message of reception, records comparative result。
Specifically, access request includes the Http information header (Header) accessed and request body data, and response message includes information header and the response contents volume data of Http response。
Alternatively, described proxy server includes link and sets up unit, is used in advance and establishes the link between server to be measured, confirming server identity to be measured。
Actual user's client and server to be measured need to establish the link, confirm the identity of the other side respectively before carrying out data transmission。In the present invention, proxy server is equivalent to actual user's client, before proxy server obtains access log file from server to be measured, also need to establish the link between proxy server and server to be measured, confirm the identity of the other side respectively, proxy server preserves server identification to be measured, and server to be measured preserves proxy server mark。Specifically, proxy server can adopt the Http mode acted on behalf of to provide agency service with 80 or 8080 ports。
Alternatively, described test and management subsystem includes the first comparing unit, is used for adopting md5, and whether the response message character string comparing reading is identical with the response message character string of reception, if it is, the response message read is identical with the response message of reception。
Alternatively, described test and management subsystem includes the second comparing unit, for reading the key assignments that JSON field comprises respectively from the response message of the response message read and reception, whether identical compares key assignments, if it is, the response message read is identical with the response message of reception。Response message comprises JSON field, comprises key assignments in JSON field, and every response message is a corresponding key assignments uniquely, if the key assignments in two response message is identical, then this two response message is identical。
Alternatively, described test and management subsystem includes result record unit, is identical access times for statistical result, is divided by with accessing total degree by described number of times, using division result as pressure testing results。After obtaining pressure testing results, pressure testing results can be notified tester and developer by test and management subsystem with the form of mail or form, and then makes tester and developer quickly understand server situation of change, so that server to be safeguarded。
As required, proxy server and test and management subsystem are placed in same equipment, it is also possible to be respectively placed on two equipment。
The present invention utilizes the access request of the mass users of access log file record in Internet Server, access request is sent to server to be measured, and the response message of record is analyzed in combined with access journal file, obtain pressure testing results, it is achieved thereby that quickly and accurately server to be measured is carried out automatic pressure Force meansurement。
The foregoing is only presently preferred embodiments of the present invention, not in order to limit the present invention, all within the spirit and principles in the present invention, any amendment of making, equivalent replacement, improvement etc., should be included within the scope of protection of the invention。
Claims (8)
1. the method that server is carried out stress test, it is characterised in that the method includes:
Access log file, read access request from access log file is obtained from server to be measured;
To server to be measured send access request, and receive server to be measured return access request is processed after response message;
Reading the response message of corresponding described access request from access log file, whether the response message comparing reading is identical with the response message of reception,
Statistical result is identical access times, using these access times as pressure testing results;Or, statistical result is identical access times, more described access times is divided by with accessing total degree, using division result as pressure testing results。
2. the method for claim 1, it is characterised in that described before server to be measured acquisition access log file, the method also includes:
And establish the link between server to be measured, confirm the identity of the other side respectively。
3. the method for claim 1, it is characterised in that described comparison includes:
Adopting Message Digest Algorithm 5, whether the response message character string comparing reading is identical with the response message character string of reception, if it is, the response message read is identical with the response message of reception。
4. the method for claim 1, it is characterised in that described comparison includes:
From the response message of the response message read and reception, read the key assignments that java script Object Notation field comprises respectively, whether identical compare key assignments, if it is, the response message read is identical with the response message of reception。
5. the system that server is carried out stress test, it is characterised in that this system includes proxy server and test and management subsystem;
Described proxy server, for obtaining access log file from server to be measured, cache access journal file, read access request from access log file, access request is sent to server to be measured, and receive server to be measured return access request is processed after response message, described access request and described response message are sent to described test and management subsystem;
Described test and management subsystem, for reading the response message of corresponding described access request from the access log file of described proxy server caches, whether the response message relatively read is identical with the response message of reception, statistical result is identical access times, using these access times as pressure testing results;Or, statistical result is identical access times, more described access times is divided by with accessing total degree, using division result as pressure testing results。
6. system as claimed in claim 5, it is characterised in that described proxy server includes link and sets up unit, is used in advance and establishes the link between server to be measured, confirming server identity to be measured。
7. system as claimed in claim 5, it is characterized in that, described test and management subsystem includes the first comparing unit, for adopting Message Digest Algorithm 5, whether the response message character string relatively read is identical with the response message character string of reception, if it is, the response message read is identical with the response message of reception。
8. system as claimed in claim 5, it is characterized in that, described test and management subsystem includes the second comparing unit, for reading the key assignments that java script Object Notation field comprises respectively from the response message of the response message read and reception, relatively whether key assignments is identical, if it is, the response message read is identical with the response message of reception。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210159568.9A CN103428042B (en) | 2012-05-22 | 2012-05-22 | Server is carried out the method and system of stress test |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210159568.9A CN103428042B (en) | 2012-05-22 | 2012-05-22 | Server is carried out the method and system of stress test |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103428042A CN103428042A (en) | 2013-12-04 |
CN103428042B true CN103428042B (en) | 2016-06-22 |
Family
ID=49652245
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210159568.9A Active CN103428042B (en) | 2012-05-22 | 2012-05-22 | Server is carried out the method and system of stress test |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103428042B (en) |
Families Citing this family (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104410546B (en) * | 2014-11-27 | 2018-04-03 | 北京国双科技有限公司 | The method of testing and device of real time processing system |
CN104951399B (en) * | 2015-06-19 | 2017-11-07 | 北京齐尔布莱特科技有限公司 | A kind of software testing system and method |
CN105868050A (en) * | 2015-12-29 | 2016-08-17 | 乐视网信息技术(北京)股份有限公司 | Verification method and device based on JSON data |
CN106254145B (en) * | 2016-09-06 | 2019-07-19 | 腾讯科技(深圳)有限公司 | Network request tracking processing method and device |
CN107948234B (en) * | 2016-10-13 | 2021-02-12 | 北京国双科技有限公司 | Data processing method and device |
CN107294803A (en) * | 2017-06-15 | 2017-10-24 | 北京小度信息科技有限公司 | Response message conformance test method and device |
CN109150643B (en) * | 2017-06-16 | 2022-09-23 | 创新先进技术有限公司 | Service processing abnormity detection method and device |
CN109309596B (en) * | 2017-07-28 | 2022-10-04 | 阿里巴巴集团控股有限公司 | Pressure testing method and device and server |
CN110457199A (en) * | 2018-05-08 | 2019-11-15 | 北京京东尚科信息技术有限公司 | The method and apparatus of performance test |
CN109067938B (en) * | 2018-10-15 | 2022-03-04 | 网宿科技股份有限公司 | Method and device for testing DNS (Domain name Server) |
CN109542712B (en) * | 2018-11-02 | 2023-04-07 | 平安科技(深圳)有限公司 | Server pressure testing method and device, computer equipment and storage medium |
CN110489339B (en) * | 2019-07-26 | 2023-01-03 | 北京字节跳动网络技术有限公司 | Client pressure measurement report generation method, system, medium and electronic device |
CN110659202A (en) * | 2019-08-12 | 2020-01-07 | 网宿科技股份有限公司 | Client automatic testing method and device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6324492B1 (en) * | 1998-01-20 | 2001-11-27 | Microsoft Corporation | Server stress testing using multiple concurrent client simulation |
CN101184001A (en) * | 2007-12-14 | 2008-05-21 | 北京金山软件有限公司 | Network server pressure testing method and system |
CN101388800A (en) * | 2007-09-12 | 2009-03-18 | 百度在线网络技术(北京)有限公司 | Method, device and system for pressed test to network performance of server |
-
2012
- 2012-05-22 CN CN201210159568.9A patent/CN103428042B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6324492B1 (en) * | 1998-01-20 | 2001-11-27 | Microsoft Corporation | Server stress testing using multiple concurrent client simulation |
CN101388800A (en) * | 2007-09-12 | 2009-03-18 | 百度在线网络技术(北京)有限公司 | Method, device and system for pressed test to network performance of server |
CN101184001A (en) * | 2007-12-14 | 2008-05-21 | 北京金山软件有限公司 | Network server pressure testing method and system |
Also Published As
Publication number | Publication date |
---|---|
CN103428042A (en) | 2013-12-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103428042B (en) | Server is carried out the method and system of stress test | |
CN103023710B (en) | A kind of safety test system and method | |
US20200117692A1 (en) | Systems and methods for web analytics testing and web development | |
US7623463B2 (en) | Performance evaluation of a network-based application | |
Syer et al. | Continuous validation of performance test workloads | |
CN106354634A (en) | Interface testing method and device | |
CN102546668B (en) | Method, device and system for counting unique visitors | |
Jirka et al. | A lightweight approach for the sensor observation service to share environmental data across Europe | |
CN108459850B (en) | Method, device and system for generating test script | |
CN107294919A (en) | A kind of detection method and device of horizontal authority leak | |
CN104410546A (en) | Testing method and device of real-time processing system | |
CN110430103B (en) | Message monitoring method | |
CN102662838B (en) | The adjustment method of Flash and system in a kind of browser | |
US20180285082A1 (en) | Comparing scripts | |
CN111651656A (en) | Method and system for dynamic webpage crawler based on agent mode | |
CN104639387A (en) | Users' network behavior tracking method and equipment | |
Wenhui et al. | Study on REST API test model supporting web service integration | |
CN103618761B (en) | Method and browser for processing cookie information | |
Kilintzis et al. | Evaluation of the performance of open-source RDBMS and triplestores for storing medical data over a web service | |
CN111930611B (en) | Statistical method and device for test data | |
CN104363309B (en) | Pan-domain name identification processing unit and method | |
CN102918527B (en) | Investigation method and system for web application hosting | |
CN109640127A (en) | The Fault Locating Method and device of content distributing network | |
CN114884804A (en) | Multi-channel information isolation method and device based on microservice and computer equipment | |
CN109491699B (en) | Resource checking method, device, equipment and storage medium of application program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20180518 Address after: 100190 Zhichun Road, Haidian District, Haidian District, Beijing, No. 49, 2 layer 224 Patentee after: Tencent Dadi Road (Beijing) Technology Co., Ltd. Address before: 518044 East 403 room, Sai Ge science and Technology Park, Futian District Zhenxing Road, Shenzhen, Guangdong, China, 2 Patentee before: Tencent Technology (Shenzhen) Co., Ltd. |