This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Tomcat and the fly likes running tomcat in linux for production Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "running tomcat in linux for production" Watch "running tomcat in linux for production" New topic
Author

running tomcat in linux for production

srini carry
Ranch Hand

Joined: Nov 30, 2007
Posts: 83
I am planning to run tomcat for my production server deploy my app in tomcat, I have to make memory orptions are set well.

I want to specify memory arguments in catalina.sh




I will add this line is this all we need for more memory? Please advice me , I am also new bee to linux I dont want to set environment variables but just modifiy catalina.sh for memory arguments.Please advice.
tanuj khare
author
Ranch Hand

Joined: May 02, 2012
Posts: 37
Correct options is

JAVA_OPTS="-Xms1024m –Xmx1024m -XX:MaxPermSize=256m"
If you set both -Xms and -Xmx equal then, Application performance will increase, why you want use perm gen as 1024, my suggestion 256 is sufficient

Regards, Tanuj Khare
author of Apache Tomcat 7 Essentials
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15951
    
  19

Forget modifying catalina.sh.

The catalina.sh script will look for a TOMCAT_HOME/bin/setenv.sh file and "source" it if it exists. If you put your JAVA_OPTS environment assignment there, you can get the same result without modifying your catalina.sh script (and possibly breaking it!).


Customer surveys are for companies who didn't pay proper attention to begin with.
srini carry
Ranch Hand

Joined: Nov 30, 2007
Posts: 83
is there anything more I should worry apart from memory settings ?
I will create datasources, set memeory, what more should I do to make it production servlet engine?
do I have to check if java.io.temp path has sufficient space etc ?

is there anything in them machine i have to check? , this will be running in linux.

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15951
    
  19

Depending on workload, you may not need to do anything at all. Tomcat's out-of-the-box configuration is pretty serviceable. The main things I have to tailor tend to be stuff like copying in the database drivers that I need to the TOMCAT_HOME/lib directory.

The only real way to tell is to set up stress testing that models what you're actually going to deploy and how people will be using it.

And yes, the disk drive that Tomcat's temp directory is located on should have a decent amount of free space, but usually that's not a lot of space required - unless a lot of people upload large files at the same time.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: running tomcat in linux for production
 
Similar Threads
JasperReport
best place to put JAVA_OPTS setting for Tomcat memory
How do you set mutliple memory parameters in Catalina.bat?
Right syntax for JVM tuning on tomcat server and redhat linux machine
Monitoring Tools to Monitor JVM and Oracle Connections and Network.