Tomcat 长连接与短连接性能测试
2015-10-21 09:38
656 查看
转自http://www.cnblogs.com/likehua/p/4215249.html
环境:
操作系统:centos 6.5 x64
cpu:32 core
内存: 32G
web服务器:tomcat 6.x
jdk :1.6x
测试环境:
操作系统:centos 6.5 x64
cpu:32 core
内存: 32G
ab 作为性能测试工具
在做性能测试之前,对客户端和服务端均进行服务端优化(linux文件句柄数、socket 等网络参数)。在服务端,针对tomcat connector 进行bio 短连接和bio长连接分别进行测试,具体参数在这里不详细介绍。请求页面4k大小。测试结果如下:
ab -c 10000 -n 30000
http://192.98.12.241:8080/ime-server/
---长连接 结果
Requests per second: 12646.85 [#/sec] (mean)
Time per request: 790.711 [ms] (mean)
Time per request: 0.079 [ms] (mean, across all concurrent requests)
Transfer rate: 11189.40 [Kbytes/sec] received
---短 连接 结果
Requests per second: 4048.03 [#/sec] (mean)
Time per request: 2470.339 [ms] (mean)
Time per request: 0.247 [ms] (mean, across all concurrent requests)
Transfer rate: 3714.17 [Kbytes/sec] received
关于tomcat参数:
<!-- tomcat 1w 并发测试 短连接
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="5000"
maxThreads="10000"
minSpareThreads="100"
maxSpareThreads="10000"
acceptCount="5000"
URIEncoding="UTF-8"
redirectPort="8443" /> -->
<!-- bio keepAliveTimeout 长连接使用时间 maxKeepAliveRequests 长连接使用格式 1 表示禁用 -1 表示不限制 一般100-200 enableLookups 是否禁用dns查询 dns查询耗费网络
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
URIEncoding="UTF-8"
redirectPort="8443"
maxKeepAliveRequests="-1"
keepAliveTimeout="15000"
enableLookups=false
/> -->
环境:
操作系统:centos 6.5 x64
cpu:32 core
内存: 32G
web服务器:tomcat 6.x
jdk :1.6x
测试环境:
操作系统:centos 6.5 x64
cpu:32 core
内存: 32G
ab 作为性能测试工具
在做性能测试之前,对客户端和服务端均进行服务端优化(linux文件句柄数、socket 等网络参数)。在服务端,针对tomcat connector 进行bio 短连接和bio长连接分别进行测试,具体参数在这里不详细介绍。请求页面4k大小。测试结果如下:
ab -c 10000 -n 30000
![](file:///C:/Users/geoway/AppData/Local/Temp/%W@GJ$ACOF(TYDYECOKVDYB.png)
---长连接 结果
Requests per second: 12646.85 [#/sec] (mean)
Time per request: 790.711 [ms] (mean)
Time per request: 0.079 [ms] (mean, across all concurrent requests)
Transfer rate: 11189.40 [Kbytes/sec] received
---短 连接 结果
Requests per second: 4048.03 [#/sec] (mean)
Time per request: 2470.339 [ms] (mean)
Time per request: 0.247 [ms] (mean, across all concurrent requests)
Transfer rate: 3714.17 [Kbytes/sec] received
关于tomcat参数:
<!-- tomcat 1w 并发测试 短连接
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="5000"
maxThreads="10000"
minSpareThreads="100"
maxSpareThreads="10000"
acceptCount="5000"
URIEncoding="UTF-8"
redirectPort="8443" /> -->
<!-- bio keepAliveTimeout 长连接使用时间 maxKeepAliveRequests 长连接使用格式 1 表示禁用 -1 表示不限制 一般100-200 enableLookups 是否禁用dns查询 dns查询耗费网络
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
URIEncoding="UTF-8"
redirectPort="8443"
maxKeepAliveRequests="-1"
keepAliveTimeout="15000"
enableLookups=false
/> -->
相关文章推荐
- Centos6.5下搭建Tomcat
- Tomcat启动出错 java.net.UnknownHostException
- Maven项目Tomcat启动报错:java.lang.ClassNotFoundException
- 云主机windows Server 2003上安装tomcat的部署
- 启动Tomcat,报错系统找不到指定文件
- tomcat:java.lang.outofmemoryerror permgen space
- Tomcat配置优化
- [教程] IDEA13 + Maven 3.1 + Tomcat 7 + jrebel热部署web应用【JRebel无法安装时】
- MyEclipse 启动 tomcate 失败 解决方法
- tomcat指定jre、jdk
- java环境配置和tomcat环境配置
- apache2.2+mod_JK+Tomcat7+Terracotta3.7 集群
- Mac下Tomcat的下载安装和配置
- tomcat部署好ok的工程访问显示404错误,跟没有部署一样的现象
- 将 tomcat 安装成 windows 服务
- tomcat的 JNDI 配置
- java程序监控tomcat中部署的项目的状态以及控制某些项目的启动停止
- Tomcat手动指定jdk路径
- centos6.5下一个tomcat下部署多个程序方法
- Nginx + Tomcat配置负载均衡