CN105207832A - Server stress testing method and device - Google Patents

Server stress testing method and device Download PDF

Info

Publication number
CN105207832A
CN105207832A CN201410264311.9A CN201410264311A CN105207832A CN 105207832 A CN105207832 A CN 105207832A CN 201410264311 A CN201410264311 A CN 201410264311A CN 105207832 A CN105207832 A CN 105207832A
Authority
CN
China
Prior art keywords
test
request
server
test request
concurrent thread
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
Application number
CN201410264311.9A
Other languages
Chinese (zh)
Other versions
CN105207832B (en
Inventor
张萍萍
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201410264311.9A priority Critical patent/CN105207832B/en
Publication of CN105207832A publication Critical patent/CN105207832A/en
Application granted granted Critical
Publication of CN105207832B publication Critical patent/CN105207832B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)
  • Computer And Data Communications (AREA)

Abstract

The embodiment of the invention discloses a server stress testing method which comprises the following steps that (1) a test sample queue reads multiple preset test request samples, wherein each of the test request samples carries different resource identifies of a tested server, (2) multiple concurrent threads extract different request samples from the sample request queue and sends testing requests to the tested server according to the extracted test request samples, (3) the multiple concurrent threads obtain the testing results of the testing requests and associate the testing results and the resource identifies of the tested server and stores the testing results. The embodiment of the invention also discloses a server stress testing device. By using the server stress testing method and the server stress testing device, the detailed testing result of the stress test of the server can be obtained.

Description

