+ All Categories
Home > Documents > Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley...

Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley...

Date post: 06-Jan-2018
Category:
Upload: joel-gibbs
View: 238 times
Download: 2 times
Share this document with a friend
Description:
Presentation Outline Tomcat on NetWare ® 6 Configuring Optimizing Deploying Managing Tomcat on NetWare 6.5 Configuring Optimizing Deploying Managing
36
Optimizing and Managing the Tomcat Servlet Container on NetWare® 6 Jeff Tulley Software Engineer, Novell, Inc. [email protected]
Transcript
Page 1: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.

Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare® 6

Jeff TulleySoftware Engineer, Novell, [email protected]

Page 2: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.

:

:

:

:

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

Page 3: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.

Presentation Outline

Tomcat on NetWare® 6

ConfiguringOptimizingDeployingManaging

Tomcat on NetWare 6.5ConfiguringOptimizingDeployingManaging

Page 4: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.

Tomcat on NetWare 6 Philosophy

For Management onlyNot tuned for performance

Not set up like typicalTomcat 3.x

Page 5: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.

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

Page 6: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.

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

Page 7: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.

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

Page 8: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.

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

Page 9: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.

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”

Page 10: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.

Apache 2 Tomcat / Catalina

4.1x

Ajp 13Port 9010

Apache / Tomcat intercommunication

Page 11: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.

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™

Page 12: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.

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

Page 13: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.

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.

Page 14: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.

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

Page 15: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.

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

Page 16: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.

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

Page 17: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.

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.

Page 18: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.

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

Page 19: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.

Managing

Management of Tomcat is done completely manually, through

configuration files

See the key files already pointed out in earlier slides.

Page 20: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.

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

Page 21: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.

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

Page 22: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.

Key Files:Sys:/adminsrv/conf/admin_tomcat.xml

Sys:/system/tcadmup.ncfSys:/system/tcadmdn.ncf

Same workers file

Configuring – Tomcat 4 Admin instance

Page 23: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.

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

Page 24: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.

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

Page 25: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.

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

Page 26: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.

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

Page 27: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.

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

Page 28: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.

Optimizing – server.xml parametersSame as with Tomcat 33, only the names have changedOn the <Connecter> tag, “CoyoteConnector”, there are the following:

minProcessors

maxProcessors

acceptCount

Page 29: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.

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

Page 30: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.

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

Page 31: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.

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

Page 32: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.

Managing - /tomcat/manager/html

Page 33: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.
Page 34: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.

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

Page 35: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.
Page 36: Configuring, Optimizing and Managing the Tomcat Servlet Container on NetWare ® 6 Jeff Tulley Software Engineer, Novell, Inc.

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.


Recommended