您好,登錄后才能下訂單哦!
適當的日志記錄和監控:日志和監控有助于分析和排錯。
是基于HTTP協議,支持HTTP1.1,它使tomcat服務器扮演一個獨立 服務器和JSP/servlet功能的服務器。
JAVA AJP是基于Apache JServ 協議的,該連接器常常是在你不想暴露自己的Java servlet容器到Internet.
Apache Portable Runtime(APR)是在擴容,性能和不同web服務器之間的兼容最好 的。它提供了比如OPENSSL,共享內存,Unix大套接字等。
線程沲定義了web服務器連接請求連接的數量,可以定義兩種線程沲:一是共享沲,二是專用沲。該配置在TOMCAT_HOME/conf/server.xml文件中定義的。
假如你配置了四個連接器,那么你可以共享使用這個線程沲。
配置如下:
<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" />
默認定義的最大線程沲是150個,在生產環境中,可以根據服務器的性能來調下該參數。
也相當于并發數一樣,默認值是1,也就是相當于關閉。
JMAP顯示共享JAVA虛擬機內存信息,對查看共享內存的狀態有用的。下面是一些常用選項:
Options Description
./jmap --heap <process id>
比如我們的JAVA的ID是4306,那么就執行./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的選項。JAVA_OPTS="-Xms128m -Xmx512m -XX:MaxPermSize=256m"
主要有以下選項:
[%T %B->%A(%C), %D]
%D: It is the duration of the collection in seconds.?
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。