A kind of server stress method of testing and device
Technical field
The present invention relates to a kind of Internet technical field, particularly relate to a kind of server stress method of testing and device.
Background technology
Along with the develop rapidly of Internet technology, to the performance of server and the requirement of stability more and more higher, therefore often need to carry out pressure test with the processing speed situation etc. of acquisition server performance index and network request to server.The instrument that pressure test is carried out on existing backstage is very many, such as: HTTP_LOAD, AB (ApacheBenchmark) etc., can carry out backstage pressure test.
In existing pressure test mode, all write some test request samples in advance to obtain test request sample set, then from test request sample set, test request sample is extracted at random to send test request to server by concurrent thread, under which, multiple concurrent thread may send identical test request to server, if at this moment server end is provided with buffer memory, the data in buffer memory then can be used to respond test request, namely can cause interference to test result.
On the other hand, existing pressure test instrument all cannot obtain concrete test result after a test, such as when running into test result and being unsuccessful, can not be concrete reflect unsuccessful be which request, at this moment administrative staff need the access log checking server end, and efficiency is very low.
Summary of the invention
Embodiment of the present invention technical problem to be solved is, provides a kind of server stress method of testing and device, can obtain the DCO result of server being carried out to pressure test.
In order to solve the problems of the technologies described above, embodiments provide a kind of server stress method of testing, described method comprises:
The multiple test request samples preset are read in test sample book queue, and wherein each described test request sample carries the different resource identification of tested server;
Multiple concurrent thread extracts different test request samples respectively from described sample request queue, and sends test request according to the test request sample extracted to tested server;
Described multiple concurrent thread obtains the test result of described test request respectively, and described test result is associated with the resource identification of described tested server and preserve.
Correspondingly, the embodiment of the present invention additionally provides a kind of server stress testing apparatus, comprising:
Test sample book queue, for reading default multiple test request samples, wherein each described test request sample carries the different resource identification of tested server;
Multiple concurrent thread, each concurrent thread is used for from described sample request queue, extracting different test request samples respectively, and sends test request according to the test request sample extracted to tested server;
Described multiple concurrent thread, also for obtaining the test result of described test request respectively, and associates described test result with the resource identification of described tested server and preserves.
Set multiple concurrent thread in server stress testing apparatus in the present embodiment extract different test sample book requests from sample request queue thus send test request to tested server, can realize obtaining the DCO result of server being carried out to pressure test, when there is the unsuccessful test result of test, can be easy-to-look-up to corresponding test request sample and corresponding resource identification.And then what to send to tested server due to each concurrent thread is different test request, it also avoid the test error because the data cached quick response test request of tested server by utilizing brings.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the schematic flow sheet of a kind of server stress method of testing in the embodiment of the present invention;
Fig. 2 is the schematic flow sheet of the server stress method of testing in another embodiment of the present invention;
Fig. 3 is the schematic flow sheet of the server stress method of testing in another embodiment of the present invention;
Fig. 4 is the structural representation of the server stress testing apparatus in the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
Tested server mentioned by the embodiment of the present invention can may need for Website server, Online Map background server etc. the background server simultaneously receiving a large amount of concurrent request business of user.Executive agent server being carried out to pressure test can for the server stress testing apparatus proposed in the embodiment of the present invention, and it can be implemented in arbitrary network equipment.
Fig. 1 is the schematic flow sheet of a kind of server stress method of testing in the embodiment of the present invention, and the server stress method of testing as shown in the figure in the present embodiment can comprise:
S101, the multiple test request samples preset are read in test sample book queue, and wherein each described test request sample carries the different resource identification of tested server.
Concrete, server stress testing apparatus can pre-define a test sample book queue Queue, after test starts, the multiple test request samples preset are read in test sample book queue, this test request sample can preset according to the different resource mark of tested server, such as can set test request sample according to the different available URL (UniformResoureLocator: URL(uniform resource locator)) of tested server, the different URL of described tested server can be carried in described test request sample, other parameters and the test data for sending test request to tested server can also be comprised, such as to the same URL of tested server send different parameters and business datum also can obtain different test results, for Online Map background server, it can obtain different access URL according to different search condition, can URL as the http request submitted to tested server when term is " url " be http://map.xxxxx.com/? newmap=1 & ie=utf-8 & s=s%26wd%3Durl, can the URL that term is the http request submitted to tested server time " Nanjing " be http://map.xxxxx.com/? newmap=1 & ie=utf-8 & s=s%26wd%3D%E5%8D%97%E4%BA%AC, server stress testing apparatus can by collecting the higher URL of user's request amount that may send to tested server in advance, thus obtain described multiple test request sample.
S102, multiple concurrent thread extracts different test request samples respectively from described sample request queue, and sends test request according to the test request sample extracted to tested server.
Concrete, the quantity of described concurrent thread can be set as required by keeper in advance and obtain.Front 10 the test request samples such as, read in described sample request queue are respectively A, B, C, D ... I, J, current 4 concurrent thread 1, concurrent thread 2 and concurrent thread 3 extract A, B and C respectively from sample request queue, and send test request according to the test request sample extracted to tested server, as http request can be sent according to the URL address of carrying in the test request sample extracted to tested server.And then in an alternative embodiment, server stress testing apparatus can pre-define a timer Timer, described multiple concurrent thread can obtain each test request from sending test request to the testing time obtaining test result by timer, such as obtain transmitting time when sending test request from timer, and obtain the test result time when getting test result from timer, thus obtain the testing time.Described concurrent thread can be daemon thread (ThreadUrl), namely in order to avoid process information in the process of implementation shows in terminal and process also can not any end message of producing by terminal interrupt, to depart from terminal operating system and in the process of running background.
S103, described multiple concurrent thread obtains the test result of described test request respectively, and described test result is associated with the resource identification of described tested server and preserve.
Concrete, tested server is after the test request receiving concurrent thread transmission, test result can be returned to concurrent thread, as carried out Business Processing success according to the test request received, then service processing result is returned this concurrent thread, if Business Processing failure, then Business Processing failure result can be returned this concurrent thread, the details of Business Processing failure (failure cause or error code) can also be returned concurrent thread, if and then because of the Internet Transmission reason test request that causes tested server to fail to receive concurrent thread sending such as unsuccessfully, this concurrent thread also can according to the strategy execution tested RQ request preset, if or receive in the time limit test result of failing to receive tested server and returning in the test request preset in an alternative embodiment, then concurrent thread also can confirm that the result of this test request is unsuccessfully, thus obtain the test result of this test request.Concurrent thread is after getting the test result of each test request, the resource identification of tested server corresponding with this test request for test result can be associated and preserve, like this when test occurring being unsuccessful, the resource identification that the unsuccessful test request of test is corresponding can be viewed easily, and to realize the test result that the follow-up resource identification according to tested server inquires about corresponding test request.
And then in an alternative embodiment, after concurrent thread obtains the result of test request, can continue from sample request queue, extract remaining test request sample, still with example above, first get the result of test request at concurrent thread 1 after, it can continue from sample request queue, extract test request sample D, and sends test request according to test request sample D to tested server.
Set multiple concurrent thread in server stress testing apparatus in the present embodiment extract different test sample book requests from sample request queue thus send test request to tested server, can realize obtaining the DCO result of server being carried out to pressure test, when there is the unsuccessful test result of test, can be easy-to-look-up to corresponding test request sample and corresponding resource identification.And then what to send to tested server due to each concurrent thread is different test request, it also avoid the test error because the data cached quick response test request of tested server by utilizing brings.
Fig. 2 is the schematic flow sheet of the server stress method of testing in another embodiment of the present invention, and the server stress method of testing flow process as shown in the figure in the present embodiment can comprise:
S201, the multiple test request samples preset are read in test sample book queue, and wherein each described test request sample carries the different resource identification of tested server.
Concrete, server stress testing apparatus can pre-define a test sample book queue Queue, after test starts, the multiple test request samples preset are read in test sample book queue, this test request sample can preset according to the different resource mark of tested server, such as can set test request sample according to the different available URL (UniformResoureLocator: URL(uniform resource locator)) of tested server, the different URL of described tested server can be carried in described test request sample, other parameters and the test data for sending test request to tested server can also be comprised, such as to the same URL of tested server send different parameters and business datum also can obtain different test results.Server stress testing apparatus by collecting the higher URL of user's request amount that may send to tested server in advance, thus can obtain described multiple test request sample.
S202, multiple concurrent thread extracts different test request samples respectively from described sample request queue, and sends test request according to the test request sample extracted to tested server.
Concrete, described concurrent thread can be daemon thread (ThreadUrl), and the quantity of described concurrent thread can be obtained by keeper's setting in advance.And then in an alternative embodiment, described multiple concurrent thread can also by each test request of timer record from sending test request to the testing time obtaining test result.
S203, described multiple concurrent thread obtains the test result of described test request respectively, and described test result is associated with the resource identification of described tested server and preserve.
Concrete, tested server is after the test request receiving concurrent thread transmission, test result can be returned to concurrent thread, as carried out Business Processing success according to the test request received, then service processing result is returned this concurrent thread, if Business Processing failure, then Business Processing failure result can be returned this concurrent thread, the details of Business Processing failure (failure cause or error code) can also be returned concurrent thread, if and then because of the Internet Transmission reason test request that causes tested server to fail to receive concurrent thread sending such as unsuccessfully, this concurrent thread also can according to the strategy execution tested RQ request preset, if or receive in the time limit test result of failing to receive tested server and returning in the test request preset in an alternative embodiment, then concurrent thread also can confirm that the result of this test request is unsuccessfully, thus obtain the test result of this test request.Concurrent thread is after getting the test result of each test request, the resource identification of tested server corresponding with this test request for test result can be associated and preserve, like this when test occurring being unsuccessful, the resource identification that the unsuccessful test request of test is corresponding can be viewed easily, and to realize the test result that the follow-up resource identification according to tested server inquires about corresponding test request.And then in an alternative embodiment, and then after concurrent thread obtains the result of test request, can continue from sample request queue, extract remaining test request sample.
S204, gathers the test result and corresponding resource identification that export described multiple concurrent thread preservation.
Concrete, all taken out by concurrent thread when all test request samples in described sample request queue and performed test, namely test request is sent and after obtaining test result, the test result that described multiple concurrent thread is preserved by server stress testing apparatus and corresponding resource identification gather output.And in an alternative embodiment because concurrent thread can by each test request sample of timer record from sending test request to obtaining testing time of test result, can test total time of performing according to all test request samples in described sample request queue of export server pressure test device when gathering output.The all test request samples how judging in described sample request queue have been performed test all various ways, such as find when certain concurrent thread extracts test request sample from described sample request queue not remain test request sample in described sample request queue, namely all test request samples in described sample request queue are all extracted, at this moment concurrent thread can notify to export summarizing module, when all concurrent thread are all notified of output summarizing module, namely represent that all test request samples in described sample request queue have all been taken out by concurrent thread and obtained test result.In an alternative embodiment, server stress testing apparatus also can gather according to the control command of keeper's input the test result and corresponding resource identification that export the current preservation of described multiple concurrent thread.Further alternative, server stress testing apparatus also only can gather the unsuccessful test result and corresponding resource identification that export described multiple concurrent thread preservation.
Set multiple concurrent thread in server stress testing apparatus in the present embodiment extract different test sample book requests from sample request queue thus send test request to tested server, can realize obtaining the DCO result of server being carried out to pressure test, when there is the unsuccessful test result of test, can be easy-to-look-up to corresponding test request sample and corresponding resource identification.And then what to send to tested server due to each concurrent thread is different test request, it also avoid the test error because the data cached quick response test request of tested server by utilizing brings.
Fig. 3 is the schematic flow sheet of the server stress method of testing in another embodiment of the present invention, and the server stress method of testing flow process as shown in Figure 3 in the present embodiment can comprise:
S301, the multiple test request samples preset are read in test sample book queue, and wherein each described test request sample carries the different URL of tested server.
For Online Map background server, it can obtain different access URL according to different search condition, can URL as the http request submitted to tested server when term is " url " be http://map.xxxxx.com/? newmap=1 & ie=utf-8 & s=s%26wd%3Durl, can the URL that term is the http request submitted to tested server time " Nanjing " be http://map.xxxxx.com/? newmap=1 & ie=utf-8 & s=s%26wd%3D%E5%8D%97%E4%BA%AC, server stress testing apparatus can by collecting the higher URL of user's request amount that may send to tested server in advance, thus obtain described multiple test request sample.
S302, multiple concurrent thread extracts different test request samples respectively from described sample request queue, and sends HTTP request according to the test request sample extracted to tested server.
Concrete, the quantity of described concurrent thread can be obtained by keeper's setting in advance.Front 10 the test request samples such as, read in described sample request queue are respectively A, B, C, D ... I, J, current 4 concurrent thread 1, concurrent thread 2 and concurrent thread 3 extract A, B and C respectively from sample request queue, and send test request according to the test request sample extracted to tested server, as http request can be sent according to the URL address of carrying in the test request sample extracted to tested server.And then in the present embodiment, described multiple concurrent thread can by each test request of timer record from sending test request to the testing time obtaining test result.Described concurrent thread can be daemon thread (ThreadUrl), namely in order to avoid process information in the process of implementation shows in terminal and process also can not any end message of producing by terminal interrupt, to depart from terminal operating system and in the process of running background.
S303, described multiple concurrent thread obtains the test result of described HTTP request respectively, comprises and records each test request from sending test request to obtaining testing time of test result, and described test result is associated with the URL of described tested server and preserve.
Concrete, tested server is after the test request receiving concurrent thread transmission, test result can be returned to concurrent thread, as carried out Business Processing success according to the test request received, then service processing result is returned this concurrent thread, if Business Processing failure, then Business Processing failure result can be returned this concurrent thread, the details of Business Processing failure (failure cause or error code) can also be returned concurrent thread, if and then because of the Internet Transmission reason test request that causes tested server to fail to receive concurrent thread sending such as unsuccessfully, this concurrent thread also can according to the strategy execution tested RQ request preset, if or receive in the time limit test result of failing to receive tested server and returning in the test request preset in an alternative embodiment, then concurrent thread also can confirm that the result of this test request is unsuccessfully, thus obtain the test result of this test request.Concurrent thread can by each test request sample of timer record from sending test request to obtaining testing time of test result in the present embodiment, can testing time of performing according to all test request samples in described sample request queue of export server pressure test device when gathering output.Concurrent thread is after getting the test result of each test request, the resource identification of tested server corresponding with this test request for test result can be associated and preserve, like this when test occurring being unsuccessful, the resource identification that the unsuccessful test request of test is corresponding can be viewed easily, and to realize the test result that the follow-up resource identification according to tested server inquires about corresponding test request.
And then in an alternative embodiment, and then after concurrent thread obtains the result of test request, can continue from sample request queue, extract remaining test request sample, still with example above, first get the result of test request at concurrent thread 1 after, it can continue from sample request queue, extract test request sample D, and sends test request according to test request sample D to tested server.
S304, determines that all test request samples in described test sample book queue are performed test all.
Concrete, the all test request samples how judging in described sample request queue have been performed test all various ways, such as find when certain concurrent thread extracts test request sample from described sample request queue not remain test request sample in described sample request queue, namely all test request samples in described sample request queue are all extracted, at this moment concurrent thread can notify to export summarizing module, when all concurrent thread are all notified of output summarizing module, namely represent that all test request samples in described sample request queue have all been taken out by concurrent thread and obtained test result.
S305, gathers the test result and corresponding URL that export described multiple concurrent thread preservation.
Concrete, all taken out by concurrent thread when all test request samples in described sample request queue and performed test, namely test request is sent and after obtaining test result, the test result that described multiple concurrent thread is preserved by server stress testing apparatus and corresponding resource identification gather output.And in the present embodiment because concurrent thread can by each test request sample of timer record from sending test request to obtaining testing time of test result, can test total time of performing according to all test request samples in described sample request queue of export server pressure test device when gathering output.Further alternative, server stress testing apparatus also only can gather the unsuccessful test result and corresponding resource identification that export described multiple concurrent thread preservation.
Set multiple concurrent thread in server stress testing apparatus in the present embodiment extract different test sample book requests from sample request queue thus send test request to tested server, can realize automatically exporting the DCO result of tested server being carried out to pressure test, when there is the unsuccessful test result of test, corresponding test request sample and corresponding resource identification can be obtained.And then what to send to tested server due to each concurrent thread is different test request, it also avoid the test error because the data cached quick response test request of tested server by utilizing brings.
Fig. 4 is the structural representation of the server stress testing apparatus in the embodiment of the present invention.Server stress testing apparatus as shown in the figure in the embodiment of the present invention can at least comprise:
Test sample book queue 410, for reading default multiple test request samples, wherein each described test request sample carries the different resource identification of tested server.
In specific implementation, server stress testing apparatus can pre-define test sample book queue 410, as being a Queue, after test starts, the multiple test request samples preset are read in test sample book queue 410, this test request sample can preset according to the different resource mark of tested server, such as can set test request sample according to the different available URL (UniformResoureLocator: URL(uniform resource locator)) of tested server, the different URL of described tested server can be carried in described test request sample, other parameters and the test data for sending test request to tested server can also be comprised, such as to the same URL of tested server send different parameters and business datum also can obtain different test results, for Online Map background server, it can obtain different access URL according to different search condition, can URL as the http request submitted to tested server when term is " url " be http://map.xxxxx.com/? newmap=1 & ie=utf-8 & s=s%26wd%3Durl, can the URL that term is the http request submitted to tested server time " Nanjing " be http://map.xxxxx.com/? newmap=1 & ie=utf-8 & s=s%26wd%3D%E5%8D%97%E4%BA%AC, server stress testing apparatus can by collecting the higher URL of user's request amount that may send to tested server in advance, thus obtain described multiple test request sample.
Multiple concurrent thread 420, as the concurrent thread 1 in Fig. 4, concurrent thread 2 ... concurrent thread N, wherein each concurrent thread is used for from described sample request queue, extracting different test request samples respectively, and sends test request according to the test request sample extracted to tested server.
Front 10 the test request samples such as, read in described sample request queue are respectively A, B, C, D ... I, J, current 4 concurrent thread 1, concurrent thread 2 and concurrent thread 3 extract A, B and C respectively from sample request queue, and send test request according to the test request sample extracted to tested server, as http request can be sent according to the URL address of carrying in the test request sample extracted to tested server.And then in an alternative embodiment, server stress testing apparatus can pre-define a timer Timer, described multiple concurrent thread can obtain each test request from sending test request to the testing time obtaining test result by timer, such as obtain transmitting time when sending test request from timer, and obtain the test result time when getting test result from timer, thus each test request can be recorded from sending test request to the testing time obtaining test result.Described concurrent thread can be daemon thread (ThreadUrl), namely in order to avoid process information in the process of implementation shows in terminal and process also can not any end message of producing by terminal interrupt, to depart from terminal operating system and in the process of running background.
Described multiple concurrent thread 420, also for obtaining the test result of described test request respectively, and associates described test result with the resource identification of described tested server and preserves.
In specific implementation, tested server is after the test request receiving concurrent thread transmission, test result can be returned to concurrent thread, as carried out Business Processing success according to the test request received, then service processing result is returned this concurrent thread, if Business Processing failure, then Business Processing failure result can be returned this concurrent thread, the details of Business Processing failure (failure cause or error code) can also be returned concurrent thread, if and then because of the Internet Transmission reason test request that causes tested server to fail to receive concurrent thread sending such as unsuccessfully, this concurrent thread also can according to the strategy execution tested RQ request preset, if or receive in the time limit test result of failing to receive tested server and returning in the test request preset in an alternative embodiment, then concurrent thread also can confirm that the result of this test request is unsuccessfully, thus obtain the test result of this test request.Concurrent thread is after getting the test result of each test request, the resource identification of tested server corresponding with this test request for test result can be associated and preserve, like this when test occurring being unsuccessful, the resource identification that the unsuccessful test request of test is corresponding can be viewed easily, and to realize the test result that the follow-up resource identification according to tested server inquires about corresponding test request.
And then in an alternative embodiment, after concurrent thread obtains the result of test request, can continue from sample request queue, extract remaining test request sample, still with example above, first get the result of test request at concurrent thread 1 after, it can continue from sample request queue, extract test request sample D, and sends test request according to test request sample D to tested server.
And then optional, the server stress testing apparatus in the embodiment of the present invention can also comprise:
Test result output module 430, for gathering the test result and corresponding resource identification that export described multiple concurrent thread 420 preservation.
In specific implementation, all taken out by concurrent thread when all test request samples in described sample request queue and performed test, namely test request is sent and after obtaining test result, the test result that described multiple concurrent thread is preserved by test result output module 430 and corresponding resource identification gather output.And in an alternative embodiment because concurrent thread can by each test request sample of timer record from sending test request to the testing time obtaining test result, test result output module 430 can export the test total time that described multiple concurrent thread 420 performs according to all test request samples in described sample request queue when gathering output.In an alternative embodiment, test result output module 430 also can gather according to the control command of keeper's input the test result and corresponding resource identification that export the current preservation of described multiple concurrent thread.Further alternative, test result output module 430 also only can gather the unsuccessful test result and corresponding resource identification that export described multiple concurrent thread preservation.
And then optional, the server stress testing apparatus in the embodiment of the present invention can also comprise:
Test and confirmed module 440, for when determining that all test request samples in described test sample book queue have been performed test all, having triggered test result output module and gathering the test result and corresponding resource identification that export described multiple concurrent thread preservation.The all test request samples how judging in described sample request queue have been performed test all various ways, such as find when certain concurrent thread extracts test request sample from described sample request queue not remain test request sample in described sample request queue, namely all test request samples in described sample request queue are all extracted, at this moment concurrent thread can notify to export summarizing module, when all concurrent thread are all notified of output summarizing module, namely represent that all test request samples in described sample request queue have all been taken out by concurrent thread and obtained test result.
And then optional, the server stress testing apparatus in the embodiment of the present invention can also comprise:
Concurrent quantity setting module, for setting the quantity of described concurrent thread.
In specific implementation, the quantity N of described concurrent thread can be set as required by keeper in advance and obtain.
Set multiple concurrent thread in server stress testing apparatus in the present embodiment extract different test sample book requests from sample request queue thus send test request to tested server, can realize obtaining the DCO result of server being carried out to pressure test, when there is the unsuccessful test result of test, can be easy-to-look-up to corresponding test request sample and corresponding resource identification.And then what to send to tested server due to each concurrent thread is different test request, it also avoid the test error because the data cached quick response test request of tested server by utilizing brings.
One of ordinary skill in the art will appreciate that all or part of flow process realized in above-described embodiment method, that the hardware that can carry out instruction relevant by computer program has come, described program can be stored in a computer read/write memory medium, this program, when performing, can comprise the flow process of the embodiment as above-mentioned each side method.Wherein, described storage medium can be magnetic disc, CD, read-only store-memory body (Read-OnlyMemory, ROM) or random store-memory body (RandomAccessMemory, RAM) etc.
Above disclosedly be only present pre-ferred embodiments, certainly can not limit the interest field of the present invention with this, therefore according to the equivalent variations that the claims in the present invention are done, still belong to the scope that the present invention is contained.

