CN103428042A - Method and system for carrying out stress test on server - Google Patents
Method and system for carrying out stress test on server Download PDFInfo
- Publication number
- CN103428042A CN103428042A CN2012101595689A CN201210159568A CN103428042A CN 103428042 A CN103428042 A CN 103428042A CN 2012101595689 A CN2012101595689 A CN 2012101595689A CN 201210159568 A CN201210159568 A CN 201210159568A CN 103428042 A CN103428042 A CN 103428042A
- Authority
- CN
- China
- Prior art keywords
- response message
- server
- access
- read
- measured
- 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.)
- Granted
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The invention provides a method and system for carrying out a stress test on a server. The method comprises the steps of obtaining an access log file from the server to be tested, reading an access request from the access log file, sending an access request to the server to be tested, receiving a response message returned from the server to be tested after the access request is processed, reading a response message corresponding to the access request from the access log file, comparing whether the read response message and the received response message are the same, and recording the comparison result. According to the scheme, the workload of the stress test can be reduced, and the test result about consistency of the response message can be obtained.
Description
Technical field
The present invention relates to field tests, relate in particular to the method and system of server being carried out to pressure test.
Background technology
The rhythm of the Internet exploitation is very fast, in one day, often has the business of a large amount of versions to reach the standard grade, and each business provides service by server separately, and how fast these servers to be carried out to pressure test is the thorny problem run in the Internet enterprises test.The test that the user initiates a large amount of access request to server and then obtains the server response condition is namely imitated in pressure test.
The existing method that server is carried out to pressure test must complete by manual test, all needs experience to formulate 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, need to write different test cases, its workload is very large, and implementation of test cases is also an operation frequently, need to expend a large amount of manpowers.The server to be measured of take is that retrieval server is example, needs the people to write a large amount of access request with different terms, and artificially carries out access request, to conduct interviews to retrieval server; Then, receive the response message after retrieval server returns access request is processed, artificial statistics record access result, specifically comprise: artificial statistics receives the access times of response message, described number of times and access total degree are divided by, using the phase division result as the pressure test result.
Visible, existing scheme need to consume a large amount of human resources, and, can only count the test result that whether receives response message, can not obtain about the conforming test result of response message.
Summary of the invention
The invention provides a kind of method of server being carried out to pressure test, the method can be saved the workload of pressure test, and can obtain about the conforming test result of response message.
The invention provides a kind of system of server being carried out to pressure test, this system can be saved the workload of pressure test, and can obtain about the conforming test result of response message.
A kind of method of server being carried out to pressure test, the method comprises:
Obtain access log file from server to be measured, read access request from access log file;
Send access request to server to be measured, and receive the response message after server to be measured returns access request is processed;
Read the response message of corresponding described access request from access log file, whether the response message relatively read is identical with the response message of reception, records comparative result.
A kind of system of server being carried out to pressure test, this system comprises acting server and test and management subsystem;
Described acting server, for from server to be measured, obtaining access log file, the cache access journal file, read access request from access log file, send access request to server to be measured, and receive the response message after server to be measured returns access request is processed, described access request and described response message are sent to described test and management subsystem;
Described test and management subsystem, read the response message of corresponding described access request for the access log file from described proxy server caches, whether the response message relatively read is identical with the response message of reception, records comparative result.
Can find out from such scheme, in the present invention, from server to be measured, obtain access log file, according to the access request read from access log file, to server to be measured, send access request; Then, read the response message of corresponding described access request from access log file, whether the response message relatively read 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 the true access of user in access log file as test case, has greatly reduced workload; And test path covers extensively, can imitate the true access of diverse network, various browsers, make test result truer, accurate; And the present invention also compares the response message that reads from access log file and the response message of reception, and then has obtained about the conforming test result of response message.
The accompanying drawing explanation
Fig. 1 is that the present invention carries out the method indicative flowchart of pressure test to server;
Fig. 2 is that the present invention carries out the system configuration schematic diagram of pressure test to server.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, below in conjunction with embodiment and accompanying drawing, the present invention is described in more detail.
Internet Server is that the server of certain business service is provided for the user in the Internet, each Internet Server has a large amount of users to access every day, the access that comprises from the whole world Anywhere, carries out with any network at any time, different users conducts interviews to these servers according to different separately access habits, and the integrity of its complexity and covering all is better than the pressure test of enterprises to server; And these visit informations all are recorded in the access log file of server, described visit information comprises access request and corresponding response message.This access log file, for the visit information of recording user access services device, comprises access request and corresponding response message.
The present invention is based on access log file, send 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 to pressure test.Referring to Fig. 1, for test macro of the present invention, server is carried out the method indicative flowchart of pressure test, it comprises the following steps:
If described server to be measured is search engine server, the various access request that comprise keyword that the access request read from access log file sends to server to be measured in access process for the user, the inquiry request that for example comprises keyword " Mount Huang ", the inquiry request that comprises keyword " president ", etc.
Actual user's client and server to be measured need establish the link before carrying out transfer of data, confirm respectively the other side's identity.In the present invention, test macro is equivalent to actual user's client, before test macro obtains access log file from server to be measured, also need between test macro and server to be measured, establish the link, confirm respectively the other side's identity, test macro is preserved server identification to be measured, and server to be measured is preserved the test macro sign.
Access request comprises information header (Header) and the request volume data of Http access; Response message comprises information header (Header) and the response contents volume data of Http response.The information such as the access request of transmitting between test macro and server to be measured, response message can specifically adopt the socket protocol format.Response message is the message after server to be measured is processed the access request received, illustrate, if described server to be measured is search engine server, the various access request that comprise keyword that access request sends to server to be measured in access process for the user, the inquiry request that for example comprises keyword " Mount Huang ", server to be measured carries out data search according to keyword " Mount Huang ", the data that search is obtained, as the response contents volume data, are included in response message and feed back to subscription client.
Particularly, the response message read can be called to the first response message, the response message of reception is called to the second response message.
The whether identical method of comparison response message has multiple, below enumerates two kinds and describes:
Method one:
Adopt Message Digest Algorithm 5 (md5, Message Digest Algorithm), relatively whether the first response message character string is identical with the second response message character string, and if so, the response message read is identical with the response message of reception.Adopt md5 compare string string whether to be all mutually prior art, do not repeat here.
Method two:
Read respectively the key assignments that JS object symbol in response message (JSON, JavaScript Object Notation) field comprises, relatively whether key assignments is identical, and if so, the first response message is identical with the second response message; Key assignments is exactly the value of certain field in database.Response message comprises the JSON field, in the JSON field, comprises key assignments, the unique corresponding key assignments of every response message, if the key assignments in two response message is identical, this two response message is identical.
The described comparative result that records of step 103, comprise the whether identical mode of multiple recording responses message, for example:
The statistical comparison result is identical access times, using these access times as the pressure test result; Perhaps,
The statistical comparison result is identical access times, more described number of times and access total degree are divided by, using the phase division result as the pressure test result.
After obtaining the pressure test result, test macro can be notified tester and developer with the form of mail or form by the pressure test result, and then makes tester and developer understand fast the 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 the true access of user in access log file as test case, need not write specific test case, has greatly reduced workload; And test path covers extensively, can imitate the true access of diverse network, various browsers, make test result truer, accurate; And the present invention also compares the response message that reads from access log file and the response message of reception, and then has obtained about the conforming test result of response message.
Referring to Fig. 2, for the present invention, server is carried out the system configuration schematic diagram of pressure test, this system is aforesaid test macro namely, and it comprises acting server and test and management subsystem;
Described acting server, for from server to be measured, obtaining access log file, the cache access journal file, read access request from access log file, send access request to server to be measured, and receive the response message after server to be measured returns access request is processed, described access request and described response message are sent to described test and management subsystem;
Described test and management subsystem, read the response message of corresponding described access request for the access log file from described proxy server caches, whether the response message relatively read is identical with the response message of reception, records comparative result.
Particularly, access request comprises information header (Header) and the request volume data of Http access, and response message comprises information header and the response contents volume data of Http response.
Alternatively, described acting server comprises linking sets up unit, for establishing the link in advance and between server to be measured, confirms server identity to be measured.
Actual user's client and server to be measured need establish the link before carrying out transfer of data, confirm respectively the other side's identity.In the present invention, acting server is equivalent to actual user's client, before acting server obtains access log file from server to be measured, also need between acting server and server to be measured, establish the link, confirm respectively the other side's identity, acting server is preserved server identification to be measured, and server to be measured is preserved the acting server sign.Particularly, acting server can adopt Http agency's mode to provide agency service with 80 or 8080 ports.
Alternatively, described test and management subsystem comprises the first comparing unit, and for adopting md5, whether the response message character string relatively read is identical with the response message character string of reception, and if so, the response message read is identical with the response message of reception.
Alternatively, described test and management subsystem comprises the second comparing unit, and for reading from the response message that reads and the response message of reception the key assignments that the JSON field comprises respectively, relatively whether key assignments is identical, if so, the response message read is identical with the response message of reception.Response message comprises the JSON field, in the JSON field, comprises key assignments, the unique corresponding key assignments of every response message, if the key assignments in two response message is identical, this two response message is identical.
Alternatively, described test and management subsystem comprises the outcome record unit, for the statistical comparison result, is identical access times, described number of times and access total degree is divided by, using the phase division result as the pressure test result.After obtaining the pressure test result, the test and management subsystem can be notified tester and developer with the form of mail or form by the pressure test result, and then makes tester and developer understand fast the server situation of change, so that server is safeguarded.
As required, acting server and test and management subsystem can be placed in same equipment, also can be placed in respectively on two equipment.
The present invention utilizes the access request of the mass users of access log file record in Internet Server, send access request to server to be measured, and the response message recorded in the combined with access journal file is analyzed, obtain the pressure test result, thereby realized quickly and accurately server to be measured being carried out to the test of automation pressure.
The foregoing is only preferred embodiment of the present invention, in order to limit the present invention, within the spirit and principles in the present invention not all, any modification of making, be equal to replacement, improvement etc., within all should being included in the scope of protection of the invention.
Claims (10)
1. a method of server being carried out to pressure test, is characterized in that, the method comprises:
Obtain access log file from server to be measured, read access request from access log file;
Send access request to server to be measured, and receive the response message after server to be measured returns access request is processed;
Read the response message of corresponding described access request from access log file, whether the response message relatively read is identical with the response message of reception, records comparative result.
2. the method for claim 1, is characterized in that, described obtain access log file from server to be measured before, the method also comprises:
And establish the link between server to be measured, confirm respectively the other side's identity.
3. the method for claim 1, is characterized in that, describedly relatively comprises:
Adopt Message Digest Algorithm 5, whether the response message character string relatively read is identical with the response message character string of reception, and if so, the response message read is identical with the response message of reception.
4. the method for claim 1, is characterized in that, describedly relatively comprises:
Read the key assignments that the JSON field comprises respectively from the response message of the response message that reads and reception, relatively whether key assignments is identical, and if so, the response message read is identical with the response message of reception.
5. method as described as any one in claim 1 to 4, is characterized in that, the described comparative result that records comprises:
The statistical comparison result is identical access times, described number of times and access total degree is divided by, using the phase division result as the pressure test result.
6. a system of server being carried out to pressure test, is characterized in that, this system comprises acting server and test and management subsystem;
Described acting server, for from server to be measured, obtaining access log file, the cache access journal file, read access request from access log file, send access request to server to be measured, and receive the response message after server to be measured returns access request is processed, described access request and described response message are sent to described test and management subsystem;
Described test and management subsystem, read the response message of corresponding described access request for the access log file from described proxy server caches, whether the response message relatively read is identical with the response message of reception, records comparative result.
7. system as claimed in claim 6, is characterized in that, described acting server comprises linking sets up unit, for establishing the link in advance and between server to be measured, confirms server identity to be measured.
8. system as claimed in claim 6, it is characterized in that, described test and management subsystem comprises 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 so, the response message read is identical with the response message of reception.
9. system as claimed in claim 6, it is characterized in that, described test and management subsystem comprises the second comparing unit, for reading from the response message that reads and the response message of reception the key assignments that the JSON field comprises respectively, relatively whether key assignments is identical, if so, the response message read is identical with the response message of reception.
10. system as described as any one in claim 6 to 9, it is characterized in that, described test and management subsystem comprises the outcome record unit, for the statistical comparison result, is identical access times, described number of times and access total degree are divided by, using the phase division result as the pressure test result.
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 true CN103428042A (en) | 2013-12-04 |
CN103428042B 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) |
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104410546A (en) * | 2014-11-27 | 2015-03-11 | 北京国双科技有限公司 | Testing method and device of real-time processing system |
CN104951399A (en) * | 2015-06-19 | 2015-09-30 | 北京齐尔布莱特科技有限公司 | Software test system and method |
CN105868050A (en) * | 2015-12-29 | 2016-08-17 | 乐视网信息技术(北京)股份有限公司 | Verification method and device based on JSON data |
CN106254145A (en) * | 2016-09-06 | 2016-12-21 | 腾讯科技(深圳)有限公司 | network request tracking processing method and device |
CN107294803A (en) * | 2017-06-15 | 2017-10-24 | 北京小度信息科技有限公司 | Response message conformance test method and device |
CN107948234A (en) * | 2016-10-13 | 2018-04-20 | 北京国双科技有限公司 | The processing method and processing device of data |
CN109067938A (en) * | 2018-10-15 | 2018-12-21 | 网宿科技股份有限公司 | A kind of method and device for testing dns server |
CN109150643A (en) * | 2017-06-16 | 2019-01-04 | 阿里巴巴集团控股有限公司 | A kind of business processing method for detecting abnormality and device |
CN109309596A (en) * | 2017-07-28 | 2019-02-05 | 阿里巴巴集团控股有限公司 | A kind of method for testing pressure, device and server |
CN109542712A (en) * | 2018-11-02 | 2019-03-29 | 平安科技(深圳)有限公司 | Server stress test method, device, computer equipment and storage medium |
CN110457199A (en) * | 2018-05-08 | 2019-11-15 | 北京京东尚科信息技术有限公司 | The method and apparatus of performance test |
CN110489339A (en) * | 2019-07-26 | 2019-11-22 | 北京字节跳动网络技术有限公司 | Client's side pressure observes and predicts table generating method, system, medium and electronic equipment |
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 |
Cited By (19)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104410546A (en) * | 2014-11-27 | 2015-03-11 | 北京国双科技有限公司 | Testing method and device of real-time processing system |
CN104410546B (en) * | 2014-11-27 | 2018-04-03 | 北京国双科技有限公司 | The method of testing and device of real time processing system |
CN104951399A (en) * | 2015-06-19 | 2015-09-30 | 北京齐尔布莱特科技有限公司 | Software test system and method |
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 |
CN106254145A (en) * | 2016-09-06 | 2016-12-21 | 腾讯科技(深圳)有限公司 | network request tracking processing method and device |
CN107948234A (en) * | 2016-10-13 | 2018-04-20 | 北京国双科技有限公司 | The processing method and processing device of data |
CN107294803A (en) * | 2017-06-15 | 2017-10-24 | 北京小度信息科技有限公司 | Response message conformance test method and device |
CN109150643A (en) * | 2017-06-16 | 2019-01-04 | 阿里巴巴集团控股有限公司 | A kind of business processing method for detecting abnormality and device |
CN109309596A (en) * | 2017-07-28 | 2019-02-05 | 阿里巴巴集团控股有限公司 | A kind of method for testing pressure, device and server |
CN110457199A (en) * | 2018-05-08 | 2019-11-15 | 北京京东尚科信息技术有限公司 | The method and apparatus of performance test |
CN109067938A (en) * | 2018-10-15 | 2018-12-21 | 网宿科技股份有限公司 | A kind of method and device for testing dns server |
CN109067938B (en) * | 2018-10-15 | 2022-03-04 | 网宿科技股份有限公司 | Method and device for testing DNS (Domain name Server) |
CN109542712A (en) * | 2018-11-02 | 2019-03-29 | 平安科技(深圳)有限公司 | Server stress test method, device, computer equipment and storage medium |
CN109542712B (en) * | 2018-11-02 | 2023-04-07 | 平安科技(深圳)有限公司 | Server pressure testing method and device, computer equipment and storage medium |
CN110489339A (en) * | 2019-07-26 | 2019-11-22 | 北京字节跳动网络技术有限公司 | Client's side pressure observes and predicts table generating method, system, medium and electronic equipment |
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 |
Also Published As
Publication number | Publication date |
---|---|
CN103428042B (en) | 2016-06-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103428042A (en) | Method and system for carrying out stress test on server | |
CN111522922B (en) | Log information query method and device, storage medium and computer equipment | |
EP2088711B1 (en) | A log analyzing method and system based on distributed compute network | |
CN107169094B (en) | Information aggregation method and device | |
CN102546668B (en) | Method, device and system for counting unique visitors | |
AU2015230772A1 (en) | Methods and apparatus to share online media impressions data | |
CN104410546B (en) | The method of testing and device of real time processing system | |
CN103023710A (en) | Safety test system and method | |
CN113366478A (en) | Auditing of instrument measurement data maintained in a blockchain using independently stored verification keys | |
CN107294919A (en) | A kind of detection method and device of horizontal authority leak | |
US10305760B2 (en) | Identifying an analysis reporting message in network traffic | |
CN111030888B (en) | Domain name system DNS capacity measuring method, device, equipment and medium | |
CN109039787A (en) | log processing method, device and big data cluster | |
Rajabi et al. | Analyzing broken links on the web of data: An experiment with DBpedia | |
CN111612085B (en) | Method and device for detecting abnormal points in peer-to-peer group | |
CN111427613A (en) | Application program interface API management method and device | |
CN113449339A (en) | Log collection method, system, computer device and computer readable storage medium | |
CN105530137B (en) | Data on flows analysis method and data on flows analysis system | |
CN109542764B (en) | Webpage automatic testing method and device, computer equipment and storage medium | |
CN116776390A (en) | Method, device, storage medium and equipment for monitoring data leakage behavior | |
RU2532714C2 (en) | Method of acquiring data when evaluating network resources and apparatus therefor | |
CN116126808A (en) | Behavior log recording method, device, computer equipment and storage medium | |
Akhtar et al. | DBit: Assessing statistically significant differences in CDN performance | |
CN112788077B (en) | Data acquisition method and device, computer equipment and computer-readable storage medium | |
US8825843B2 (en) | System and methods for monitoring a geographic information system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
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. |
|
TR01 | Transfer of patent right |