【发布时间】:2018-02-28 15:17:30
【问题描述】:
我是 JavaMelody 和基准测试的新手。我正在使用JavaMelody 在https://dzone.com/articles/a-step-by-step-guide-to-tomcat-performance-monitor 之后在tomcat 中监控我的Jersey 应用程序。
我的应用程序设置: docker-compose 设置的 4 个 docker 容器:myapplication (tomcat, jersey application), 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 是否意味着 my 应用程序使用了 所有 8 个核心 CPU 资源的 93.36%?
我使用docker stats <docker id> 并得到CPU % 我的应用程序大约是336%。我很困惑。
3、system load是什么意思?
4、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)?
谢谢。
【问题讨论】:
标签: java tomcat docker apachebench java-melody