GuidesIntegrating/Improving Performances of Tomcat and IIS on Windows Server

Integrating/Improving Performances of Tomcat and IIS on Windows Server

Developer.com content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.

IIS is Microsoft’s Internet Information Server running on the Windows Servers family. Tomcat is a worldwide-used Web server built on the Java platform for JSP/Servlets. Due to the ease of operating and maintaining IIS in a Windows environment, we still prefer to buy the Windows server and run IIS for web sites and, by default, we run Tomcat on port 8080 as the default installation.

Two Web Servers, Two Ports

No two applications can start a server on the same port, so IIS and Tomcat both operate on different ports. According to preference, we give a default port to one of the servers. Usually, we keep IIS as it is and keep Tomcat running on port 8080. This way, whenever we want to refer to a JSP page, we have to put 8080 in the URL (Web addresses). This is not a good software design because it involves some hard coding of addresses and any change in future leads to modification in source files.

Software Design: Different Hard-Coded Addresses

To access the Tomcat application, we specify the 8080 port, but when we have multiple portals and applications running on the server and we want to integrate all under one Web site, hard coding becomes a big issue. It’s a poor software design. If someone forgets to specify the port 8080, then:

  1. The page cannot be found by the IIS server.
  2. IIS may give the source code of the JSP file for download.

Performance of Tomcat and IIS

Because IIS is built on native code, the execution of delivery of Web contents is faster than in Tomcat. Tomcat is built on the Java Virtual Machine, which makes it slow. For static Web content such as images and static HTML files, Tomcat still delivers it slower then IIS. IIS delivers static Web contents faster with HTTP Compression and HTTP Keep Alives and with content caching.

SSL

Setting up SSL on Tomcat is again a big, lengthy task because no better user interface exists as it exists for IIS. IIS is better than Tomcat from the view point of the user’s GUI. After setting up SSL on Tomcat, for every HTTPS connections, Tomcat runs very, very slow and puts a huge load on the system as it runs on Java Virtual Machine. Faster machines are available on the market, but still, when too many users visit your Web site, crashing of the server is very frequent.

Control of Processor Usage and Bandwidth Usage

IIS gives better control over processor usage and bandwidth usage per Web site. You can configure and tune every Web site in IIS to control the processor usage and bandwidth used by Web site. So, even if on one Web site you have huge request traffic coming in, another Web site still serves; they do not crash down. Tomcat doesn’t offer this feature.

To overcome problems discussed above, we have found the better solution that takes care of all problems and works as win-win situation for IIS and Tomcat.

Delegation of Responsibilities

We require Tomcat only to execute Servlets and JSP files. IIS can Deliver Static Contents fast, IIS executes HTTPS (SSL) faster then Tomcat, IIS offers HTTP Keep Alive, IIS can do content caching and HTTP Compression.

How to Achieve the Above Solution

For Single Host:

  1. Create a Web site in IIS, point it to ROOT directory of WebApps folder, and for every other folder in WebApps, create a virtual directory under this Web site.
  2. Use the JspISAPI filter to proxy the JSP requests to Tomcat. Detailed configuration information is given on the Web site.

For Many Virtual Hosts:

  1. Create Web sites for every virtual host existing in the Server.xml file, and point every Web site to the ROOT of every virtual host.
  2. Use the JspISAPI filter to proxy the JSP requests to Tomcat. Detailed configuration information is given on the Web site.

Benefits:

After applying this ISAPI filter on IIS, you get following benefits:

  1. You don’t need to specify 8080 in your addresses; it helps in improved software design.
  2. IIS delivers static contents faster then Tomcat, thus saving your processor usage for other Web sites and processes.
  3. You can control bandwidth and process of Web sites having JSP/servlets.
  4. This IIS ISAPI DLL makes Tomcat transparent to the user.
  5. You can configure SSL easily on IIS. There is no need to do any changes on Tomcat; just block port 8080 on your firewall.
  6. Execution of HTTPS sessions of JSP is faster through IIS rather than on Tomcat.
  7. IIS, by default, offers HTTP Keep Alives, improving the performance.
  8. IIS also offers HTTP Compression and various modes of caching and content expiration.

About the Author

To find more about Akash Kava, please visit http://www.akashkava.com.

Disclaimer

This article is provided in view of improving performances Tomcat and IIS for all Web server administrators. If anyone misuses this article or if anyone loses important data, I am not responsible for it. Please read and implement this article at your own risk.

Copyright Notice

NeuroSpeech Technologies reserves all rights to this article. This article can be distributed as electronic media or published to magazines provided no single word is modified or deleted. NeuroSpeech Technologies owns this article and in every publication of this article, this copyright notice must exist at the bottom.

Copyright © 2003 by NeuroSpeech Technologies

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Latest Posts

Related Stories