Re: Copying large files around

2007-10-13 Thread PTS
Yes. It has AT (command line) and a scheduler (GUI). You can do a batch file 
and set it to run at a certain time, day and frequency. I had a client that 
I setup the dhcp service to stop, copy the database over to a backup 
directory and then restart the service in a batch file. Then I called it 
every night before the tape backup ran.

AT is a lot lighter than Scheduler so using it is preferable.

Doug

- Original Message - 
From: David Kerber [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Saturday, October 13, 2007 11:29 AM
Subject: Re: Copying large files around



Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

David,

David Kerber wrote:


Let me give a bit more detail:  I am working on a utility function in my
webapp that will periodically copy the database file from the db server
to a backup server on the LAN.



Uh cron and cp, anyone? You can even use cron to initiate the
backup, too, instead of scripting it from your webapp.

Why doesn't anyone use cron anymore? Sheesh...

Does Windows 2003 server have a version of cron?  I've never used it.  And 
building it into my webapp lets all the configuration be done from the 
same interface..


D



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Corrupted archive file?

2007-09-09 Thread PTS

Mark,

Did he post to the dev list or another list as well? Just curious why this 
would be a cross post.


Doug

- Original Message - 
From: Mark Thomas [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Sunday, September 09, 2007 10:14 AM
Subject: Re: Corrupted archive file?



Please do not cross-post.

Mark

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: upload and download of images with Tomcat

2007-09-07 Thread PTS
I think it may be your choice of location that is causing you problems. Also 
would you not loose that content if you undeployed your app (depending on 
how it is deployed)?


I do uploads and display the images without issue in my app. But my 
directory is outside the web app structure. WARNING this makes the app non 
portable as it uses a hard coded path to the files.


If my memory serves me well, Tomcat deploys the app and then runs from a 
work directory. If the image files are in the app directory then the running 
app would not see them because it is running from the work directory and any 
path is referenced from it.


I think.

Someone tell me if I am wrong and I will crawl back under my rock.

Doug

- Original Message - 
From: Wojtek Stańczuk [EMAIL PROTECTED]

To: users@tomcat.apache.org
Sent: Friday, September 07, 2007 3:34 AM
Subject: upload and download of images with Tomcat



Hello,
I try to upload images for futher download (as in a image
gallery) to a folder under web application dir. Everything goes fine 
except one thing: the uploaded images are not seen in the application till 
next deployment

of the application (Tomcat does not see the images).
Is it possible to make Tomcat see dynamically added
static content? I know that one of the solution is using web server for 
serving static resources, but I would

like to find a solution in Tomcat.

 Best regards,
 Wojtek Stanczuk



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Noob needs help with a webservice wich uses resources located in a folder

2007-09-03 Thread PTS
If my quick read of your problem is correct, (only works when run from 
command line) then I would venture to say that you may have a rights issue. 
Who owns the app? By default Tomcat starts from the scripts as owner tomcat 
where as from the command line it is running as you (root or some admin 
level). Try chown and chgrp the app to tomcat and see if that helps.


No even moving it into the folder does not give Tomcat the rights to access 
it. You could also change the access rights but I would be careful there as 
letting anyone execute code is not a good thing, but chgrp to tomcat and 
group executable would work. Just make sure you understand what the 
implications of the changes you make are, even on ownership and group 
membership.


Doug


- Original Message - 
From: Tomás Tormo [EMAIL PROTECTED]

To: users@tomcat.apache.org
Sent: Monday, September 03, 2007 7:09 AM
Subject: Noob needs help with a webservice wich uses resources located in a 
folder




Hi

 I'm quite noob about tomcat topic. I'm using tomcat 5.028 in Ubuntu 6.10 
and I would like to find an anwer to my question about web services 
because i'm not able to solve it. I've written a java applicattion wich 
uses a wrapper to communicate with an applicattion written in C, wich is 
the core of my applicattion. Both the wrapper and the core are third 
party applicattions, and because of that i don't have the source code, I 
just have the API.


The third party sent me an example application wich uses the core. And, as 
I could see in the script wich lauches the application, this folder should 
be added to the classpath in order to be able to be located by the wrapper 
applicattion. The documentation of the wrapper just says that this folder 
has to exist with an specific name.


My problem is that my applicattion works fine launched from shell (it 
founds the folder and uses the core perfectly) but it doesn't work as a 
webservice. It is not able to find the resource folder (let's call it 
cfg). As I can see in the catalina log, the application tries to load 
the resources (via ClassLoader I guess) and then launches an exception 
saying that is not able to find it. The client  gets a HTTPErrorCode0.


I've tried a lot of ways to solve it: I tried to launch tomcat with the 
classpath modified from the shell itself(making it point to the folder), 
tried to export the classpath from startup.sh script, tried to export the 
classpath from catalina.sh script, tried to modify the CATALINA_OPTS 
variable, tried to put the folder in both lib and classes folders of the 
webservice folder... but nothing worked.


Please.. could you help me to solve this problem? I think I've tried all 
the options that came to my mind (except declaring a resource in 
server.xml file, altought I don't know If this wrapper uses JNDI to access 
to the resource..).I hope I explained myself well.  As I think you can 
see, I'm quite noob with tomcat, so please don't be so hard with your 
answers... :'-p


Thank you very much!

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: OT tomcat embedded 5.5 localhost alias

2007-08-21 Thread PTS

It has nothing to with Tomcat in this case.

http://localhost

equals

http://127.0.0.1

equals

http://AAA.BBB.CCC.DDD  (the IP address of the machine)

When it comes to accessing the web page from the machine that is hosting the 
site.


The above is not exactly correct when it comes to things like firewalls and 
such. So please no lectures on this.


The first two only work from the machine to itself.

The third will work from any machine that can connect to the host via a 
network.


Now in order to use http://myHost there must be something to convert it to 
either the second or third item above. On the Internet the DNS servers do 
this for you. For local use you either have to have a DNS server with the 
entry for myHost OR use a host file. If you find your host file and open it 
you will find the entry that makes the first example above work. If you are 
running this on someone else's machine then I am unaware of any means to do 
this without modifying their host file.


Someone on the list may have a way that I am not aware of.



- Original Message - 
From: Alex Cheung [EMAIL PROTECTED]

To: users@tomcat.apache.org
Sent: Tuesday, August 21, 2007 8:25 PM
Subject: tomcat embedded 5.5 localhost alias


Hi
I am using tomcat embedded 5.5 to demo a web application on cd.

I can't figure out how to change the URL string 
fromhttp://localhost:8080/. to http://myHost:8080/..


addAlias and setHostName dont seem to work.

following are my host creation code:

   // set Engine propertiesbaseEngineName = name + Engine; 
hostName   = name + Host;
   baseEngine.setName(baseEngineName); 
baseEngine.setDefaultHost(hostName);
   //set host// ** host name doesnt seem to change the url ** 
baseHost = embedded.createHost(hostName, WEBAPPS); 
baseHost.addAlias(myHost);baseEngine.addChild(baseHost);


Please tell me how to change the default localhost URL string or point me in 
the right direction.

(i searched google and came up empty)

thanksAlex
_
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx 



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat listening on port, but get timeout in browser

2007-08-09 Thread PTS

/me finishes throwing out straws :-)
--
Hassan Schroeder  [EMAIL PROTECTED]



Since Hassan has run out I have a few. What IF Tomcat is starting OK but 
there is no page to serve at the URL you are going to? IF the server is 
starting fine but the app is not deploying then where would you be? Are 
there any other apps running? Can you build a small test app with static 
pages?


Just a few crazy notions.

Doug 



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat Farm Recommendation

2007-07-04 Thread PTS
First things first, I do not have an answer. As for the approach of multiple 
machines it does allow for better fault tolerance. But is also has the 
disadvantage of multiple machines to manage. And I am sure the list has lots 
of other pros and cons. As for the machine brand selection is another area 
of debate that can go for days. I would recommend a brand you are 
comfortable with and can get hardware support. As for processor and memory 
these are really dependent on your application and user load. If you have 
some base numbers to work from you may get some guidance from the list. For 
OS you will find that there are supporters from many different camps. Again 
this is often a case of what you are comfortable with. If you search the 
list there are some links where comparisons have been made with different 
OS.


Memory: How big is your app? How many apps? How many users?
Processor: How many users? How much calculating(processing) in you apps? How 
many apps?
OS: Is it supported with a current stable java environment? Cost? Platform 
requirements?


Doug

- Original Message - 
From: bajistaman [EMAIL PROTECTED]

To: users@tomcat.apache.org
Sent: Wednesday, July 04, 2007 12:23 PM
Subject: Tomcat Farm Recommendation




I'm trying to move my Apache Http Server Farm to a Tomcat one and I guess
that Tomcat needs more resources than Apache does. Our approach has been
always to have many medium size machines than a few big ones, does anybody
have any suggestion to the kind of machine + OS needed to get the best
tomcat performance?

Thanks,

Johann
--
View this message in context: 
http://www.nabble.com/Tomcat-Farm-Recommendation-tf4025344.html#a11433752

Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Null

2007-06-27 Thread PTS
In several of the fields of the database the information is not entered 
until a later time and thus the field is null. If you look at actual data 
the value is null. When returned the data either is null or is not 
compatible with the data needed back. I am using the data in several areas. 
If I am expecting a String and it is null, then I want an empty string to be 
displayed. If I am expecting a number then I want a 0 if it is null. If the 
data returned is not of the type expected then I catch the exception and 
return the equivalent of no information for that data type.


As for the String[], I am pulling back an entire row from the database and 
then picking a single element from the array. In essence it allows me to 
treat the result set as a two dimensional array.


The concept that I was trying to convey to the OP was to do a try catch and 
return the desired default value of the proper type.


Doug

- Original Message - 
From: domenico di leo [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Wednesday, June 27, 2007 7:08 AM
Subject: Re: Null



If I have understand your problem is : you receive a lot of null value
afther a query but you don't except them.
The problem could be in your if statement .

((String[])queryResults.elementAt(r))[c]).equalsIgnoreCase(null))

