Date post: | 06-Jan-2018 |
Category: |
Documents |
Upload: | joel-gibbs |
View: | 238 times |
Download: | 2 times |
Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare® 6
Jeff TulleySoftware Engineer, Novell, [email protected]
:
:
:
:
Opening the door to Web servicesNovell 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
Presentation Outline
Tomcat on NetWare® 6
ConfiguringOptimizingDeployingManaging
Tomcat on NetWare 6.5ConfiguringOptimizingDeployingManaging
Tomcat on NetWare 6 Philosophy
For Management onlyNot tuned for performance
Not set up like typicalTomcat 3.x
Key Files:sys:/tomcat/33/bin/tomcat33.ncf
sys:/tomcat/33/conf/nwserver.xmlsys:/tomcat/33/conf/nwapps-(context).xmlsys:/tomcat/33/conf/nwworkers.properties
Configuration
Configuration – tomcat33.ncf
Starts up tomcat, using nwserver.xml for configurationDefines classpath of Tomcat• may need to be modified if the webapp
contains native codeActual java command is here, so JVM tuning parameters go here also
Configuration – nwserver.xml
Main configuration file for Tomcat 33Departures 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
Configuration – nwapps-(context).xmlAnything starting with nwapps-, and followed by a context name, defines a context that is not auto deployed from sys:/tomcat/33/webappsFor instance, nwapps-NSearch.xmlDefines the context /NSearch
• Doc base is sys:/NSearchThese files, or a WAR file in webapps, provide easiest way to run on Tomcat 33 on NetWare 6
Configuration – nwworkers.propertiesKey to the Apache / Tomcat interactionConfigures 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.xmlWorker names here must be in sync with those in sys:/apache/conf/adminsrv.confDefault worker name is “ajp13”
Apache 2 Tomcat / Catalina
4.1x
Ajp 13Port 9010
Apache / Tomcat intercommunication
Optimizing
Tomcat on NetWare 6 was not optimized for heavy usage, since it was targeted for management onlyTuning is necessary for dedicated Servlet Container usage, for instance with
NSearch NPS OnDemand™
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 easierIf your server has one type of usage pattern, tuning is easier alsoLike database tuning, this is partly an art, with tradeoffs involved
Optimizing – nwserver.xml parametersThe main parameters that must be tuned are found in nwserver.xml, in the <RequestInterceptor> 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.
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 defaultsTo 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
Optimizing – more memory settingsNLMS have a limit of about 400 MB allocation sizeSetting the –X flag above that may result in an invalid allocation, giving you only the 64 MB defaultIf 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
Optimizing – multiple tomcats
Create your own ncf files, starting up Tomcat with separate server.xml filesEach listens on a separate AJP portThere is a worker in nwworkers.properties corresponding to each tomcat instanceEach of these workers is in the worker.loadbalancer.balanced_workers listApache will send requests to these workers in a weighted round-robin manner, with sticky sessions
Optimizing – outside of Tomcat
Upgrade to JVM 1.4Upgrade 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.
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
Managing
Management of Tomcat is done completely manually, through
configuration files
See the key files already pointed out in earlier slides.
Tomcat 4 on NetWare Philosophy
We realized that “only for management” didn’t coincide with realityNew philosophy: “separate management”, out of the way of the default Tomcat instanceDefault Tomcat instance has as few changes as necessaryInternal Novell applications (non-admin) play in the same world as 3rd party applications
Configuring – Tomcat 4 User Instance
Key Files:sys:/tomcat/4/bin/tomcat4.ncfsys:/tomcat/4/bin/tc4stop.ncsys:/tomcat/4/bin/catalina.plsys:/tomcat/4/bin/startup.ncfsys:/tomcat/4/conf/server.xml
sys:/apache2/conf/mod_jk/workers.properties
Key Files:Sys:/adminsrv/conf/admin_tomcat.xml
Sys:/system/tcadmup.ncfSys:/system/tcadmdn.ncf
Same workers file
Configuring – Tomcat 4 Admin instance
Configuring – Startup/Shutdown Scriptstomcat4.ncf, tc4stop.ncf:
• Start and stop the user instance, respectivelystartup.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
Configuring – Server.xml
As much as is possible, server.xml is identical to the server.xml downloaded from jakarta.apache.orgWe 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
Configuring – workers.properties
Content has not changed much, just the file locationMakes more sense in apache directoryDefault 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
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
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
Optimizing – server.xml parametersSame as with Tomcat 33, only the names have changedOn the <Connecter> tag, “CoyoteConnector”, there are the following:
minProcessors
maxProcessors
acceptCount
Optimizing – multiple tomcats
Create your own ncf files, starting up Tomcat with separate server.xml filesEach listens on a separate AJP portThere is a worker in nwworkers.properties corresponding to each tomcat instanceEach of these workers is in the worker.loadbalancer.balanced_workers listApache will send requests to these workers in a weighted round-robin manner, with sticky sessions
Deploying – techniques
1
2
3
Three methods to deploy to Tomcat 4Place a WAR file in sys:/tomcat/4/webapps
• Tomcat automatically explodes it on first executionExplode WAR into sys:/tomcat/4/webappsPlace your exploded WAR wherever, define its context name and location in webapps/ (context).xml
These are identical to Tomcat 33, except last item
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
Managing - /tomcat/manager/html
Debugging
Java Platform Debugger Architecture is new to JVM 1.4 on NetWaretc4jpda.ncf - starts up Tomcat in debug mode, communicating over socket 9070You can use all standard socket-based JPDA debuggers
• Chances are your favorite java editor supports this
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 DisclaimerThis 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.