Claims (18)

1. a server stress method of testing, is characterized in that, described method comprises:
The multiple test request samples preset are read in test sample book queue, and wherein each test request sample carries the different resource identification of tested server;
Multiple concurrent thread extracts different test request samples respectively from described sample request queue, and sends test request according to the test request sample extracted to tested server;
Described multiple concurrent thread obtains the test result of described test request respectively, and described test result is associated with the resource identification of described tested server and preserve.
2. server stress method of testing as claimed in claim 1, it is characterized in that, described method also comprises:
Gather the test result and corresponding resource identification that export described multiple concurrent thread preservation.
3. server stress method of testing as claimed in claim 2, is characterized in that, described in gather and export test result that described multiple concurrent thread preserves and corresponding resource identification is:
Gather the unsuccessful test result and corresponding resource identification that export described multiple concurrent thread preservation.
4. server stress method of testing as claimed in claim 2, is characterized in that, described in gather export test result and corresponding resource identification that described multiple concurrent thread preserves before also comprise:
Determine that all test request samples in described test sample book queue are performed test all.
5. server stress method of testing as claimed in claim 1, it is characterized in that, the test result that described multiple concurrent thread obtains described test request respectively comprises:
Described multiple each test request of concurrent thread record is from sending test request to the testing time obtaining test result.
6. server stress method of testing as claimed in claim 5, is characterized in that, described test sample book queue also comprises before reading the multiple test request samples preset:
Predefine timer Timer;
Described multiple each test request of concurrent thread record comprised from sending test request to the testing time obtaining test result:
Each test request is obtained from sending test request to the testing time obtaining test result by described timer Timer.
7. server stress method of testing as claimed in claim 1, it is characterized in that, described concurrent thread is daemon thread.
8. server stress method of testing as claimed in claim 1, it is characterized in that, described multiple concurrent thread also comprises before extracting different test request samples respectively from described sample request queue:
Set the quantity of described concurrent thread.
9. the server stress method of testing according to any one of claim 1 ~ 8, is characterized in that, described resource identification is URL URL(uniform resource locator);
Described test request is the http hypertext transfer protocol request sent according to described URL.
10. a server stress testing apparatus, is characterized in that, comprising:
Test sample book queue, for reading default multiple test request samples, wherein each described test request sample carries the different resource identification of tested server;
Multiple concurrent thread, each concurrent thread is used for from described sample request queue, extracting different test request samples respectively, and sends test request according to the test request sample extracted to tested server;
Described multiple concurrent thread, also for obtaining the test result of described test request respectively, and associates described test result with the resource identification of described tested server and preserves.
11. server stress testing apparatuss as claimed in claim 10, is characterized in that, also comprise:
Test result output module, for gathering the test result and corresponding resource identification that export described multiple concurrent thread preservation.
12. server stress testing apparatuss as claimed in claim 11, it is characterized in that, described test result output module is used for:
Gather the unsuccessful test result and corresponding resource identification that export described multiple concurrent thread preservation.
13. server stress testing apparatuss as claimed in claim 11, is characterized in that, also comprise:
Test confirmation module, for when determining that all test request samples in described test sample book queue have been performed test all, having triggered test result output module and gathering the test result and corresponding resource identification that export described multiple concurrent thread preservation.
14. server stress testing apparatuss as claimed in claim 10, is characterized in that,
Described multiple concurrent thread, also for the testing time of recording needle to the test result that each test request sample returns from transmission test request to acquisition server.
15. server stress testing apparatuss as claimed in claim 14, is characterized in that, also comprise:
Predefined timer Timer;
Described multiple concurrent thread obtains each test request from sending test request to the testing time obtaining test result by described timer Timer.
16. server stress testing apparatuss as claimed in claim 10, it is characterized in that, described concurrent thread is daemon thread.
17. server stress testing apparatuss as claimed in claim 10, is characterized in that, also comprise:
Concurrent quantity setting module, for setting the quantity of described concurrent thread.
18. server stress testing apparatuss according to any one of claim 10 ~ 17, it is characterized in that, described resource identification is URL URL(uniform resource locator);
Described test request is the http hypertext transfer protocol request sent according to described URL.
CN201410264311.9A 2014-06-13 2014-06-13 A kind of server stress test method and device Active CN105207832B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410264311.9A CN105207832B (en) 2014-06-13 2014-06-13 A kind of server stress test method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410264311.9A CN105207832B (en) 2014-06-13 2014-06-13 A kind of server stress test method and device

