搬到球衣后性能下降2 [英] Performance degradation after moving to jersey 2

查看:141
本文介绍了搬到球衣后性能下降2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用弹簧4,嵌入式码头9和平针织物在服务器上工作。最近,我们搬到了球衣2.13,我们发现性能有所下降。我使用YourKit进行了一些调查。我看到在球衣的反射中有大量的CPU使用率。此外,Yourkit快照中有许多 NoSuchMethodExceptions ClassNotFoundExceptions

We're working on a server using spring 4, embedded jetty 9 and jersey. Recently, we moved to jersey 2.13 and we noticed a degradation in performance. I performed some investigations using YourKit. I saw that there is a massive CPU usage in reflection done by jersey. Also, there are many NoSuchMethodExceptions and ClassNotFoundExceptions in Yourkit snapshot.

是否有任何球衣配置或最佳做法,以避免这个问题,或优化球衣?或者它可能是球衣2中的一个已知问题?

Are there any jersey configuration or a best practice to avoid this issue, or to optimize jersey? Or maybe it is a known issue in jersey 2?

以下是来自YourKit的两个截图,显示了排除套接字读取后的热点( java.net.SocketInputStream.socketRead0 )。第一个是Merged Callees:

Here are two screenshots from YourKit, showing the hot-spots, after excluding the socket read (java.net.SocketInputStream.socketRead0). The first one is with Merged Callees:

第二个是Back Trace:

And the second one is with Back Trace:

谢谢。

推荐答案

通过查看您的问题,我无法指出确切的问题。但我可以建议您检查以下内容:

By looking at your question I can not pin point the exact issue. But I can suggest you to check the following things:


  1. 检查最终版本中是否存在任何具有不同版本的库/副本

  2. 检查您的最终版本中是否推荐了Spring / jersey传递依赖/ jar版本

如果你使用maven来构建你的项目,那么我建议使用maven依赖树插件检查上面提到的点。

If you are using maven to build your project, then I suggest using the maven dependency tree plugin to check the above mentioned points.

-
Chiru

- Chiru

这篇关于搬到球衣后性能下降2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