浏览 2132 次
锁定老帖子 主题:Tomcat6每秒最多并发60
该帖已经被评为隐藏帖
|
|
---|---|
作者 | 正文 |
发表时间:2009-08-04
最后修改:2009-08-04
这个话题可能有点老了,但是我没有找到具体的答案,所以再拿出了讨论下。
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.0 Copyright (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 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 Finished 1000 requests Server Software: Apache-Coyote/1.1 Server Hostname: www.mytomcat.cn Server Port: 80 Document Path: / Document Length: 154468 bytes Concurrency Level: 60 Time taken for tests: 134.593750 seconds Complete requests: 1000 Failed requests: 3 (Connect: 3, Length: 0, Exceptions: 0) Write errors: 0 Total transferred: 154674000 bytes HTML transferred: 154468000 bytes Requests 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] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 68 699.4 15 9046 Processing: 31 7919 12149.5 844 51813 Waiting: 0 3764 9156.9 328 30656 Total: 46 7988 12189.6 859 51828 Percentage 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.0 Copyright (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这几个参数怎么样设置为最佳,欢迎来拍砖 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |
发表时间:2009-08-04
http://www.mytomcat.cn/ 里面的内容是什么??
|
|
返回顶楼 | |
发表时间:2009-08-04
先看看静态页面(It works!)能达到多少并发吧。
|
|
返回顶楼 | |
发表时间:2009-08-04
知道原因了,我自己电脑问题。改在服务器上测试,数据如下:
[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.0 Copyright 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 requests Completed 2000 requests Completed 3000 requests Completed 4000 requests Completed 5000 requests Completed 6000 requests Completed 7000 requests Completed 8000 requests Completed 9000 requests Finished 10000 requests Server Software: Server Hostname: www.mytomcat.cn Server Port: 80 Document Path: / Document Length: 0 bytes Concurrency Level: 1000 Time taken for tests: 108.106467 seconds Complete requests: 10000 Failed requests: 60 (Connect: 0, Length: 60, Exceptions: 0) Write errors: 0 Non-2xx responses: 9775 Total transferred: 4133782 bytes HTML transferred: 22140 bytes Requests 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] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 4204 8252.3 957 94190 Processing: 35 3436 10613.3 840 66946 Waiting: 0 2146 6375.8 820 63949 Total: 46 7640 12707.9 2478 95350 Percentage 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.0 Copyright 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 requests Completed 2000 requests Completed 3000 requests Completed 4000 requests Completed 5000 requests Completed 6000 requests Completed 7000 requests Completed 8000 requests Completed 9000 requests Finished 10000 requests Server Software: Server Hostname: www.mytomcat.cn Server Port: 80 Document Path: / Document Length: 0 bytes Concurrency Level: 1000 Time taken for tests: 126.468671 seconds Complete requests: 10000 Failed requests: 59 (Connect: 0, Length: 59, Exceptions: 0) Write errors: 0 Non-2xx responses: 9464 Total transferred: 4003331 bytes HTML transferred: 21771 bytes Requests 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] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 3560 7641.3 852 93969 Processing: 13 5115 14623.1 786 71828 Waiting: 0 1896 5952.3 740 62251 Total: 38 8676 15604.4 2031 94669 Percentage 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个,不知道该如何优化了,欢迎拍砖? |
|
返回顶楼 | |