LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-20-2010, 11:03 AM   #1
dinakumar12
Member
 
Registered: Mar 2010
Location: INDIA (chennai)
Distribution: centos
Posts: 271
Blog Entries: 7

Rep: Reputation: 18
Tomcat is taking too much time to deploy web application while start up


Hi all,

After building my web application we start tomcat service.But its taking too much of time to start. what should be the issue.

my log file entry is this.

july 20, 2010 10:21:27 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.26

INFO: Deploying web application directory xxxxx.

thats it. its taking more time to deploy.

What should be the reason.


any suggestions would be really helpful.

Thanks&regards,
Dinesh.
 
Old 07-20-2010, 01:07 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

Take a look for hints at this page.
Depending on your box memory, you can increase the heap size like:
Code:
export JAVA_OPTS="-Xms512m -Xmx1024m"
and see if that helps.
Or consider adding more RAM in your box.

Regadrs
 
1 members found this post helpful.
Old 07-20-2010, 01:26 PM   #3
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278

Rep: Reputation: 148Reputation: 148
Refer the following how to tune Tomcat
http://www.google.com.sg/#hl=en&sour...&gs_rfai=&fp=1
 
1 members found this post helpful.
Old 07-21-2010, 06:17 AM   #4
dinakumar12
Member
 
Registered: Mar 2010
Location: INDIA (chennai)
Distribution: centos
Posts: 271

Original Poster
Blog Entries: 7

Rep: Reputation: 18
Hi,

Thank you very much for your reply. i have executed export JAVA_OPTS="-Xms512m -Xmx1024m".But Even now tomcat is taking time to start.

I checked whether environment variable is assigned using set command. it assigned like this.

JAVA_OPTS='-Xms512M -Xmx1024M-XX:MaxPermSize=256M'


But i am having the same problem. Any other options please.

Last edited by dinakumar12; 07-21-2010 at 07:33 AM.
 
Old 07-21-2010, 07:28 AM   #5
dinakumar12
Member
 
Registered: Mar 2010
Location: INDIA (chennai)
Distribution: centos
Posts: 271

Original Poster
Blog Entries: 7

Rep: Reputation: 18
Hi bathory,

sorry, its working now. Tomcat starts at normal rate.By setting env variables as you said like this.


JAVA_OPTS='-Xms512M -Xmx2048M-XX:MaxPermSize=512M'

Thank you very much problem solved.

Thanks&regards,
Dinesh.

Last edited by dinakumar12; 07-21-2010 at 07:38 AM.
 
Old 07-28-2010, 06:13 AM   #6
dinakumar12
Member
 
Registered: Mar 2010
Location: INDIA (chennai)
Distribution: centos
Posts: 271

Original Poster
Blog Entries: 7

Rep: Reputation: 18
Hi,

After setting export JAVA_OPTS='-Xms512M -Xmx2048M-XX:MaxPermSize=512M', my tomcat starts and stops with no issues.But i am executing this export command every time when i restart tomcat, as export command set variable temporarily.

so can anyone suggests me, under which file i have to add this entry so that this JAVA_OPTS will remain permanent in my os.

Thanks&regards,
Dinesh.
 
Old 07-28-2010, 08:26 AM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

You can add it in the tomcat startup script, or in catalina.sh
 
1 members found this post helpful.
Old 07-29-2010, 03:35 AM   #8
dinakumar12
Member
 
Registered: Mar 2010
Location: INDIA (chennai)
Distribution: centos
Posts: 271

Original Poster
Blog Entries: 7

Rep: Reputation: 18
Hi,

I have added those entries in /root/.bashrc and /root/.bash_profile. Now env remins permanent for all the sessions of root user.

Thankyou.
 
Old 07-29-2010, 08:08 AM   #9
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

This is going to work only if you want to login as root and then start tomcat.
If you want tomcat to start on system boot it's not going to work. You have to set JAVA_OPTS as I told you above

Regards
 
Old 07-29-2010, 08:21 AM   #10
dinakumar12
Member
 
Registered: Mar 2010
Location: INDIA (chennai)
Distribution: centos
Posts: 271

Original Poster
Blog Entries: 7

Rep: Reputation: 18
Hi bathory,

Thank you very much for your explanation, actually i was not aware of this, sure i will do this.

Thanks once again.
 
Old 08-03-2010, 08:59 AM   #11
dinakumar12
Member
 
Registered: Mar 2010
Location: INDIA (chennai)
Distribution: centos
Posts: 271

Original Poster
Blog Entries: 7

Rep: Reputation: 18
Hi all,

I have got the tomcat issue again. but this time its different and its in another server. when i tried to restart my tomcat i got these


Using CATALINA_BASE: /usr/local/apache-tomcat-6.0.20/
Using CATALINA_HOME: /usr/local/apache-tomcat-6.0.20/
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-6.0.20//temp
Using JRE_HOME: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/
Aug 3, 2010 6:54:53 PM org.apache.catalina.startup.Catalina stopServer
SEVERE: Catalina.stop:
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:310)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:176)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java
:163)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)
at java.net.Socket.connect(Socket.java:546)
at java.net.Socket.connect(Socket.java:495)
at java.net.Socket.<init>(Socket.java:392)
at java.net.Socket.<init>(Socket.java:206)
at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:422)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:337)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415)

My tomcat does not getting restarted.

These are the entries of logfile.


Could not create the Java virtual machine.
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

What should be the issue. suggestions please.

JAVA_OPTS='-Xms512M -Xmx1024M-XX:MaxPermSize=512M. This is the memory allocated.

What should be the issue.Any suggestions would be really helpful

Thanks in advance,
Dinesh.
 
Old 08-03-2010, 11:17 AM   #12
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

Looks like you can't allocate 1G for the jvm.
Try some other combination of heap sizes, like: -Xms128m -Xmx512m
 
1 members found this post helpful.
Old 08-04-2010, 02:42 AM   #13
dinakumar12
Member
 
Registered: Mar 2010
Location: INDIA (chennai)
Distribution: centos
Posts: 271

Original Poster
Blog Entries: 7

Rep: Reputation: 18
Hi bathory,

thanks once again, yes that was the issue i tried 256m and it worked, now tomcat restarts with no issues.

Thanks&regards,
Dinesh.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to deploy a web application in tomcat using ant? devill Linux - Server 4 10-01-2009 11:13 AM
How to deploy a web application in tomcat using ant? devill Programming 3 10-01-2009 02:24 AM
How to deploy a web application in tomcat using ant? devill Ubuntu 2 10-01-2009 02:18 AM
How to deploy a web application in tomcat using ant? devill Linux - Software 1 10-01-2009 02:17 AM
How to deploy a web application in tomcat using ant? devill Linux - General 1 10-01-2009 02:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration