查看tomcat并發(fā)連接數(shù)實(shí)現(xiàn)方式
查看tomcat并發(fā)連接數(shù)
方式1:通過tomcat自帶的管理控制臺查看
啟動tomcat后,在瀏覽器輸入:http://11.8.130.129:8080/manager/status
tomcat7以后需要賬號登錄,配置賬號需要進(jìn)入tomcat目錄下的conf路徑下tomcat-user.xml文件進(jìn)行修改:
打開tomcat-users.xml加上如下代碼到 </tomcat-users> 節(jié)點(diǎn)內(nèi)就ok了
<role rolename="manager-gui"/> <role rolename="manager-script"/> <role rolename="manager-jmx"/> <role rolename="manager-status"/> <user username="admin" password="admin" roles="manager-gui,manager-script,manager-jmx,manager-status"/>
配置修改后,重啟tomcat ,再次輸入上述的地址,登錄。
登錄后可以看到以下內(nèi)容:
"http-bio-8080" Max threads: 200 Current thread count: 10 Current thread busy: 2 Max processing time: 671 ms Processing time: 3.987 s Request count: 197 Error count: 1 Bytes received: 0.00 MB Bytes sent: 1.84 MB
Current thread count 就是當(dāng)前的并發(fā)量。
方式2:通過命令行查看
實(shí)時查看tomcat并發(fā)連接數(shù)
[root@jxc ] # netstat -na|grep ESTABLISHED|grep 8080| wc -l
*此命令必須用root執(zhí)行
查看指定端口是否監(jiān)聽
[root@jxc ] # netstat -an | grep 8080
linux查看開放的端口
[root@jxc ] # iptables -L -n
*此命令必須用root執(zhí)行
在防火墻中打開8080端口
[root@localhost bin]# iptables -I INPUT -p tcp --dport 8080 -j ACCEPT
*此命令必須用root執(zhí)行
總結(jié)
以上為個人經(jīng)驗(yàn),希望能給大家一個參考,也希望大家多多支持腳本之家。
相關(guān)文章
使用Maven tomcat:run命令啟動web項(xiàng)目時修改默認(rèn)端口的方法
今天小編就為大家分享一篇使用Maven tomcat:run命令啟動web項(xiàng)目時修改默認(rèn)端口的方法,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2018-05-05
tomcat何時寫回響應(yīng)數(shù)據(jù)報的詳析
這篇文章主要給大家介紹了關(guān)于tomcat是何時寫回響應(yīng)數(shù)據(jù)報的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對大家學(xué)習(xí)或者使用tomcat具有一定的參考學(xué)習(xí)價值,需要的朋友們下面來一起學(xué)習(xí)學(xué)習(xí)吧2019-04-04
直接雙擊啟動tomcat中的startup.bat閃退原因及解決方法
免安裝的tomcat雙擊startup.bat后,啟動窗口一閃而過,而且tomcat服務(wù)未啟動,下面與大家分享下原因及解決方法2014-08-08

