PrintWriter out = response.getWriter();
String aStr = request.getParameter("a");
String bStr = request.getParameter("b");
int a = 100;
int b = 100;
try{
a = Integer.parseInt(aStr);
b = Integer.parseInt(bStr);
}catch(Exception excep){
System.err.println("err:" + excep.getMessage());
}
int sum = 0;
long s = System.currentTimeMillis();
for(int i = 0; i < a; ++i){
for(int ii = 0; ii < b; ++ii){
sum = a / b;
}
}
long e = System.currentTimeMillis();
long d = e - s;
out.println( d );
Server Software: Jetty(6.1.22)
Server Hostname: 172.31.36.158
Server Port: 8080
Document Path: /jt_jt/servlet/TestRuning?a=100000&b=100000
Document Length: 2 bytes
Concurrency Level: 1
Time taken for tests: 8.715 seconds
Complete requests: 5000
Failed requests: 0
Write errors: 0
Total transferred: 445000 bytes
HTML transferred: 10000 bytes
Requests per second: 573.72 [#/sec] (mean)
Time per request: 1.743 [ms] (mean)
Time per request: 1.743 [ms] (mean, across all concurrent requests)
Transfer rate: 49.86 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 1.1 0 5
Processing: 0 1 7.1 0 50
Waiting: 0 1 7.1 0 50
Total: 0 2 7.2 0 50
Percentage of the requests served within a certain time (ms)
50% 0
66% 0
75% 0
80% 0
90% 5
95% 5
98% 45
99% 50
100% 50 (longest request)
以上是jetty的,下边是tomcat的
Server Software: Apache-Coyote/1.1
Server Hostname: 172.31.36.158
Server Port: 8888
Document Path: /jt_jt/servlet/TestRuning?a=100000&b=100000
Document Length: 3 bytes
Concurrency Level: 1
Time taken for tests: 4.070 seconds
Complete requests: 5000
Failed requests: 0
Write errors: 0
Total transferred: 650000 bytes
HTML transferred: 15000 bytes
Requests per second: 1228.50 [#/sec] (mean)
Time per request: 0.814 [ms] (mean)
Time per request: 0.814 [ms] (mean, across all concurrent requests)
Transfer rate: 155.96 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 1.2 0 5
Processing: 0 0 1.7 0 45
Waiting: 0 0 1.7 0 45
Total: 0 1 2.1 0 45
Percentage of the requests served within a certain time (ms)
50% 0
66% 0
75% 0
80% 0
90% 5
95% 5
98% 5
99% 5
100% 45 (longest request)