war 文件大小是否会以某种方式影响应用程序和/或应用程序服务器的性能?

发布于 2024-09-10 17:18:57 字数 257 浏览 9 评论 0原文

我们一直在工作中遇到困难,有人建议我们应该减小 war 文件的大小,特别是 WEB-INF/lib 目录的大小,以提高生产 JBoss 实例的性能。有件事我至今仍心存疑虑。

我们的应用程序服务器中部署了大约 15 个 Web 应用程序,每个应用程序的大小约为 15 到 20 MB。

我知道这涉及很多变数,但是你们中有人真正处理过这种情况吗?一般来说,.war 文件大小实际上对 Web 容器有重大影响吗?

您能提供什么建议?

感谢你。

we've bean struggling here at work by somebody suggestion that we should decrease the size of our war file, specifically the WEB-INF/lib directory size, in order to improve our production JBoss instance performance. Something I'm still suspicious about.

We have around 15 web apps deploy in our application server, each about 15 to 20 MB in size.

I know there are a lot of variables involved on this, but has anyone of you actually deal with this situation? Does the .war files size actually has a significant impact on web containers in general?

What advice can you offer?

Thank U.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

寄风 2024-09-17 17:18:57

这里有很多值得怀疑的事情:

  • 应用程序没有达到您想要的水平怎么办?
  • 您是否测量过应用程序以找出哪些组件导致性能不足?
  • 应用程序/系统的瓶颈是什么?

应用程序的大小本身与任何类型的运行时性能无关。在应用程序的生命周期中加载的类的数量会对应用程序的内存使用产生影响,但这种影响非常微不足道。

在处理“性能问题”时,解决方案始终遵循相同的一般步骤:

  • 当我们说“性能不佳”时,这意味着什么?
  • 具体是什么没有表现?测量,测量,测量。
  • 我们能否改进未达到我们想要的水平的特定组件?
  • 如果是这样,请实施这些想法,再次衡量,看看绩效是否真正得到改善。

There are many things to be suspicious of here:

  • What about the application is not performing to the level you would like?
  • Have you measured the application to find out which components are causing the lack of performance?
  • What are the bottlenecks in the application/system?

The size of the application alone has nothing to do with any sort of runtime performance. The number of classes loaded during the lifetime of the application has an impact on memory usage of the application, but an incredibly negligible one.

When dealing with "performance issues", the solution always follows the same general steps:

  • What does it mean when we say "bad performance"?
  • What specifically is not performing? Measure, measure, measure.
  • Can we improve the specific component not performing to the level we want?
  • If so, implement the ideas, measure again to find out if performance has truly improved.
云仙小弟 2024-09-17 17:18:57

需要你告诉我们操作系统。
您有防病毒实时保护吗?

war/jar 文件实际上是一个 zip 文件 - 即,如果将 .war 重命名为 .zip,则可以使用 zip 实用程序来查看/解压缩它。

在部署过程中,war 文件会被解压到指定文件夹中。如果您有实时保护,防病毒实用程序可能需要一些时间来扫描创建的新目录分支并减慢对它们的访问速度。

许多 Web 应用程序框架(例如 JSP)会创建临时文件,并且您的实时保护将采取行动来扫描它们。

如果这是您的情况,您必须决定是否希望将您的网络应用程序排除在防病毒实时扫描之外。

您是否正在运行 Linux,但您的 Web 目录是使用 ntfs-3g 访问的?如果是,检查ntfs目录是否被压缩。 ntfs-3g 在访问压缩的 ntfs 文件时存在问题,尤其是在同时操作/创建/解压缩多个文件时。首先,除非有一些极其合理的原因(我看不到任何原因),否则 Web 应用程序目录应该是 Linux 原生格式的本地分区。

使用wireshark 监控网络活动。查明网络应用程序是否导致对远程文件系统的访问。查看每当网络应用程序处于活动状态时是否有太多重新传输。过多的重传或请求重传意味着网络管道存在完整性问题。我仍在尝试自己理解这个问题 - 某些网卡在 Linux 中运行时存在缓冲问题(就像缓冲区溢出),但在 Windows 中则不然。

只要您了解 IP 地址,Wireshark 并不难使用,并且您可能希望编写 awk、perl 或 python 脚本来分析流量。就我个人而言,我会使用 SAS。

Need you to tell us the operating system.
Do you have antivirus live protection?

A war/jar file is actually a zip file - i.e., if you renamed a .war to a .zip, you can use a zip utility to view/unzip it.

During deployment, the war file is unzipped once into a designated folder. If you have live-protection, the antivirus utility might take some time to scan the new branch of directories created and slow down any access to them.

Many web app frameworks, like JSPs, create temporary files and your live-protection would get into action to scan them.

If this is your situation, you have to decide whether you wish to exclude your web-app from antivirus live-scanning.

Are you running Linux but your web directory is accessed using ntfs-3g? If so, check if the ntfs directory is compressed. ntfs-3g has problems accessing compressed ntfs files especially when multiple files are manipulated/created/uncompressed simultaneously. In the first place, unless there are some extremely valid reasons (which I can't see any), a web app directory should be a local partition in a format native to Linux.

Use wireshark to monitor the network activity. Find out if web apps are causing accesses to remote file systems. See if there are too many retransmits whenever the web apps are active. Excessive retransmits or requests for retransmits means the network pipeline has integrity problems. I am still trying to understand this issue myself - some network cards have buffering problems (as though buffer overflow) operating in Linux but not in Windows.

Wireshark is not difficult to use as long as you have an understanding of ip addresses, and you might wish to write awk, perl or python scripts to analyze the traffic. Personally, I would use SAS.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文