首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

Tomcat6每秒至多并发60

2012-10-28 
Tomcat6每秒最多并发60这个话题可能有点老了,但是我没有找到具体的答案,所以再拿出了讨论下。看了robbin轻

Tomcat6每秒最多并发60

这个话题可能有点老了,但是我没有找到具体的答案,所以再拿出了讨论下。

看了robbin轻松并发1000,我却怎么都搞不起来,很是疑惑,望有经验的同仁指点。

?


服务器配置:


操作系统:Red Hat Enterprise 5 64位


CPU:?????? 2颗4核Intel(R) Xeon(R) CPU? E5410? @ 2.33GHz 64位


内存:???? 8G


Tomcat : 6.0.18

?

Tomcat配置:

?

<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"         maxThreads="1000" minSpareThreads="25" />    <Connector port="80" executor="tomcatThreadPool" protocol="HTTP/1.1" redirectPort="443"         connectionTimeout="20000" maxThreads="1000" acceptCount="250" minSpareThreads="25"         maxSpareThreads="75" enableLookups="false" compression="on" compressionMinSize="2048"        compressableMimeType="text/html,text/xml,text/javascript,text/css,text/plain"        disableUploadTimeout="true" URIEncoding="UTF-8"/>
?

?

我在自己电脑上测服务器并发

?

C:\Program Files\Apache Group\Apache2\bin>ab -n 1000 -c 60 http://www.mytomcat.cn/This is ApacheBench, Version 2.0.41-dev <$Revision: 1.121.2.12 $> apache-2.0Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/Copyright (c) 2006 The Apache Software Foundation, http://www.apache.org/Benchmarking www.mytomcat.cn (be patient)Completed 100 requestsCompleted 200 requestsCompleted 300 requestsCompleted 400 requestsCompleted 500 requestsCompleted 600 requestsCompleted 700 requestsCompleted 800 requestsCompleted 900 requestsFinished 1000 requestsServer Software:        Apache-Coyote/1.1Server Hostname:        www.mytomcat.cnServer Port:            80Document Path:          /Document Length:        154468 bytesConcurrency Level:      60Time taken for tests:   134.593750 secondsComplete requests:      1000Failed requests:        3   (Connect: 3, Length: 0, Exceptions: 0)Write errors:           0Total transferred:      154674000 bytesHTML transferred:       154468000 bytesRequests per second:    7.43 [#/sec] (mean)Time per request:       8075.625 [ms] (mean)Time per request:       134.594 [ms] (mean, across all concurrent requests)Transfer rate:          1122.25 [Kbytes/sec] receivedConnection Times (ms)              min  mean[+/-sd] median   maxConnect:        0   68 699.4     15    9046Processing:    31 7919 12149.5    844   51813Waiting:        0 3764 9156.9    328   30656Total:         46 7988 12189.6    859   51828Percentage of the requests served within a certain time (ms)  50%    859  66%    906  75%  12703  80%  24750  90%  30781  95%  30812  98%  33656  99%  33718 100%  51828 (longest request)

?

C:\Program Files\Apache Group\Apache2\bin>ab -n 1000 -c 70 http://www.mytomcat.cn/This is ApacheBench, Version 2.0.41-dev <$Revision: 1.121.2.12 $> apache-2.0Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/Copyright (c) 2006 The Apache Software Foundation, http://www.apache.org/Benchmarking www.mytomcat.cn (be patient)apr_pollset_create failed: Invalid argument (22)

?

才并发70就不行了,maxThreads , acceptCount, minSpareThreads,maxSpareThreads这几个参数怎么样设置为最佳,欢迎来拍砖

[root@localhost bin]# ab -n 10000 -c 1000 http://www.mytomcat.cn/This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/Copyright 2006 The Apache Software Foundation, http://www.apache.org/Benchmarking www.mytomcat.cn (be patient)Completed 1000 requestsCompleted 2000 requestsCompleted 3000 requestsCompleted 4000 requestsCompleted 5000 requestsCompleted 6000 requestsCompleted 7000 requestsCompleted 8000 requestsCompleted 9000 requestsFinished 10000 requestsServer Software: Server Hostname: www.mytomcat.cnServer Port: 80Document Path: /Document Length: 0 bytesConcurrency Level: 1000Time taken for tests: 108.106467 secondsComplete requests: 10000Failed requests: 60 (Connect: 0, Length: 60, Exceptions: 0)Write errors: 0Non-2xx responses: 9775Total transferred: 4133782 bytesHTML transferred: 22140 bytesRequests per second: 92.50 [#/sec] (mean)Time per request: 10810.647 [ms] (mean)Time per request: 10.811 [ms] (mean, across all concurrent requests)Transfer rate: 37.33 [Kbytes/sec] receivedConnection Times (ms) min mean[+/-sd] median maxConnect: 0 4204 8252.3 957 94190Processing: 35 3436 10613.3 840 66946Waiting: 0 2146 6375.8 820 63949Total: 46 7640 12707.9 2478 95350Percentage of the requests served within a certain time (ms) 50% 2478 66% 4647 75% 7571 80% 10401 90% 22330 95% 46270 98% 60236 99% 61223 100% 95350 (longest request)[root@localhost bin]# ab -n 10000 -c 1000 http://www.mytomcat.cn/This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/Copyright 2006 The Apache Software Foundation, http://www.apache.org/Benchmarking www.mytomcat.cn (be patient)Completed 1000 requestsCompleted 2000 requestsCompleted 3000 requestsCompleted 4000 requestsCompleted 5000 requestsCompleted 6000 requestsCompleted 7000 requestsCompleted 8000 requestsCompleted 9000 requestsFinished 10000 requestsServer Software: Server Hostname: www.mytomcat.cnServer Port: 80Document Path: /Document Length: 0 bytesConcurrency Level: 1000Time taken for tests: 126.468671 secondsComplete requests: 10000Failed requests: 59 (Connect: 0, Length: 59, Exceptions: 0)Write errors: 0Non-2xx responses: 9464Total transferred: 4003331 bytesHTML transferred: 21771 bytesRequests per second: 79.07 [#/sec] (mean)Time per request: 12646.867 [ms] (mean)Time per request: 12.647 [ms] (mean, across all concurrent requests)Transfer rate: 30.91 [Kbytes/sec] receivedConnection Times (ms) min mean[+/-sd] median maxConnect: 0 3560 7641.3 852 93969Processing: 13 5115 14623.1 786 71828Waiting: 0 1896 5952.3 740 62251Total: 38 8676 15604.4 2031 94669Percentage of the requests served within a certain time (ms) 50% 2031 66% 4534 75% 5735 80% 10219 90% 22583 95% 61123 98% 61218 99% 66278 100% 94669 (longest request)

上面我运行了2次的结果,感觉比较慢,而且Failed requests有60个,不知道该如何优化了,欢迎拍砖?

热点排行