|
精华帖 (3) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
|---|---|
| 作者 | 正文 |
|
时间:2008-05-12
对于windows的MaxUserPort 和TcpTimedWaitDelay 我采用的都是默认值,未作任何变动 tomact配置如下: <Connector
port="8080" maxThreads="1200" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
debug="0" connectionTimeout="20000"
disableUploadTimeout="true" useBodyEncodingForURI="true" />
catalina.bat调整: set JAVA_OPTS=-Xms256m -Xmx512m -Djava.awt.headless=true 跑了下首页的测试jsp,结果如下: D:\Program Files\Apache Software Foundation\Apache2.2\bin>ab -c 1000 -n 10000 http://localhost:8080/Hession/index.jsp
|
|
| 返回顶楼 | |
|
时间:2008-05-12
用apr应该能进一步提高吧?
以前yulimin写过一篇介绍文章 不知道在楼主的tomcat版本里是否有效 http://yulimin.javaeye.com/blog/27429 |
|
| 返回顶楼 | |
|
时间:2008-05-12
smilerain 写道 哈哈,终于优化到420了。。
不知道是否可以贴出你的配置参数? MaxUserPort=20000和TcpTimedWaitDelay=30 tomcat 内存 1500M
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-" maxThreads="1024" minSpareThreads="32"/>
<Connector port="8080" protocol="HTTP/1.1" maxThreads="1024" connectionTimeout="60000" minSpareThreads="32" maxSpareThreads="128" redirectPort="8440" minProcessors="30" maxProcessors="1024" enableLookups="false" acceptCount="1024" URIEncoding="UTF-8"/>
<Connector port="8081" protocol="HTTP/1.1" maxThreads="1024" connectionTimeout="60000" minSpareThreads="32" maxSpareThreads="128" redirectPort="8441" minProcessors="30" maxProcessors="1024" enableLookups="false" acceptCount="1024" URIEncoding="UTF-8"/>
<Connector port="8082" protocol="HTTP/1.1" maxThreads="1024" connectionTimeout="60000" minSpareThreads="32" maxSpareThreads="128" redirectPort="8442" minProcessors="30" maxProcessors="1024" enableLookups="false" acceptCount="1024" URIEncoding="UTF-8"/>
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8010" protocol="AJP/1.3" compression="on" connectionTimeout="60000" maxThreads="1024" minSpareThreads="32" maxSpareThreads="128" maxHttpHeaderSize="8192" minProcessors="30" maxProcessors="1024" enableLookups="false" acceptCount="1024" redirectPort="8440" URIEncoding="UTF-8"/>
<Connector port="8011" protocol="AJP/1.3" compression="on" connectionTimeout="60000" maxThreads="1024" minSpareThreads="32" maxSpareThreads="128" maxHttpHeaderSize="8192" minProcessors="30" maxProcessors="1024" enableLookups="false" acceptCount="1024" redirectPort="8441" URIEncoding="UTF-8"/>
<Connector port="8012" protocol="AJP/1.3" compression="on" connectionTimeout="60000" maxThreads="1024" minSpareThreads="32" maxSpareThreads="128" maxHttpHeaderSize="8192" minProcessors="30" maxProcessors="1024" enableLookups="false" acceptCount="1024" redirectPort="8442" URIEncoding="UTF-8"/>
<Connector port="8020" handler.list="mx" mx.enabled="true" maxThreads="50" mx.httpHost="localhost" minProcessors="2" maxProcessors="25" enableLookups="false" acceptCount="30" mx.httpPort="888" protocol="AJP/1.3" redirectPort="8443"/>
|
|
| 返回顶楼 | |
|
时间:2008-05-12
我的机器没有做任何优化,core 2 1.83G + 2G RAM, Tomcat 6.0.16 + jdk 1.6.0_10, tomcat单独测试比楼主性能不知道强多少倍去了!!!
ab -n 10000 -c 250 http://127.0.0.1:8080/index.jsp Benchmarking localhost (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: Apache-Coyote/1.1 Server Hostname: localhost Server Port: 8080 Document Path: /index.jsp Document Length: 8568 bytes Concurrency Level: 250 Time taken for tests: 12.31250 seconds Complete requests: 10000 Failed requests: 0 Write errors: 0 Total transferred: 86950000 bytes HTML transferred: 85680000 bytes Requests per second: 831.17 [#/sec] (mean) Time per request: 300.781 [ms] (mean) Time per request: 1.203 [ms] (mean, across all concurrent requests) Transfer rate: 7057.62 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 2.7 0 15 Processing: 31 296 26.6 296 343 Waiting: 15 146 73.6 140 296 Total: 31 296 26.6 296 343 Percentage of the requests served within a certain time (ms) 50% 296 66% 296 75% 312 80% 312 90% 312 95% 312 98% 328 99% 328 100% 343 (longest request) |
|
| 返回顶楼 | |
|
时间:2008-05-13
fins 写道 用apr应该能进一步提高吧?
以前yulimin写过一篇介绍文章 不知道在楼主的tomcat版本里是否有效 http://yulimin.javaeye.com/blog/27429 apr加上了! |
|
| 返回顶楼 | |
|
时间:2008-05-16
通常,对于新闻类或者论坛类动态网站,使用 Apache 反向代理是更好的性能提高的办法。
比如论坛,某个子栏目,可能秒,或者秒 1/100 都有数据在更新。但是没有关系,对于每个用户来说,如果我们让他在 2 秒内连续刷新页面 n 次,看到的都是同样一个页面;超过 2 秒就变成最新的页面,这是可以接受的。 另一方面,对于整个 web 应用,对于所有用户,这个子栏目,如果所有用户,在 2秒看到的都是同样的页面数据,虽然这个页面已经不是最新的,但是并无大碍。 也就是说,在 10 秒钟内,虽然这个子栏目,服务器接收了无数的 web 请求,但是,服务器只在 0、2、4、6、8、10 秒等 6 个几个时间点上,进行了动态页面的执行,其他的 web 请求,都被前面的 Apache 用缓冲数据打法掉了。这样,10 秒钟内, Web 应用只执行了 6 次动态页面,但是却服务了无数次并发请求。 这一技术是如此之新,以至于很多人都不了解。国内的新浪网 CTO,几乎每年都在 CSDN 或者其他什么地方,大谈特谈他们自己的 Web 缓存技术如何世界一流,实际上,他们单独开发自己的 Web 缓存技术,是因为那个时候,还没有 Apache 等免费的反向代理缓冲技术。商业的同类产品,动辄几十万美金,对于大多数国内公司,即使是新浪网,也是太过奢侈了。但是他们如果在 2008 年 CSDN 年刊中,再来吹这个,大概普天之下,不对他们骂娘的,就极少了! |
|
| 返回顶楼 | |
|
时间:2008-05-16
edge 写道 用windows的话,著名的MaxUserPort和TcpTimedWaitDelay得先调,不然没法对比
估计很多人无视了这一点 |
|
| 返回顶楼 | |
|
时间:2008-05-16
谢谢各位的建议和帮助。
本人对最终未能在windows 2003上配置出来,还是转到linux上了, 在linux上的默认配置,1K并发可以很轻松的完成。 |
|
| 返回顶楼 | |
|
时间:2008-05-20
apache/bin/ab是比较好用,但是只能跟踪一个网页,不能整站跟踪;
Xenu是好用,但是看不到来源网页request.getHeader("Referer"); 除了apache/bin/ab可以跟踪网站的性能, 还有什么比较好的工具可以跟踪网站的情况: 如:更好的测试出网站的整体压力; 如:更好的分析网页的关键词,做出更好的SEO网页; 如:更好的分析网站的404,501等错误! 望各位大哥能给出一些您前常用的SEO工具,谢谢! |
|
| 返回顶楼 | |
|
时间:2008-05-25
D:\Apache Group\Apache2.2\bin>ab -n 10000 -c 1000 http://127.0.0.1:11080/test.js Benchmarking 127.0.0.1 (be patient)
Document Path: /test.jsp Concurrency Level: 1000 Connection Times (ms) Percentage of the requests served within a certain time (ms) |
|
| 返回顶楼 | |