Publications (2)

Publication Number Publication Date
CN105207832A true CN105207832A (en) 2015-12-30
CN105207832B CN105207832B (en) 2019-05-03

Family

ID=54955285

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410264311.9A Active CN105207832B (en) 2014-06-13 2014-06-13 A kind of server stress test method and device

Country Status (1)

Country Link
CN (1) CN105207832B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105915406A (en) * 2016-04-12 2016-08-31 北京齐尔布莱特科技有限公司 Testing method, testing device and computing equipment
CN106210028A (en) * 2016-07-05 2016-12-07 广州华多网络科技有限公司 A kind of server prevents method, server and the system of overload
CN108205477A (en) * 2016-12-16 2018-06-26 上海仪电(集团)有限公司中央研究院 Server stress test method
CN109144846A (en) * 2017-06-28 2019-01-04 北京京东尚科信息技术有限公司 Test method and device for testing service device
CN109284227A (en) * 2018-09-06 2019-01-29 政采云有限公司 A kind of automation method for testing pressure and device calculate equipment and storage medium
CN110874304A (en) * 2018-09-03 2020-03-10 广州神马移动信息科技有限公司 Pressure testing method, device, equipment and computer readable storage medium
CN113204485A (en) * 2021-05-08 2021-08-03 山东英信计算机技术有限公司 Memory database pressure testing method, system, terminal and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1506823A (en) * 2002-12-13 2004-06-23 英业达股份有限公司 Test method of overall server performance
CN1953401A (en) * 2005-10-20 2007-04-25 英业达股份有限公司 Multi-threading network pressure testing method
CN101848116A (en) * 2010-04-21 2010-09-29 中国海洋大学 Simple and quick automatic pressure test method of Web server
CN102035697A (en) * 2010-12-31 2011-04-27 中国电子科技集团公司第十五研究所 Concurrent connections performance testing system and method for file system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1506823A (en) * 2002-12-13 2004-06-23 英业达股份有限公司 Test method of overall server performance
CN1953401A (en) * 2005-10-20 2007-04-25 英业达股份有限公司 Multi-threading network pressure testing method
CN101848116A (en) * 2010-04-21 2010-09-29 中国海洋大学 Simple and quick automatic pressure test method of Web server
CN102035697A (en) * 2010-12-31 2011-04-27 中国电子科技集团公司第十五研究所 Concurrent connections performance testing system and method for file system

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105915406A (en) * 2016-04-12 2016-08-31 北京齐尔布莱特科技有限公司 Testing method, testing device and computing equipment
CN105915406B (en) * 2016-04-12 2019-10-18 北京齐尔布莱特科技有限公司 A kind of test method, device and calculate equipment
CN106210028A (en) * 2016-07-05 2016-12-07 广州华多网络科技有限公司 A kind of server prevents method, server and the system of overload
CN106210028B (en) * 2016-07-05 2019-09-06 广州华多网络科技有限公司 A kind of server prevents method, server and the system of overload
CN108205477A (en) * 2016-12-16 2018-06-26 上海仪电(集团)有限公司中央研究院 Server stress test method
CN109144846A (en) * 2017-06-28 2019-01-04 北京京东尚科信息技术有限公司 Test method and device for testing service device
CN109144846B (en) * 2017-06-28 2022-07-05 北京京东尚科信息技术有限公司 Test method and device for testing server
CN110874304A (en) * 2018-09-03 2020-03-10 广州神马移动信息科技有限公司 Pressure testing method, device, equipment and computer readable storage medium
CN109284227A (en) * 2018-09-06 2019-01-29 政采云有限公司 A kind of automation method for testing pressure and device calculate equipment and storage medium
CN113204485A (en) * 2021-05-08 2021-08-03 山东英信计算机技术有限公司 Memory database pressure testing method, system, terminal and storage medium

