您好,登錄后才能下訂單哦!
適當(dāng)?shù)娜罩居涗浐捅O(jiān)控:日志和監(jiān)控有助于分析和排錯(cuò)。
是基于HTTP協(xié)議,支持HTTP1.1,它使tomcat服務(wù)器扮演一個(gè)獨(dú)立 服務(wù)器和JSP/servlet功能的服務(wù)器。
JAVA AJP是基于Apache JServ 協(xié)議的,該連接器常常是在你不想暴露自己的Java servlet容器到Internet.
Apache Portable Runtime(APR)是在擴(kuò)容,性能和不同web服務(wù)器之間的兼容最好 的。它提供了比如OPENSSL,共享內(nèi)存,Unix大套接字等。
線程沲定義了web服務(wù)器連接請求連接的數(shù)量,可以定義兩種線程沲:一是共享沲,二是專用沲。該配置在TOMCAT_HOME/conf/server.xml文件中定義的。
假如你配置了四個(gè)連接器,那么你可以共享使用這個(gè)線程沲。
配置如下:
<Executor name="tomcatThreadPool"
namePrefix="catalina-exec-"
maxThreads="150"
minSpareThreads="4"/>
<Connector executor="tomcatThreadPool"
port="8080"
protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<Connector port="8443" protocol="HTTP/1.1"
SSLEnabled="true"
maxThreads="150"
scheme="https"
secure="true"
clientAuth="false" sslProtocol="TLS" />
默認(rèn)定義的最大線程沲是150個(gè),在生產(chǎn)環(huán)境中,可以根據(jù)服務(wù)器的性能來調(diào)下該參數(shù)。
也相當(dāng)于并發(fā)數(shù)一樣,默認(rèn)值是1,也就是相當(dāng)于關(guān)閉。
JMAP顯示共享JAVA虛擬機(jī)內(nèi)存信息,對查看共享內(nèi)存的狀態(tài)有用的。下面是一些常用選項(xiàng):
Options Description
./jmap --heap <process id>
比如我們的JAVA的ID是4306,那么就執(zhí)行./jmap -heap 4306
Attaching to process ID 4306, please wait...
Debugger attached successfully.
Client compiler detected.
JVM version is 19.1-b02
using thread-local object allocation.
Mark Sweep Compact GC
Heap Configuration:
MinHeapFreeRatio = 40
MaxHeapFreeRatio = 70
MaxHeapSize = 268435456 (256.0MB)
NewSize = 1048576 (1.0MB)
MaxNewSize = 4294901760 (4095.9375MB)
OldSize = 4194304 (4.0MB)
NewRatio = 2
SurvivorRatio = 8
PermSize = 12582912 (12.0MB)
MaxPermSize = 67108864 (64.0MB)
Heap Usage:
New Generation (Eden + 1 Survivor Space):
capacity = 5111808 (4.875MB)
used = 3883008 (3.703125MB)
free = 1228800 (1.171875MB)
75.96153846153847% used
Eden Space:
capacity = 4587520 (4.375MB)
used = 3708360 (3.5365676879882812MB)
free = 879160 (0.8384323120117188MB)
80.83583286830357% used
From Space:
capacity = 524288 (0.5MB)
used = 174648 (0.16655731201171875MB)
free = 349640 (0.33344268798828125MB)
33.31146240234375% used
To Space:
capacity = 524288 (0.5MB)
used = 0 (0.0MB)
free = 524288 (0.5MB)
0.0% used
tenured generation:
capacity = 11206656 (10.6875MB)
used = 3280712 (3.1287307739257812MB)
free = 7925944 (7.558769226074219MB)
29.274673908077485% used
Perm Generation:
capacity = 12582912 (12.0MB)
used = 6639016 (6.331459045410156MB)
free = 5943896 (5.668540954589844MB)
52.762158711751304% used
在catalina.sh中JAVA_OPTS的選項(xiàng)。JAVA_OPTS="-Xms128m -Xmx512m -XX:MaxPermSize=256m"
主要有以下選項(xiàng):
[%T %B->%A(%C), %D]
%D: It is the duration of the collection in seconds.?
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。