[ start | index | login ]

Tomcat

Created by mpecher. Last edited by mpecher, 165 days ago. Viewed 1,254 times. #10
[diff] [history] [edit] [rdf]
labels
attachments
tomcat (971)

Tomcat configuration

See configuration for detail description (and prod example).
See jasper-prod for details on configuration of JSP/Japser for producation.

Starting Tomcat as a service in linux

Copy the file "tomcat" into /etc/init.d/:


Session Clustering

Terracotta Sessions for Tomcat >> (Website)

This product is distributed with a licensed that allows you to cluster the session state in up to four Tomcat instances for free. Terracotta Sessions is built on Terracotta?s JVM clustering technology. This technology works to cluster objects at the level of the JVM and is enabled entirely through configuration. This drop-in technology does not require developers to write any code or implement an API. Unlike other clustering solutions, Terracotta Sessions only transmits data that has changed. Applications clustered using this technology have a much improved scalability. Features of Terracotta Sessions include:
  • Drop-in clustering, no need to code to any API
  • Real time monitoring of session contents
  • High-avaliability and failover
  • Automatic management of object identity (no need to keep foreign keys as class attributes)
  • Will cluster objects that are not serializable, a requirement for session replication in most Servlet container
  • Terracotta configurator to assist in the configuration of Terracotta
SessionsTerracotta Sessions is most beneficial for those that have:
  • Large sessions
  • Deep session graphs with small changes
  • Sessions containing non-serializable objects
  • Servlet code that doesn?t call HTTPSession.setAttribute when the session state changes

From Tomcat change log
================
Tomcat on Linux:
================
GLIBC 2.2 / Linux 2.4 users should define an environment variable:
export LD_ASSUME_KERNEL=2.2.5

Memory

Memory (-Xmx -Mmm) etc for tomcat process

More on Memory (from >>http://www.olat.org/docu/4.X/tomcatApache.html)

Tomcat VM parameters and Operating System issues

The following virtual machine parameters should be used when starting tomcat:

*

-Xss256k: specify the stack size. Default is 0.5 MB which is way to much and consumes a lot of memory. This is the memory used for each thread. If you have the Instant Messaging component enabled for every logged in user four threads will be created which can result in a very high memory usage. Please note that this is stack memory and is consumed in addition to the memory you specify with the -Xms and -Xmx flags! *

-Xms768m -Xmx768m: specify the amount of memory tomcat can use as a maximum. With about 200 concurrent users (Userbase 7500 users) OLAT usually requires about 300 MB. This configuration example is for a very large site. Note that in addition to the memory specified here the VM uses for every thread an additional amount of memory specified by the -Xss option. *

-Djava.awt.headless=trueIf you run OLAT on a Unix/Linux box with no graphics environment started (e.g. KDE, Gnome) classes using image frame buffers will not work and throw an exception. By enabling the headless mode the jvm emulates an graphics environment.

Example configuration from the tomcat5/bin/catalina.sh file:

CATALINA_OPTS="-server -Xss256k -Xms768m -Xmx768m -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true"

Source


Proxy Apache

ProxyPass & ReverseProxyPass What does ProxyPass do?

Apache's ProxyPass directive implements what is known as an "inverse proxy," where one server sits in front of another and "hides" the back server's content by accepting requests, massaging the URL, passing it to the back server, waiting for a response, and handing it back to the client. This technique has many uses: in-house corporate servers with no direct Internet access can serve limited content to the outside world by masquerading behind a public server with a ProxyPass directive; load-balanced and fault tolerant "server farms" can serve clients through a massively cached front end box; and so forth.

There are actually two directives:

ProxyPass /visiblepath >>http://backserver:port/path...

This intercepts incoming client requests beginning with /visiblepath (interpreted as a Location, not a Directory), strips that part off, prepends >>http://backserver:port/path... instead, goes to backserver:port to satisy the request, then returns the result to the client as though it had come from Apache's own document tree.

ProxyPassReverse /visiblepath >>http://backserver:port/path...

This matching directive watches in the other direction! URL Redirects from backserver:port, and other responses containing a URL in the header, are automatically back-translated to begin with /visiblepath instead, so the "illusion" is preserved.

no comments | post comment

Menu:
Java & J2EE
Development
Books

Help:
Help FAQ
Formatting


< November 2008 >
SunMonTueWedThuFriSat
1
2345678
9101112131415
16171819202122
23242526272829
30


Logged in Users: (1)
… and 104 Guests.



Disclaimer: Views and opinions are that of the individual author, and not that of Marand Custom Solutions. This site is an open forum for technical content, and the company accepts no liability for any content or view expressed.