you compare a String vector with a String because you have upacsted to
String[]  the return value of queryResult.
I think you should do something like this:

String[] queryResult = new String[10]
/* Suppose that the queryResult method yelds a vector fill with 10 String

queryResult = new ((String[])queryResults.elementAt(r))[c])

afther

for (int i=0; i= queryResult.lenght(); i++){
if queryResult[i].equalsIgnoreCase(null))
   return null; // Why do you use  ?
 return queryResult[i];
}

Cheers

On 25/06/07, Propes, Barry L [EMAIL PROTECTED] wrote:

yeah, this seems like a good solution, too.

-Original Message-
From: PTS [mailto:[EMAIL PROTECTED]
Sent: Saturday, June 23, 2007 12:29 PM
To: Tomcat Users List
Subject: Re: Null


I had to deal with a lot of null values coming back from a database. I 
may

have been reinventing the wheel but I wrote a little DBUtil class that I
used to sanitize the returned data. I wrote a get for each type of data 
and
did a try catch. If the data came back not null I simply returned it, if 
it
came back null it threw an exception and I returned back a default value 
in

the catch clause.

For text:

   /** returns the row and column equivalent from the DBResults or empty
string if null or out of bounds*/
  public String getDataP(int r, int c){
   try{
if 
String[])queryResults.elementAt(r))[c]).equalsIgnoreCase(null))

 return ;
   return(((String[])queryResults.elementAt(r))[c]);
  }catch(Exception e){return ;}
  }

