轉:tomcat下查看並發流量

來源:互聯網
上載者:User

http://wangxuliangboy.javaeye.com/blog/235081

如何在WINDOW下配置TOMCAT APR:

 

APR是什麼呢,(Tomcat can use the Apache Portable Runtime to provide superior scalability, performance, and better integration with native server technologies.

Windows下的安裝配置與使用
1、先去 http://tomcat.heanet.ie/native/ 下載編譯好的 tcnative-1.DLL 檔案

2、把tcnative-1.dll檔案放在Tomcat的bin目錄下

然後啟動TOMCAT,如果看到以下資訊:

2008-8-31 17:28:59 org.apache.coyote.http11.Http11AprProtocol start
資訊: Starting Coyote HTTP/1.1 on http-8080
2008-8-31 17:28:59 org.apache.coyote.ajp.AjpAprProtocol start]則配置成功

 

然後你可以用APACHE的AB命令測試下效果.

  ab -n 1000 -c 300 http://localhost:8080/turbine/index.jsp

 

相關APR的參數配置可以參考以下文檔:

         http://tomcat.apache.org/tomcat-5.5-doc/apr.html

 

 

 

 

如何查看TOMCAT的並發訪問量:

  我們進入TOMCAT服務管理頁面(http://localhost:8080/manager/status),可以看到下面這段文字

http-8080

Max threads: 1000 Min spare threads: 0 Max spare threads: 0 Current thread count: 303 Current thread busy: 234 Keeped alive sockets count: 0
Max processing time: 23531 ms Processing time: 29287.717 s Request count: 2980 Error count: 0 Bytes received: 0.00 MB Bytes sent: 12.61 MB

 

Current thread count: 303  這個參數則代表當前TOMCAT的並發訪問量

 

 

 

這是我TOMCAT伺服器的配置:

 <Connector port="8080" maxHttpHeaderSize="8192" pollerSize="10025"
               maxThreads="1000" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" redirectPort="8443" acceptCount="100"
      compression="on" compressionMinSize="2048"   
compressableMimeType="text/html,text/xml,text/javascript,text/css,text/plain" 
               connectionTimeout="20000" disableUploadTimeout="true" sendfileSize="2048" />

 

 

將TOMCAT日誌更改為LOG4J日誌輸出

   把commons-logging.jar,log4j-1.2.13.jar的兩個JAR拷貝到tomcat_home/common/lib下面.

  然後在將log4j.properties拷貝到tomcat_home/common/classes下面

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.