Home > AS/400 Tips > WebSphere Strategies for iSeries professionals > Optimizing Tomcat for Web applications
iSeries 400 Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

WEBSPHERE STRATEGIES FOR ISERIES PROFESSIONALS

Optimizing Tomcat for Web applications


Paul Holm
08.19.2004
Rating: -4.00- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



[IMAGE]
[IMAGE][IMAGE]
Paul Holm [IMAGE]
[IMAGE]
WebSphere has gained significant market share in Web application development space. But there's a powerful, easy-to-use and free alternative to WebSphere -- Apache's Tomcat. Tomcat is open source and is the reference implementation for Sun Microsystems' servlet standard. Tomcat has proven itself as production quality and is used by many companies. Tomcat installation on Windows servers is an automated and easy process; however, the default installation places Tomcat into development mode. The advantage of development mode is that changes to JSPs, class, and JAR files are automatically incorporated at runtime without the need to restart the application server. The drawback is that performance suffers in development mode. Once an application is ready for production, the following steps should be taken to optimize Tomcat. More Information


[IMAGE]

1. Increase the maximum memory available:

Tomcat ships with the maximum amount of memory set to 64MB, which is not large enough to operate most large web applications. We recommend increasing the maximum amount of memory to 80% of the total RAM available on your server. This can be done as shown below. First, open Tomcat by going to the Start Menu-Programs-Apache Tomcat-Start Tomcat.

[IMAGE]
Aft...

Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Application Development
iSeries calling an .exe
Top 10 programmer tips
Formatted work job scheduler
Convert system date and time
Mixing free format code with embedded SQL
SQL update a field in one file from a field in another file
Webcasts for iSeries programmers
Programming advice from the pros
Easy code copying via the drag and drop method
Setting FTP time-outs

WebSphere Strategies for iSeries professionals
Application modernization strategies for System i
Application modernization in the i world
Natively supported Web applications for Power running i
Enterprise open source basics
Basic security considerations for a Domino/WebSphere system
Simplifying data access using Java Standard Tag Library
Integrating Microsoft ActiveX components with WebSphere
Choices for running Web workloads on iSeries
Virtual hosting for iSeries Web applications
Automate WebSphere configuration backups on the iSeries (i5)

Web
Leverage IBM's Enterprise Identity Mapping (EIM)
Build Web apps using free utility -- WOW!
Q&A: Pluta touts benefits of RPG over Java
Make your database easy to read
Take their money and run: Processing Internet credit card payments with Java, WebSphere
Three tips for using WebFacing
WebFacing v5.1.2 may save a lot of money
Get the lowdown on Eclipse and WebSphere, including pros and cons
Insourcing beyond outsourcing
Building dynamic JDBC components and utilities

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


er Tomcat has started you should see the Tomcat icon in the lower right-hand corner, as shown below. [IMAGE]
To access the Tomcat properties allowing changes to the maximum memory, right click on the icon and select properties. This is also the way to stop the server by clicking on Shutdown: Tomcat instead of properties. [IMAGE]
The properties screen below has the Java VM tab selected. Inside the Java Options is where we are going to add some information by going to add the increased min and max memory allocation. [IMAGE]
The minimum value can be anything but should start with at least 64-100 MB. The maximum memory should be up to 80% of your computer's RAM. For example, if you have 512 MB of RAM, then you should set the maximum memory to around 400 MB. We are also going to add a server tag that basically tells the compiler that when it's running, it is running as a server. It changes its optimization strategy of the just-in-time compiler. To do this, you need to add this code to the Java Options text area: [IMAGE]
Now we have changed the default memory allocation for Tomcat to handle heavier data loads. However, there are still a few more changes we can make to improve speed and efficiency.

Changes to web.xml configuration file:

The web.xml is the document that defines default values for *all* Web applications loaded into each instance of Tomcat. As each application is deployed, this file is processed, followed by the "/WEB-INF/web.xml" deployment descriptor from your own applications. The web.xml is located in Apache Software Foundation-Tomcat-conf folder shown below. [IMAGE]
Open the web.xml by right clicking and selecting open with (NotePad, Wordpad or any text editor). Now, in the document we want to find the JSP Servlet Tag. This is located a quarter of the way down the page. Add two initial parameters -- the reloading parameter and the development parameter. [IMAGE]
The reloading and development parameters are automatically set to true when Tomcat is installed. The development init-parameter will check for JSP modification on every access and reload. Set both of these parameters in the web.xml document to false so Tomcat will not look for or reload changes to JSPs on every access. [IMAGE]
To add the init-parameters you will add this code: In summary, Tomcat is a cost-efficient tool to hosting Web applications. Now that you have made the above simple changes, Tomcat will run much faster and handle more of a data load, allowing increased performance of the development of your Web application. Tomcat also has its own administration, which can be helpful and accessed through the Tomcat Web site.

---------------------------
About the author: Paul Holm is a former IBM-Rochester WebSphere, Java, and DB2 developer/consultant. He specializes in helping iSeries RPG shops develop Web-based applications. Paul is currently a lead architect for the "WOW" product, which is Query/400 and DFU for WebSphere (aka WebSphere on steriods). Paul can be reached at pholm@planetjavainc.com.


Rate this Tip
To rate tips, you must be a member of Search400.com.
Register now to start rating these tips. Log in if you are already a member.




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



iSeries Security - Security Tools, Physical Security and System Security
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts