How much slower is serving static content from Tomcat?

∥☆過路亽.° 提交于 2019-12-12 07:13:07

问题


So, I have a webapp with a fair amount of JSPs, servlets, alot of which are using IceFaces. Obviously, most of this will have to stay in Tomcat.

However, I've been told that static content (HTML, Images, etc.) is slower on Tomcat than a pure webserver like Apache. My understanding is that when you're using Tomcat as a stand-alone webserver, it's using a version of Apache in the first place. I may be mistaken on this, of course.

But what is the penalty for serving static images or files from Tomcat? Is it worth breaking out into its own webserver for a low volume site?


回答1:


See the Tomcat Connector FAQ for some information. For modern versions of Tomcat, the performance difference is much smaller than it used to be. For a low volume site, there is no reason that you cannot supply all content with Tomcat.




回答2:


I agree except in two circumstances

  1. Tomcat's SSL using JSSE is noticeably slower. There are native versions that can be plugged in, but that tends to be more painful. In general the SSL is a bit less straightforward than the well-understand Apache Httpd server

  2. Fronting with an HTTpd server gives more flexibility re virtual web hosts etc. Tomcat is not as flexible in this regard. Unsurprisingly it lacks all the options in Apache :). An obvious nice one is built in compression of static files is very easy to add in Apache. It's not hard in tomcat extra, but it's more work.

  3. You are mistaken. Apache Httpd Server is a totally different beast and has no code shared with Tomcat.

If neither is an issue, than yeah use tomcat by itself



来源:https://stackoverflow.com/questions/654701/how-much-slower-is-serving-static-content-from-tomcat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!