我是 JavaMelody 和基准测试的新手。我正在使用JavaMelody在https://dzone.com/articles/a-step-by-step-guide-to-tomcat-performance-monitor之后在 tomcat 中监控我的 Jersey 应用程序。
我的应用程序设置:docker-compose 设置的 4 个 docker 容器:myapplication(tomcat、jersey 应用程序)、kafka、postgres、zookeeper。
我从 javaMelody 监控页面获得了以下详细信息:
Host: 16a180e86bba@172.18.0.5
Java memory used: 784 Mb / 7,124 Mb ++++++++++++
Nb of http sessions: 0
Nb of active threads
(current http requests): 9
Nb of active jdbc connections: 0
Nb of used jdbc connections
(opened if no datasource): 0
System load 27.89
% System CPU 93.36 ++++++++++++
##############
# Details
##############
OS: OS Linux, 4.11.0-32-generic , amd64/64 (8 cores)
Java: OpenJDK Runtime Environment, 1.8.0
JVM: OpenJDK 64-Bit Server VM
PID of process: 1
Nb of opened files 418 / 1,048,576 ++++++++++++
Server: Server Apache Tomcat/8.0.50
Webapp context: /event-bus
Start: 2/28/18 2:47 PM
JVM arguments: -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djdk.tls.ephemeralDHKeySize=2048
-Djava.protocol.handler.pkgs=org.apache.catalina.webresources
-Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9999
-Dignore.endorsed.dirs=
-Dcatalina.base=/usr/local/tomcat
-Dcatalina.home=/usr/local/tomcat
-Djava.io.tmpdir=/usr/local/tomcat/temp
Mean age of http sessions (min): -1
Tomcat "http-apr-8080": Busy threads = 17 / 200 ++++++++++++
Bytes received = 65,071,259
Bytes sent = 4,411,314
Request count = 538,335
Error count = 19,253
Sum of processing times (ms) = 17,998,558
Max processing time (ms) = 3,161
Memory: Non heap memory = 99 Mb (Perm Gen, Code Cache),
Buffered memory = 33 Mb,
Loaded classes = 9,535,
Garbage collection time = 1,420 ms,
Process cpu time = 854,410 ms,
Committed virtual memory = 14,718 Mb,
Free physical memory = 21,865 Mb,
Total physical memory = 32,052 Mb,
Free swap space = 32,651 Mb,
Total swap space = 32,651 Mb
Free disk space: 408,262 Mb
Dependencies: Dependencies Dependencies View Maven's pom View Maven's pom
Threads Threads
Threads on 16a180e86bba@172.18.0.5: Number = 624, Maximum = 681, Total started = 1,182
我有一些问题:
1,我设置了 4 个 docker 容器,tomcat 正在其中一个中运行。JavaMelody 是否会给出关于我的应用程序的 CPU 和内存使用情况的准确结果,或者只是 docker 容器?
2,我的机器有 8 个核心,是否% System CPU 93.36
意味着我的应用程序使用了所有 8 个核心 CPU 资源的 93.36%?我使用docker stats <docker id>
并获得CPU %
了我的应用程序大约 336%。我很困惑。
3、什么system load
意思?
4、in 是什么7124 Mb
意思Java memory used: 784 Mb / 7,124 Mb ++++++++++++
?
5,在Tomcat "http-apr-8080": Busy threads = 17 / 200 ++++++++++++
和Threads on 16a180e86bba@172.18.0.5: Number = 624, Maximum = 681, Total started = 1,182
。
是否17/200
意味着接受连接的最大线程数为 200,但仅使用了 17 个。但这是什么Number = 624, Maximum = 681, Total started = 1,182
意思?
6、我用ab 200并发发送20000个请求。但为什么只17/200
用过?如何制作200/200
?
7,从 ab 的报告中,我发现 1.3% 的请求失败。这是否意味着我在 ab 测试中设置了太多并发?或者这是否意味着 tomcat 无法处理所有请求(但在 tomcat 中只使用了 17/200)?
谢谢。