gpt4 book ai didi

Tomcat7 到 Tomcat8 性能下降(几乎 50%)

转载 作者:行者123 更新时间:2023-11-28 22:39:46 25 4
gpt4 key购买 nike

我在生产环境中将应用服务器从 tomcat7 升级到了 tomcat8。硬件配置与旧环境完全相同。

我看到平均响应时间增加了近 50%(从 204 毫秒到 ~450 毫秒)我查看了我们的 APM,我可以看到 tomcat8 应用服务器中的 JSP 处理时间增加了。

这里有人以前遇到过这个问题吗?如果是,请分享解决方案。

这里附上 tomcat7 和 tomcat8 关键交易明细。

我看到 JSP 处理时间在 tomcat8 上显着增加。

Tomcat7:

Tomcat7 Key transaction breakdown

Tomcat8: Tomcat8 Key transaction breakdown

最佳答案

最后我弄明白了:Apache Tomcat8 文档帮助我确定了问题。

Unified Expression Language 3.0 added support for referencing static fields and methods. Supporting this feature in JSPs required changing the javax.servlet.jsp.el.ScopedAttributeELResolver implementation so that it also checked identifiers to see if they were names of imported classes or fields. In some circumstances, this change triggers significant slow down. This affects identifiers that may refer to a page, request, session or application scoped variable or may be undefined. When undefined, it takes significantly longer to resolve the identifier since it is now also checked to see if it is an imported class or field. To avoid this slow down, code such as:

${undefined}

should be replaced with:

${requestScope.undefined}

or similar, using the appropriate scope for where the variable is defined.

这是完整的文档:https://tomcat.apache.org/migration-8.html#JavaServer_Pages_2.3

目前我将 tomcat 降级到版本 7,并开始与开发人员合作解决这个问题,希望下个月能升级回 tomcat8!

关于Tomcat7 到 Tomcat8 性能下降(几乎 50%),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46735453/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com