For numbers:

   /** returns the row and column equivalent from the DBResults or string 
0

if null or out of bounds*/
  public String getDataN(int r, int c){
   try{
if 
String[])queryResults.elementAt(r))[c]).equalsIgnoreCase(null))

 return 0;
   return(((String[])queryResults.elementAt(r))[c]);
  }catch(Exception e){return 0;}
  }


For time:

/** returns the row and column equivalent from the DBResults or 
string

00:00:00 if null or out of bounds*/
  public String getDataT(int r, int c){
   try{
if 
String[])queryResults.elementAt(r))[c]).equalsIgnoreCase(null))

 return 00:00:00;
   return(((String[])queryResults.elementAt(r))[c]);
  }catch(Exception e){return 00:00:00;}
  }


Doug

- Original Message -
From: Propes, Barry L  [EMAIL PROTECTED]
To: Tomcat Users List users@tomcat.apache.org
Sent: Friday, June 22, 2007 1:11 PM
Subject: RE: Null


that doesn't sound rightare you sure you're pulling back a value from 
a

column that's a string?

-Original Message-
From: Mohammed Zabin [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 21, 2007 6:02 AM
To: Tomcat Users List
Subject: Re: Null


I tried it the other way, if( rs.getString(field) == null ) but the
compiler plames that null can't be compared to string

On 6/21/07, Tim Funk [EMAIL PROTECTED] wrote:


 if (null == rs.getString(col_foo)) {
out.println(tdnbsp;/td);
 } else {
// Evil since this doesn't escape the xml - for edutainment only
out.println(td + rs.getString(col_foo) + /td);
 }

 -Tim

 Mohammed Zabin wrote:
  Hi All
 
  Anyone knows how to deal with null values in JDBC ResultSet??
 
  I am trying to render a table in jsp page that read its value from 
  the
  database, sometimes, the database returns null values, and so, the 
  whole
  table couldn't be rendered. Is there any way to deal with null 
  values.

 
  Thanks
 


 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED

test from gmail user

2007-06-24 Thread PTS
Having issues getting my email to show on the list. 


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



another test

2007-06-24 Thread PTS

Trying again.



user only

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: another test

2007-06-24 Thread PTS

Thanks.



- Original Message - 
From: Wendy Smoak [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Sunday, June 24, 2007 12:04 PM
Subject: Re: another test



On 6/24/07, PTS [EMAIL PROTECTED] wrote:


This is a strange one indeed. It would appear that Google mail filers out
the mail that I send to the list. So when I check mail for the list this
email will not appear in my incoming email although you do receive it.
Strange. Thanks for the confirmation.


That's just GMail, you'll get used to it. :)  Look in your sent mail,
or check one of the list archives if you want to make sure your post
arrived.  For example...
http://www.nabble.com/another-test-t3972336.html

--
Wendy

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: another test

2007-06-24 Thread PTS
This is a strange one indeed. It would appear that Google mail filers out 
the mail that I send to the list. So when I check mail for the list this 
email will not appear in my incoming email although you do receive it. 
Strange. Thanks for the confirmation.


Doug

- Original Message - 
From: Martin Gainty [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Sunday, June 24, 2007 11:00 AM
Subject: Re: another test



Looks like you're getting through
Whats your question?

M--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please 
notify

the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

- Original Message - 
From: PTS [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Sunday, June 24, 2007 10:48 AM
Subject: another test



Trying again.



user only

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Null

2007-06-23 Thread PTS
I had to deal with a lot of null values coming back from a database. I may 
have been reinventing the wheel but I wrote a little DBUtil class that I 
used to sanitize the returned data. I wrote a get for each type of data and 
did a try catch. If the data came back not null I simply returned it, if it 
came back null it threw an exception and I returned back a default value in 
the catch clause.


For text:

  /** returns the row and column equivalent from the DBResults or empty 
string if null or out of bounds*/

 public String getDataP(int r, int c){
  try{
   if String[])queryResults.elementAt(r))[c]).equalsIgnoreCase(null))
return ;
  return(((String[])queryResults.elementAt(r))[c]);
 }catch(Exception e){return ;}
 }

