`
sun2009
  • 浏览: 4195 次
  • 性别: Icon_minigender_1
  • 来自: 妈妈的肚子
最近访客 更多访客>>
社区版块
存档分类
最新评论

Tomcat6每秒最多并发60

    博客分类:
  • JAVA
阅读更多

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

看了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.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这几个参数怎么样设置为最佳,欢迎来拍砖

分享到:
评论
3 楼 sun2009 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个,不知道该如何优化了,欢迎拍砖?
2 楼 yiding_he 2009-08-04  
先看看静态页面(It works!)能达到多少并发吧。
1 楼 wuyuhua 2009-08-04  
http://www.mytomcat.cn/   里面的内容是什么??

相关推荐

    tomcat 1000/s 并发配置

    通过以上这些配置和优化,我们可以使Tomcat更好地适应每秒处理1000次请求的高并发场景。然而,具体数值需要根据实际应用的负载和服务器硬件资源进行调整,以找到最佳的平衡点。记得在进行任何重大改动后,都要进行...

    tomcat 最大并发连接数 acceptCount

    tomcat 最大并发数 并发量 tomcat 最大并发连接数 acceptCount不能说只要大于acceptCount的连接就一定被拒绝!

    tomcat并发量详解

    tomcat并发量详解 tomcat并发连接数详解

    Tomcat自定义日志配置流程

    NULL 博文链接:https://jyao.iteye.com/blog/1266503

    tomcat 启动优化和并发并发优化配置.rar

    《Tomcat启动优化与并发优化配置详解》 Tomcat,作为Java Web应用最常用的服务器,其性能优化对于提升系统整体效率至关重要。本文将深入探讨Tomcat的启动优化和并发优化配置,帮助开发者们更好地理解并实践这些关键...

    能用的tomcat6

    【标题】:“能用的Tomcat6” 【正文】: Tomcat6是Apache软件基金会的Jakarta项目中的一个核心项目,它是一个开源的、免费的Web应用服务器,主要用于部署Java Servlet和JavaServer Pages(JSP)应用程序。这个“能...

    tomcat6的源码

    Apache Tomcat 6是一款广泛应用的开源Java Servlet容器,它实现了Java EE中的Servlet和JSP规范。这个源码包,"apache-tomcat-6.0.43-src",是Tomcat 6的官方源代码,非常适合开发者进行深入学习和自定义修改。以下是...

    tomcat并发资料

    【标题】:“Tomcat并发资料” 【描述】:这篇博文主要探讨了Apache Tomcat服务器在处理高并发场景下的性能优化和工作原理。作者通过深入分析Tomcat的源码,揭示了Tomcat如何处理并发请求,以及如何配置和调整以...

    Tomcat6 Tomcat6。0

    Tomcat6 Tomcat6。0 tomcatTomcat6 Tomcat6。0 tomcatTomcat6 Tomcat6。0 tomcatTomcat6 Tomcat6。0 tomcatTomcat6 Tomcat6。0 tomcatTomcat6 Tomcat6。0 tomcatTomcat6 Tomcat6。0 tomcat

    【高并发】高并发环境下如何优化Tomcat性能?看完我懂了!

    Tomcat作为最常用的Java Web服务器,随着并发量越来越高,Tomcat的性能会急剧下降,那有没有什么方法来优化Tomcat在高并发环境下的性能呢? Tomcat运行模式 Tomcat的运行模式有3种。 1.bio模式 默认的模式,性能非常...

    tomcat6到8windows版本.zip

    【标题】"tomcat6到8windows版本.zip" 涵盖了三个不同版本的Apache Tomcat,分别是Tomcat 6、Tomcat 7和Tomcat 8.5,这些都是针对Windows操作系统设计的64位版本。Apache Tomcat是一款开源的Java Servlet容器,主要...

    tomcat 版本6、7、8

    Tomcat6、Tomcat7和Tomcat8是三个重要的版本,每个版本都有其特定的功能改进和性能提升,下面将详细介绍它们之间的差异和演化。 【Tomcat6】: Tomcat6是基于Java Servlet 2.5和JavaServer Pages 2.1标准的。这个...

    解决tomcat 并发数的一种方式

    假如有四个tomcat,每个tomcat的并发数为30,用一个tomcat专门负责url跳转。因为第一个tomcat 只负责跳转所以他的并发瓶颈可以忽略。 那么tomcat A+B+C 的并发数就是90了。 内附源码 只给你一种思想。O(∩_∩)O哈哈...

    tomcat6 32位系统

    标题中的“tomcat6 32位系统”指的是Apache Tomcat 6版本,这是一个专为32位操作系统设计的开源Web应用服务器,主要用于部署和运行Java Servlet和JavaServer Pages(JSP)应用程序。Tomcat是Java EE(现在称为...

    tomcat6和tomcat7

    标题中的“tomcat6和tomcat7”指的是Apache Tomcat的两个不同版本。Apache Tomcat是一款开源的Java Servlet容器,它实现了Java Servlet和JavaServer Pages(JSP)规范,是运行Java Web应用的重要服务器组件。Tomcat6...

    Tomcat 6 Linux版

    编写一个名为 `tomcat6` 的启动脚本,并将其放置在 `/etc/init.d/` 目录下。然后,使用 `chkconfig` 添加到开机启动: ``` chkconfig --add tomcat6 chkconfig tomcat6 on ``` 7. **配置防火墙** 如果Linux...

    c3p0 jdbc dbcp tomcatjdbc 乐观锁 高并发测试 4000 以上

    为了更明确怎样开发出高并发程序,本人写了一个测试例子去体验下 C3P0 tomcatJdbc dbcp 他们的并发能力。采用乐观锁控制oracle数据并发访问。测试结果表明在 c3p0 和dbcp 都能执行完4800以下并发线程访问。c3p0 比较...

    tomcat6免安裝版

    tomcat6tomcat6tomcat6tomcat6tomcat6tomcat6tomcat6tomcat6tomcat6tomcat6tomcat6tomcat6tomcat6tomcat6tomcat6tomcat6

    tomcat6、tomcat7、tocmat8、tomcat9 linux版、windox版百度云

    tomcat6、tomcat7、tocmat8、tomcat9 linux版、windox版 32位 64位

Global site tag (gtag.js) - Google Analytics