war 文件大小是否会以某种方式影响应用程序和/或应用程序服务器的性能?
我们一直在工作中遇到困难,有人建议我们应该减小 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这里有很多值得怀疑的事情:
应用程序的大小本身与任何类型的运行时性能无关。在应用程序的生命周期中加载的类的数量会对应用程序的内存使用产生影响,但这种影响非常微不足道。
在处理“性能问题”时,解决方案始终遵循相同的一般步骤:
There are many things to be suspicious of here:
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:
需要你告诉我们操作系统。
您有防病毒实时保护吗?
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.