Also Published As

Publication number Publication date
CN105207832B (en) 2019-05-03

Similar Documents

Publication Publication Date Title
CN105207832A (en) Server stress testing method and device
AU2018201459B2 (en) System and method for improving access to search results
US10362086B2 (en) Method and system for automating submission of issue reports
CN106708711B (en) log information output control method and device
CN102752288A (en) Method and device for identifying network access action
CN110287696B (en) Detection method, device and equipment for rebound shell process
CN106790744B (en) IP scheduling method and system
CN104410546A (en) Testing method and device of real-time processing system
KR20180074774A (en) How to identify malicious websites, devices and computer storage media
US10341290B2 (en) Method and system for presenting recommendation information
CN111478792B (en) Cutover information processing method, system and device
CN110798445A (en) Public gateway interface testing method and device, computer equipment and storage medium
CN103428249A (en) Collecting method and processing method for HTTP request packet, system and server
CN114629929B (en) Log recording method, device and system
CN106648912B (en) Modularization method and device for data processing in data acquisition platform
CN107992535A (en) File immediate addressing device, method, system and computer-readable recording medium
CN106933858A (en) Page source statistic method and view controller
CN109101297B (en) Page identification method and device
CN108255868B (en) Method and device for checking links in website
CN102694802B (en) Network access information recording method and device
CN103605480A (en) Web server and method for Web server disk resource access control
CN111651356A (en) Application program testing method, device and system
CN104486098A (en) Access fault monitoring method and device
CN104750693A (en) Method and device for realizing dotting
CN109376066A (en) A kind of automatic test approach and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant