Showing posts with label tomcat. Show all posts
Showing posts with label tomcat. Show all posts

Monday, January 26, 2015

Some Useful Tomcat VM Arguments



Here are some common VM arguments for Tomcat that I find myself looking up again and again.  Especially when setting up a new dev environment.  This is mostly based on Tomcat 7 but should also work for Tomcat 8, for the most part.

Another note: The configuration I'm using here is for my eclipse dev environment, but it could be adapted for any server.


More Memory

-Xms (Initial Heap size)
-Xmx (Maximum Heap Size)
-XX:MaxPermSize (Max Perm Size; tomcat 7 only)

Example:  -Xms512m -Xmx1024m -XX:MaxPermSize=512m

JMX Remote Access

Example:
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=1234
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Djava.rmi.server.hostname=127.0.0.1


Then you can then connect to your local process with JConsole with localhost:1234

Some useful links:



Saturday, February 25, 2012

An example of Tomcat Cluster Session Replication without UDP

Summary: An example Cluster element showing how to enable cluster replication between tomcat servers without UDP auto-discovery

The simple tomcat clustering uses a pretty cool auto-discovery over UDP, but in a cloud environment UDP is generally frowned on, if it's allowed at all.  You may not be the only server using UDP in which case you'll get all sorts of weird and random data.



Below is an example of setting up tomcat session replication without using UDP.