Download presentation
Presentation is loading. Please wait.
Published byJoel Gibbs Modified over 9 years ago
1
Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc. jtulley@novell.com
2
: : : : Opening the door to Web services Novell exteNd ™ Securely getting the right information to the right people Novell Nsure ™ The best foundation for your mixed environment Novell Nterprise ™ The experience to solve your business problems Novell Ngage Novell Nterprise is an innovative family of products which give you the power to enable and manage the constant interaction of people with your business systems — regardless of who they are, where they are or what time of day it happens to be. Novell ® one Net vision SM
3
Presentation Outline Tomcat on NetWare ® 6 Configuring Optimizing Deploying Managing Tomcat on NetWare 6.5 Configuring Optimizing Deploying Managing
4
Tomcat on NetWare 6 Philosophy For Management only Not tuned for performance Not set up like typical Tomcat 3.x
5
Key Files: sys:/tomcat/33/bin/tomcat33.ncf sys:/tomcat/33/conf/nwserver.xml sys:/tomcat/33/conf/nwapps-(context).xml sys:/tomcat/33/conf/nwworkers.properties Configuration
6
Configuration – tomcat33.ncf Starts up tomcat, using nwserver.xml for configuration Defines classpath of Tomcat may need to be modified if the webapp contains native code Actual java command is here, so JVM tuning parameters go here also
7
Configuration – nwserver.xml Main configuration file for Tomcat 33 Departures from standard server.xml: Different ports Different application definition prefix (nwapps- as opposed to apps-) Ways it didn’t depart Auto deploy from tomcat/33/webapps –We should have changed this, in retrospect
8
Configuration – nwapps-(context).xml Anything starting with nwapps-, and followed by a context name, defines a context that is not auto deployed from sys:/tomcat/33/webapps For instance, nwapps-NSearch.xml Defines the context /NSearch Doc base is sys:/NSearch These files, or a WAR file in webapps, provide easiest way to run on Tomcat 33 on NetWare 6
9
Configuration – nwworkers.properties Key to the Apache / Tomcat interaction Configures Apache mod_jk.nlm, not Tomcat (Should have been put somewhere else probably) Ports in this file must be in sync with those in nwserver.xml Worker names here must be in sync with those in sys:/apache/conf/adminsrv.conf Default worker name is “ajp13”
10
Apache 2 Tomcat / Catalina 4.1x Ajp 13 Port 9010 Apache / Tomcat intercommunication
11
Optimizing Tomcat on NetWare 6 was not optimized for heavy usage, since it was targeted for management only Tuning is necessary for dedicated Servlet Container usage, for instance with NSearch NPS OnDemand ™
12
Optimizing – philosophy Key point to remember when tuning Tomcat - every application requires different tuning parameters, there is no “one size fits all” If your server is dedicated to one application, this makes tuning easier If your server has one type of usage pattern, tuning is easier also Like database tuning, this is partly an art, with tradeoffs involved
13
Optimizing – nwserver.xml parameters The main parameters that must be tuned are found in nwserver.xml, in the tag maxThreads maxSpareThreads MinSpareThreads The SpareThreads settings determine how many threads are kept alive while the system is idle (not under heavy load) Ideal number of threads must be analyzed against memory usage, processing activity of your application, etc.
14
Optimizing – memory settings Tomcat33.ncf does not set a maximum heap size Default JVM 1.3 max heap is 64MB Default JVM 1.4 max heap is 128MB Your applications needs may be way more than either of these defaults To determine your application’s needs: Add “-Xmx400m” to beginning of java command Load test your application for a while Java –showmemory(id) on tomcat process Set the max to a value higher than committed heap
15
Optimizing – more memory settings NLMS have a limit of about 400 MB allocation size Setting the –X flag above that may result in an invalid allocation, giving you only the 64 MB default If you need more than this much memory: Use the server –u option –TID # 10072708 –Set the value at (total memory – OS memory requirements), in bytes Use multiple tomcat instances
16
Optimizing – multiple tomcats Create your own ncf files, starting up Tomcat with separate server.xml files Each listens on a separate AJP port There is a worker in nwworkers.properties corresponding to each tomcat instance Each of these workers is in the worker.loadbalancer.balanced_workers list Apache will send requests to these workers in a weighted round-robin manner, with sticky sessions
17
Optimizing – outside of Tomcat Upgrade to JVM 1.4 Upgrade Apache to Apache 2.0 Apache 2.0 has more caching capabilities Then you can set the cachesize parameter on each worker (in nwworkers.properties) Set it to the same as the number of Apache threads Make sure Apache is serving your static content –In a “purely dynamic” application you still have static image files, sometimes downloadable files, etc.
18
Deploying – techniques Three methods to deploy to Tomcat 33 Place a WAR file in sys:/tomcat/33/webapps –Tomcat automatically explodes it on first execution Explode WAR into sys:/tomcat/33/webapps Place your exploded WAR wherever, define its context name and location in conf/nwapps- (context).xml It’s that simple
19
Managing Management of Tomcat is done completely manually, through configuration files See the key files already pointed out in earlier slides.
20
Tomcat 4 on NetWare Philosophy We realized that “only for management” didn’t coincide with reality New philosophy: “separate management”, out of the way of the default Tomcat instance Default Tomcat instance has as few changes as necessary Internal Novell applications (non-admin) play in the same world as 3 rd party applications
21
Configuring – Tomcat 4 User Instance Key Files: sys:/tomcat/4/bin/tomcat4.ncf sys:/tomcat/4/bin/tc4stop.nc sys:/tomcat/4/bin/catalina.pl sys:/tomcat/4/bin/startup.ncf sys:/tomcat/4/conf/server.xml sys:/apache2/conf/mod_jk/workers.properties
22
Key Files: Sys:/adminsrv/conf/admin_tomcat.xml Sys:/system/tcadmup.ncf Sys:/system/tcadmdn.ncf Same workers file Configuring – Tomcat 4 Admin instance
23
Configuring – Startup/Shutdown Scripts tomcat4.ncf, tc4stop.ncf: Start and stop the user instance, respectively startup.ncf: Calls into catalina.pl, taking care of some “NetWareisms” of starting up (startup dir) catalina.pl: Has all of the smarts. Akin to catalina.bat Allowed some functionality not available in NCFs
24
Configuring – Server.xml As much as is possible, server.xml is identical to the server.xml downloaded from jakarta.apache.org We had to change the following items: AJP port change to 9010 (conflict with NetWare Remote Manager port, 8009) We disabled the “UserDatabaseRealm”, instead using the “JNDIRealm” for authentication/ authorization against Novell eDirectory ™. (more on this later) Commented out port 8080, the internal HTTP stack
25
Configuring – workers.properties Content has not changed much, just the file location Makes more sense in apache directory Default worker name is the same as the NetWare 6 Tomcat 33 worker (ajp13) Separate worker for admin instance (ajp13_admin) Ports should not conflict with those used on NetWare 6, so Tomcat 4 could work there equally well
26
Configuring – Admin Instance Files tcadmup.ncf, tcadmup.ncf: Start and stop the admin instance, respectively Admin_tomcat.xml: Configuration of an instance of Tomcat 4, with separate ajp ports, also using the JNDIRealm for security, auto-deploying out of sys:/adminsrv/webapps You shouldn’t have to change these files
27
Optimizing Tomcat 4 IS optimized a bit right out of the box Max and min threads are set Memory is optimized a bit (some maximums are set) Workers cachesize property is set Apache 2 is already in place giving static files speedup
28
Optimizing – server.xml parameters Same as with Tomcat 33, only the names have changed On the tag, “CoyoteConnector”, there are the following: minProcessorsmaxProcessorsacceptCount
29
Optimizing – multiple tomcats Create your own ncf files, starting up Tomcat with separate server.xml files Each listens on a separate AJP port There is a worker in nwworkers.properties corresponding to each tomcat instance Each of these workers is in the worker.loadbalancer.balanced_workers list Apache will send requests to these workers in a weighted round-robin manner, with sticky sessions
30
Deploying – techniques 1 2 3 Three methods to deploy to Tomcat 4 Place a WAR file in sys:/tomcat/4/webapps Tomcat automatically explodes it on first execution Explode WAR into sys:/tomcat/4/webapps Place your exploded WAR wherever, define its context name and location in webapps/ (context).xml These are identical to Tomcat 33, except last item
31
Managing New to Tomcat 4 are the admin and manager apps –/tomcat/admin/ –Ability to manage separate pieces of server.xml in a web-based fashion –/tomcat/manager/ –Allows you to manage contexts’ life-cycles »Start »Stop »Restart
32
Managing - /tomcat/manager/html
34
Debugging Java Platform Debugger Architecture is new to JVM 1.4 on NetWare tc4jpda.ncf - starts up Tomcat in debug mode, communicating over socket 9070 You can use all standard socket-based JPDA debuggers Chances are your favorite java editor supports this
36
Unpublished Work of Novell, Inc. All Rights Reserved. This work is an unpublished work and contains confidential, proprietary, and trade secret information of Novell, Inc. Access to this work is restricted to Novell employees who have a need to know to perform tasks within the scope of their assignments. No part of this work may be practiced, performed, copied, distributed, revised, modified, translated, abridged, condensed, expanded, collected, or adapted without the prior written consent of Novell, Inc. Any use or exploitation of this work without authorization could subject the perpetrator to criminal and civil liability. General Disclaimer This document is not to be construed as a promise by any participating company to develop, deliver, or market a product. Novell, Inc., makes no representations or warranties with respect to the contents of this document, and specifically disclaims any express or implied warranties of merchantability or fitness for any particular purpose. Further, Novell, Inc., reserves the right to revise this document and to make changes to its content, at any time, without obligation to notify any person or entity of such revisions or changes. All Novell marks referenced in this presentation are trademarks or registered trademarks of Novell, Inc. in the United States and other countries. All third-party trademarks are the property of their respective owners.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.