Reputation: 4006
I have developed an application that will create lot of PDF's and serve those file. (Its normal Servlet-Buffering serving).
How to make sure my application works efficient with multiple request? Is there any tool available to test the load/scalability/efficiency and how many parallel request does my code handle with the current server configuration?
Upvotes: 7
Views: 1905
Reputation: 3334
Apachebench
is a single-thread tool. It means that it will not be able to saturate a SMP server (either muti-thread or multi-process).
You should rather consider weighttp
, which is using the AB syntax (the only difference is that -t 4 means use 4 worker threads instead of a 4-second test).
Upvotes: 0
Reputation: 196
The simplest thing you can do is Apache benchmark which is probably already installed if you're running a Unix based system or comes with Apache Webserver 2.x for Windows.
Example use;
$ ab -n 1000 -c 20 http://www.google.com/
Gives me this output;
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking www.google.com (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests
Server Software: gws
Server Hostname: www.google.com
Server Port: 80
Document Path: /
Document Length: 218 bytes
Concurrency Level: 20
Time taken for tests: 1.826 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Non-2xx responses: 1000
Total transferred: 807000 bytes
HTML transferred: 218000 bytes
Requests per second: 547.55 [#/sec] (mean)
Time per request: 36.527 [ms] (mean)
Time per request: 1.826 [ms] (mean, across all concurrent requests)
Transfer rate: 431.51 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 9 12 14.7 10 337
Processing: 11 24 26.8 17 306
Waiting: 11 22 21.1 16 297
Total: 21 36 30.5 28 350
Percentage of the requests served within a certain time (ms)
50% 28
66% 36
75% 39
80% 41
90% 45
95% 54
98% 93
99% 253
100% 350 (longest request)
Upvotes: 1
Reputation: 75366
You should also have surveillance tools in place to see how the application behaves under load.
A good start is jvisualvm which is in the latest Sun JDK.
Upvotes: 1
Reputation: 6293
I would also recommend JMeter. You can also record the page requests of your browser to create a JMeter test (HTTP Proxy Server).
Upvotes: 1
Reputation: 1612
You should consider using load test tools like grinder or jmeter. grinder supports scripting while jmeter lets you turn junit into load test client. I personally like jmeter because of junit support and also its fine gui control and reporting. jmeter support http and soap out of the box. Additionally, you can write you own plugins to fit your custom needs.
Upvotes: 1