For numbers:

  /** returns the row and column equivalent from the DBResults or string 0 
if null or out of bounds*/

 public String getDataN(int r, int c){
  try{
   if String[])queryResults.elementAt(r))[c]).equalsIgnoreCase(null))
return 0;
  return(((String[])queryResults.elementAt(r))[c]);
 }catch(Exception e){return 0;}
 }


For time:

   /** returns the row and column equivalent from the DBResults or string 
00:00:00 if null or out of bounds*/

 public String getDataT(int r, int c){
  try{
   if String[])queryResults.elementAt(r))[c]).equalsIgnoreCase(null))
return 00:00:00;
  return(((String[])queryResults.elementAt(r))[c]);
 }catch(Exception e){return 00:00:00;}
 }


Doug

- Original Message - 
From: Propes, Barry L  [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Friday, June 22, 2007 1:11 PM
Subject: RE: Null


that doesn't sound rightare you sure you're pulling back a value from a 
column that's a string?


-Original Message-
From: Mohammed Zabin [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 21, 2007 6:02 AM
To: Tomcat Users List
Subject: Re: Null


I tried it the other way, if( rs.getString(field) == null ) but the
compiler plames that null can't be compared to string

On 6/21/07, Tim Funk [EMAIL PROTECTED] wrote:



if (null == rs.getString(col_foo)) {
   out.println(tdnbsp;/td);
} else {
   // Evil since this doesn't escape the xml - for edutainment only
   out.println(td + rs.getString(col_foo) + /td);
}

-Tim

Mohammed Zabin wrote:
 Hi All

 Anyone knows how to deal with null values in JDBC ResultSet??

 I am trying to render a table in jsp page that read its value from the
 database, sometimes, the database returns null values, and so, the whole
 table couldn't be rendered. Is there any way to deal with null values.

 Thanks



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re:[OT] Tomcat Server CPU utilization goes upto 400%

2007-06-14 Thread PTS

Sumit,

Since this is not a Tomcat issue I tagged it as OT.

Is the data query different for each user?

If no, setup a separate thread on startup to do the query and process it as 
far as you can. I was able to create a String that was the body of the page, 
then each request that came in simply inserted the string in a 
document.write on a jsp. It made the response ultra fast.


If yes, look at the data returned. How much are you having to process the 
data? I had to iterate through the results of three query's, create objects 
and populate the fields from other queries. Then do a sort on the object. It 
was very processor intensive. Is there anything you can do with a stored 
procedure on the database side. You need to limit the amount of work done on 
the data.


Doug

- Original Message - 
From: Sumit Gaikaiwari [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Thursday, June 14, 2007 7:15 AM
Subject: RE: Tomcat Server CPU utilization goes upto 400%



Hi Doug,

The requirements of this application were as mentioned in the previous
mail. Can I have any work around on the issue? What things you tried
when you had same situation?

Regards,
Sumit Gaikaiwari


-Original Message-
From: PTS [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 14, 2007 9:23 AM
To: Tomcat Users List
Subject: Re: Tomcat Server CPU utilization goes upto 400%

Sumit,

Look at the design of the app. Is each session doing a query every 30
seconds? Also is the database on the same server?

I had an app that was originally designed to be for a few users that
each
session hit the database. Due to the amount of processing of the data it
had
a snowball effect that after more than a few users connected the system
began to fall behind and the system came to a crawl. Since my query was
the
same for all users, I was able to spawn a thread to do a query every few

minutes and cache the results, then each session grabbed a copy of the
cached data from memory.

I would also have to agree that it appears to be an application issue,
especially after experiencing it myself. Or more accurately doing it to
myself.

Doug


- Original Message - 
From: Sumit Gaikaiwari [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Wednesday, June 13, 2007 11:17 PM
Subject: RE: Tomcat Server CPU utilization goes upto 400%





There is an application deployed that refreshes after every 30 seconds.
After every 30 seconds, it requeries database and fetches the data. This
was a design requirement for this application. Generally large numbers
of sessions of this application are running (450-500).

Regards,
Sumit Gaikaiwari


-Original Message-
From: Andre Prasetya [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 13, 2007 4:22 PM
To: Tomcat Users List
Subject: Re: Tomcat Server CPU utilization goes upto 400%

i think its more to application problem instead of tomcat problem. Is
there
any application hosted inside tomcat that get infinite loop or use a
kind of
loop checking something that utilize the thread fully ? try solving that
with the application developer

On 6/13/07, Sumit Gaikaiwari [EMAIL PROTECTED] wrote:



Hello,



We are using tomcat 5.0.25 on Red Hat Enterprise Linux server. There

two

applications in webapps. We are facing an issue from around 3-4 months
where the CPU utilization by java process (tomcat) goes quite high:
around 400% in every 4-5 days. The application gets very slow and

tomcat

needs to be restarted for normal operation. The output of top command

is

as below-



[EMAIL PROTECTED] jakarta-tomcat-5.0.25]# top

Tasks:  78 total,   1 running,  77 sleeping,   0 stopped,   0 zombie

Cpu(s): 25.1% us,  0.1% sy,  0.0% ni, 74.5% id,  0.2% wa,  0.0% hi,
0.0% si

Mem:   4086472k total,  2487676k used,  1598796k free,   217464k

buffers


Swap:  6094824k total,0k used,  6094824k free,  1811576k

cached




  PID USER  PR  NI  VIRT  RES  SHR S %CPU %MEMTIME+  COMMAND

1038 root  16   0  545m 244m  61m S  101  6.1   1156:22 java

1 root  16   0  2556  552  472 S0  0.0   0:01.17 init

2 root  RT   0 000 S0  0.0   0:00.31

migration/0






Here is the status of active threads-

Thread Status-



[EMAIL PROTECTED] jakarta-tomcat-5.0.25]# ps -Le -o
pid,user,s,lwp,pcpu,args | awk '$3 != S { print }'

1038 root R  1093 19.8 /usr/local/j2sdk1.4.2_12/bin/java -Xmx256m
-Xms128m -Djava.awt.headless=true -Dsun.awt.font.advancecache=off
-Djava.endorsed.dirs=/usr/local/jakarta-tomcat-5.0.25/common/endorsed
-classpath


/usr/local/j2sdk1.4.2_12/lib/tools.jar:/usr/local/jakarta-tomcat-5.0.25/



bin/bootstrap.jar:/usr/local/jakarta-tomcat-5.0.25/bin/commons-logging-a

pi.jar -Dcatalina.base=/usr/local/jakarta-tomcat-5.0.25
-Dcatalina.home=/usr/local/jakarta-tomcat-5.0.25
-Djava.io.tmpdir=/usr/local/jakarta-tomcat-5.0.25/temp
org.apache.catalina.startup.Bootstrap start

20544 root R 20544  0.0 ps -Le -o pid,user,s,lwp,pcpu,args

Re: Tomcat Server CPU utilization goes upto 400%

2007-06-13 Thread PTS

Sumit,

Look at the design of the app. Is each session doing a query every 30 
seconds? Also is the database on the same server?


I had an app that was originally designed to be for a few users that each 
session hit the database. Due to the amount of processing of the data it had 
a snowball effect that after more than a few users connected the system 
began to fall behind and the system came to a crawl. Since my query was the 
same for all users, I was able to spawn a thread to do a query every few 
minutes and cache the results, then each session grabbed a copy of the 
cached data from memory.


I would also have to agree that it appears to be an application issue, 
especially after experiencing it myself. Or more accurately doing it to 
myself.


Doug


- Original Message - 
From: Sumit Gaikaiwari [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Wednesday, June 13, 2007 11:17 PM
Subject: RE: Tomcat Server CPU utilization goes upto 400%





There is an application deployed that refreshes after every 30 seconds.
After every 30 seconds, it requeries database and fetches the data. This
was a design requirement for this application. Generally large numbers
of sessions of this application are running (450-500).

Regards,
Sumit Gaikaiwari


-Original Message-
From: Andre Prasetya [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 13, 2007 4:22 PM
To: Tomcat Users List
Subject: Re: Tomcat Server CPU utilization goes upto 400%

i think its more to application problem instead of tomcat problem. Is
there
any application hosted inside tomcat that get infinite loop or use a
kind of
loop checking something that utilize the thread fully ? try solving that
with the application developer

On 6/13/07, Sumit Gaikaiwari [EMAIL PROTECTED] wrote:



Hello,



We are using tomcat 5.0.25 on Red Hat Enterprise Linux server. There

two

applications in webapps. We are facing an issue from around 3-4 months
where the CPU utilization by java process (tomcat) goes quite high:
around 400% in every 4-5 days. The application gets very slow and

tomcat

needs to be restarted for normal operation. The output of top command

is

as below-



[EMAIL PROTECTED] jakarta-tomcat-5.0.25]# top

Tasks:  78 total,   1 running,  77 sleeping,   0 stopped,   0 zombie

Cpu(s): 25.1% us,  0.1% sy,  0.0% ni, 74.5% id,  0.2% wa,  0.0% hi,
0.0% si

Mem:   4086472k total,  2487676k used,  1598796k free,   217464k

buffers


Swap:  6094824k total,0k used,  6094824k free,  1811576k

cached




  PID USER  PR  NI  VIRT  RES  SHR S %CPU %MEMTIME+  COMMAND

1038 root  16   0  545m 244m  61m S  101  6.1   1156:22 java

1 root  16   0  2556  552  472 S0  0.0   0:01.17 init

2 root  RT   0 000 S0  0.0   0:00.31

migration/0






Here is the status of active threads-

Thread Status-



[EMAIL PROTECTED] jakarta-tomcat-5.0.25]# ps -Le -o
pid,user,s,lwp,pcpu,args | awk '$3 != S { print }'

1038 root R  1093 19.8 /usr/local/j2sdk1.4.2_12/bin/java -Xmx256m
-Xms128m -Djava.awt.headless=true -Dsun.awt.font.advancecache=off
-Djava.endorsed.dirs=/usr/local/jakarta-tomcat-5.0.25/common/endorsed
-classpath


/usr/local/j2sdk1.4.2_12/lib/tools.jar:/usr/local/jakarta-tomcat-5.0.25/



bin/bootstrap.jar:/usr/local/jakarta-tomcat-5.0.25/bin/commons-logging-a

pi.jar -Dcatalina.base=/usr/local/jakarta-tomcat-5.0.25
-Dcatalina.home=/usr/local/jakarta-tomcat-5.0.25
-Djava.io.tmpdir=/usr/local/jakarta-tomcat-5.0.25/temp
org.apache.catalina.startup.Bootstrap start

20544 root R 20544  0.0 ps -Le -o pid,user,s,lwp,pcpu,args



This was status at certain instant of time. After 5 hours from this
instant, the utilization reached to 400% and also there were many
threads which were using almost 150% of CPU time.



The system configuration is -



[EMAIL PROTECTED] ~]# wget --quiet -O - --user admin --password nimda
http://localhost:8080/manager/serverinfo

OK - Server info

Tomcat Version: Apache Tomcat/5.0.25

OS Name: Linux

OS Version: 2.6.9-42.0.2.ELsmp

OS Architecture: i386

JVM Version: 1.4.2_12-b03

JVM Vendor: Sun Microsystems Inc.



Please can any one tell me possible cause for this issue? This issue

has

become very critical and needs to be fixed out soon.



Regards,

Sumit Gaikaiwari



-**Nihilent***

 *** All information contained in this communication is confidential,
proprietary, privileged and is intended for the addressees only. If

you have

received this E-mail in error please notify mail administrator by

telephone

on +91-20-39846100 or E-mail the sender by replying to this message,

and

then delete this E-mail and other copies of it from your computer

system.

Any unauthorized dissemination, publication, transfer or use of the

contents

of this communication, with or without modifications is punishable

under the

relevant law.

Nihilent has scanned this mail with current virus checking

technologies.

However, Nihilent