Tomcat AWS CPU 利用率高于预期

Tomcat AWS CPU 利用率高于预期

我最近接到一个项目,将一个 Java 应用程序迁移到 AWS,这个应用程序托管在 Tomcat 上,我们 3-4 年前编写的,一直在客户数据中心运行。目前,我们正在进行负载测试,大约有 20% 的流量流向 AWS,每分钟大约有 800 个请求,其中大部分是心跳请求,我认为这是较低的流量。在这种流量下,我们看到 3 个 T2.Larges 的平均 CPU 利用率为 30%。

我的问题是,您是否认为这是正常的 CPU 利用率?我们的响应时间平均为 150-200 毫秒,但我会牺牲一点时间来降低我们的 CPU 利用率。

我正在使用 NIO 连接器,除了 SSL 相关内容之外,我对其的唯一配置是将最大线程设置为 150。

Tomcat 启动信息

Server version:        Apache Tomcat/8.5.30
Server built:          Apr 3 2018 20:04:09 UTC
Server number:         8.5.30.0
OS Name:               Linux
OS Version:            3.10.0-862.el7.x86_64
Architecture:          amd64
Java Home:             /usr/java/jdk1.8.0_172-amd64/jre
JVM Version:           1.8.0_172-b11
JVM Vendor:            Oracle Corporation
CATALINA_BASE:         /opt/tomcat
CATALINA_HOME:         /opt/tomcat
Command line argument: -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties
Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
Command line argument: -javaagent:/opt/tomcat/newrelic/newrelic.jar
Command line argument: -Dnewrelic.environment=prod
Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
Command line argument: -Xms2048M
Command line argument: -Xmx2048M
Command line argument: -XX:+UseParallelGC
Command line argument: -Xms4096M
Command line argument: -Xmx4096M
Command line argument: -Djava.net.preferIPv4Stack=true
Command line argument: -Dspring.profiles.active=prod
Command line argument: -Dignore.endorsed.dirs=
Command line argument: -Dcatalina.base=/opt/tomcat
Command line argument: -Dcatalina.home=/opt/tomcat
Command line argument: -Djava.io.tmpdir=/opt/tomcat/temp

相关内容