RE: Tomcat scalability setting - need help please

2010-04-09 Thread Cin Lung
Hi George,

Trust me the people in my client's company would see that much of data. It
is needed by the production.
The next best way I can do is to send the resultset object directly to the
JSP, but I would not go to that extent just yet. I am going to either build
a new cache mechanism or use ehcache. The companies where I cater is data
hungry company.

Thanks
Rendra 

-Original Message-
From: George Sexton [mailto:geor...@mhsoftware.com] 
Sent: Friday, April 09, 2010 12:50 AM
To: 'Tomcat Users List'
Subject: RE: Tomcat scalability setting - need help please

Clearly instantiating millions of objects is not a strategy for scalability.

You're going to have to re-structure your code to reduce the memory
footprint of each session.

Why is your result set returning a million rows? No human would want to see
that much data.

You need to restructure your queries and navigation design so that it
doesn't do this.

George Sexton
MH Software, Inc.
303 438-9585
www.mhsoftware.com


 -Original Message-
 From: Cin Lung [mailto:cinl...@gmail.com]
 Sent: Thursday, April 08, 2010 10:53 AM
 To: 'Tomcat Users List'
 Subject: RE: Tomcat scalability setting - need help please
 
 Hi George
 
 Your remark is almost correct. What I did is that I store the result 
 of the resultset (which can go up to million lines of rows) in a batch 
 of Java beans. Then I set the beans to the HTTP Request and pass them 
 to the receiving JSP.
 
 But I do remember to return the connection to the pool. I also try to 
 kill the statements, result sets, etc by setting them to null. But I 
 realize that java might wait for the memory to be cleared by the 
 garbage collector.
 
 This goes back to my second problem. If the user closes the browser, 
 the request object form the servlet would lost its way to return the 
 result. And this will hog the tomcat performance for a while.
 
 Any tips would greatly be appreciated.
 
 TIA
 Rendra
 
 -Original Message-
 From: George Sexton [mailto:geor...@mhsoftware.com]
 Sent: Thursday, April 08, 2010 11:42 PM
 To: 'Tomcat Users List'
 Subject: RE: Tomcat scalability setting - need help please
 
 
  -Original Message-
  From: Pid [mailto:p...@pidster.com]
  Sent: Thursday, April 08, 2010 8:49 AM
  To: Tomcat Users List
  Subject: Re: Tomcat scalability setting - need help please
 
  When you run the query in your application how are you doing it, e.g.
  by
  calling a stored procedure, or by executing exactly the same SQL 
  statement?
 
 
 
 Most likely the application is storing result sets on the session.
 
 
 
 George Sexton
 MH Software, Inc.
 303 438-9585
 www.mhsoftware.com
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Regarding thread hi-jacking

2010-04-08 Thread Cin Lung
Dear all tomcat mailing list dev and users
 
I apologize for accidentally hi-jacking a user email by using reply button.
I did not realize that it is not allowed. So, please forgive me. I did that
just out of convinience and I think I replaced the subject as well.
 
I learn new rule today. Please be patient with me and I will submit my
question again using new thread.
 
Thanks
Rendra
 


Tomcat scalability setting - need help please

2010-04-08 Thread Cin Lung
Dear All Dev
 
Sorry if repost, I got an error from the mailing list server.
Can anyone help me with my problem? I have two biggest problems as follow:
 
1. Multi Connection Problem:
I have a web application that service to multiple users. Everytime the users
accessing the server reach 100 users at the same time, the tomcat would
slows down. I tried to set -xmx1024 and -xms1024, but it did not have any
impact at all.
I tried to set the memory cache to 2048 and above, but the tomcat won't
start.
My current server is running AMD Athlon 64 3000+ with 8GB memory running
windows server 2003 SP1.
I am running tomcat 6 for the app server.
Before upgrading to Windows 2003 SP1 I also had the same problem. I thought
by upgrading would make a difference, but it didn't.
Is there any way to improve tomcat's performance. Will there be any use of
Java NIO Framework in tomcat? I mean apache has Mina, why not combine with
tomcat?
 
2. User cancellation problem
Another thing that really bug me is that user would click on a web
application that perform a very extensive task. The user was not patient and
just close the browser accessing the app. This did not make that particular
job stop. In fact the job is still running until finish and then it got no
place to return the result since the user closed the browser. As the result,
my server is working really hard and takes up all the resources available,
and causes other users to lag.
 
Is there any way to make that particular user task/thread stop working?
 
Thank you in advance
Rendra


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Tomcat scalability setting - need help please

2010-04-08 Thread Cin Lung
Dear Leon

Let me answer your question by the number of the questions:
1. My threadpool settings: are you talking about the java threadpool or the
tomcat server setting for the thread pool. If this is tomcat, I am sorry I
think I set it to standard from installation. I did not change any tomcat
standard settings except for the -xmx and -xms stuff. As for java, the DB
thread pool is set for 200 connections at once.

What I meant by slows down is that user clicks on a simple form view
function that usually takes less dan a blink of an eye to open, now the
application just not responding. The browser just keep loading and the load
animation for IE keeps spinning, but does not return the appropriate
response page and sometimes it just died (blank). When I check the tomcat
logs nothing went wrong.

This happens if a user run one of the heavy duty app and someone else run
another app (even simple ones). Regarding multiple tomcat machine I am
trying to avoid it because I would have to rewrite the entire software or
get an QOS machine to disperse the weight.

2. For number 2, I did the warning for user to wait and not to close the
browser before it is finished. But, a lot of them just don't even bother to
read the warning and keep closing it. I was wondering if there is an API for
monitoring dead users out there. Or I can always create a new API to monitor
user activities by planting an applet on the user site that will keep
pinging to the server and if the ping died, that means the user closed the
browser. Is this wise? 

Or I can try to see The java Concurency thing that you mentioned below.

Thank you for your advice and sorry for my bad English.


-Original Message-
From: Leon Rosenberg [mailto:rosenberg.l...@googlemail.com] 
Sent: Thursday, April 08, 2010 5:31 PM
To: Tomcat Users List
Subject: Re: Tomcat scalability setting - need help please

Hello Rendra,

comments inline.

On Thu, Apr 8, 2010 at 11:00 AM, Cin Lung cinl...@gmail.com wrote:
 Dear All Dev

 Sorry if repost, I got an error from the mailing list server.
 Can anyone help me with my problem? I have two biggest problems as follow:

 1. Multi Connection Problem:
 I have a web application that service to multiple users. Everytime the 
 users accessing the server reach 100 users at the same time, the 
 tomcat would slows down. I tried to set -xmx1024 and -xms1024, but it 
 did not have any impact at all.
 I tried to set the memory cache to 2048 and above, but the tomcat 
 won't start.

What are your threadpool settings? What exactly is 'slows down' If it stops
responding you are obviously running out of threads. If it just gets slower,
you should consider measuring the load on your machine and webapp.
Maybe you should consider scaling to multiple tomcats/machines.

 Is there any way to improve tomcat's performance. Will there be any 
 use of Java NIO Framework in tomcat? I mean apache has Mina, why not 
 combine with tomcat?

There are a lot of ways, but first you should identify your problem.


 2. User cancellation problem
 Another thing that really bug me is that user would click on a web 
 application that perform a very extensive task. The user was not 
 patient and just close the browser accessing the app. This did not 
 make that particular job stop. In fact the job is still running until 
 finish and then it got no place to return the result since the user 
 closed the browser. As the result, my server is working really hard 
 and takes up all the resources available, and causes other users to lag.

 Is there any way to make that particular user task/thread stop working?

The common way to handle this is to inform user that the task is going to
last a bit more. To achieve this, the original request starts a background
job which executes the heavy task. The original request then sends the user
to a wait page, which explains that he/she has to wait for the execution.
The wait page reloads itself all 1-2 seconds checking whether the background
job has finished. If this happens, the wait page sends the user to the
result page, where he can examine the result of the background task.
There are a lot of classes like Executor, Future etc. which can help you in
synchronization of background jobs. Java Concurrency in Practice is a good
particular start.

regards
Leon









 Thank you in advance
 Rendra


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Tomcat scalability setting - need help please

2010-04-08 Thread Cin Lung
Hi Pid

My task is a web-based ERP application. It uses database and the number of
user connection to it is up to 200 users. I use MySQL for the database.

I apply the -xmx1024m and -xms1024m because I once got a message about Java
Heap Out Of Space, so I searched the web and some people suggested that
settings and it worked... for a while. Now that the amount of data is
increased and the user using the app increased as well, lagging has been
happening.

The settings above I set it in the Tomcat Service monitor. And yes, I also
set tomcat as service.
It's running 32 Bit windows 2003 only With 8GB Ram. The tomcat version is
6.0.14.

I am not assuming either tomcat is the problem or my software. I am merely
trying to find a way out and I have exhausted my resources to make the
software as fast as possible. Tomcat setting is the only thing that I have
not explore extensively since I am not as expert as you guys. Maybe I can
learn a tip or two to make things better.

By the way the number of data that is being processed by the heavy app is in
millions of rows. I ran the SQL directly to the mysql server and it worked
ok (within minutes and not freezing the server). Meanwhile, when the query
is being run via tomcat, then it will freeze the server as well. It does not
kill the server, just consume all the server resources, but eventually will
come back to normal after two hours with the result.

Thanks
Rendra

-Original Message-
From: Pid [mailto:p...@pidster.com] 
Sent: Thursday, April 08, 2010 4:56 PM
To: Tomcat Users List
Subject: Re: Tomcat scalability setting - need help please

On 08/04/2010 10:00, Cin Lung wrote:
 Dear All Dev

 Sorry if repost, I got an error from the mailing list server.
 Can anyone help me with my problem? I have two biggest problems as follow:
 
 1. Multi Connection Problem:
 I have a web application that service to multiple users. Everytime the 
 users accessing the server reach 100 users at the same time, the 
 tomcat would slows down.

What does your app do?
What tasks is it performing?
Does it use a database?

 I tried to set -xmx1024 and -xms1024, but it did not have any impact 
 at all.

Where did you apply those settings?

Is Tomcat installed as a service?

 I tried to set the memory cache to 2048 and above, but the tomcat 
 won't start.

Where did you apply that setting?

 My current server is running AMD Athlon 64 3000+ with 8GB memory 
 running windows server 2003 SP1.

Is it running 64bit Windows?

 I am running tomcat 6 for the app server.

Exactly which version of Tomcat 6.0.NN?

 Before upgrading to Windows 2003 SP1 I also had the same problem. I 
 thought by upgrading would make a difference, but it didn't.

What makes you think Tomcat and not your application is the source of your
problem?

If upgrading the server doesn't make a difference, perhaps this points to
something that isn't affected by the processing power of the server as the
source of the problem.

 Is there any way to improve tomcat's performance?

It is possible to tune Tomcat, but in the vast majority of cases the
application is the problem.  Tomcat is used in many high-load situations
with great success.

 Will there be any use of Java NIO Framework in tomcat?

There is the NIO Connector.  It's not guaranteed to make a difference as the
usual source of the problem is in the application.

 I mean apache has Mina, why not combine with tomcat?

Assuming there's anything wrong with Tomcat, which many people here would
disagree with.


 2. User cancellation problem
 Another thing that really bug me is that user would click on a web
 application that perform a very extensive task. The user was not patient
and
 just close the browser accessing the app. This did not make that
particular
 job stop. In fact the job is still running until finish and then it got no
 place to return the result since the user closed the browser. As the
result,
 my server is working really hard and takes up all the resources available,
 and causes other users to lag.

 Is there any way to make that particular user task/thread stop working?

Interrupt it?


p


 Thank you in advance
 Rendra


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Tomcat with NIO???

2010-04-08 Thread Cin Lung
Is this real? I found this tomcat setting from the following site:
http://www.javalobby.org/java/forums/t92965.html
 
Here is the setting (see the higlighted part):
Connector port=8080 protocol=org.apache.coyote.http11.Http11NioProtocol
maxThreads=150 connectionTimeout=2 acceptorThreadCount=2
redirectPort=8443 socket.directBuffer=false/
 
Is this mean that there is a tomcat version that uses NIO? Or maybe is this
a tweak?
 
Any comments.
 
TIA
Rendra


RE: Regarding thread hi-jacking

2010-04-08 Thread Cin Lung
And that too. 

-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: Thursday, April 08, 2010 7:25 PM
To: Tomcat Users List
Subject: RE: Regarding thread hi-jacking

 From: Cin Lung [mailto:cinl...@gmail.com]
 Subject: Regarding thread hi-jacking
 Importance: High
 
 I learn new rule today. Please be patient with me and I will submit my 
 question again using new thread.

And stop setting high importance as well, please.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you received
this in error, please contact the sender and delete the e-mail and its
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Tomcat with NIO???

2010-04-08 Thread Cin Lung
Oooohhh... I just found out that the protocol is bundled inside
tomcat-coyote.jar. I never looked into the tomcat lib folder.

Has anyone benchmark which protocol is better performance? The
Http11NioProtocol or Http/1.1?

Thanks
Rendra

-Original Message-
From: Mark Thomas [mailto:ma...@apache.org] 
Sent: Thursday, April 08, 2010 6:54 PM
To: Tomcat Users List
Subject: Re: Tomcat with NIO???

On 08/04/2010 12:50, Cin Lung wrote:
 Is this real?
Yes.

 I found this tomcat setting from the following site:
 http://www.javalobby.org/java/forums/t92965.html
  
 Here is the setting (see the higlighted part):
 Connector port=8080
protocol=org.apache.coyote.http11.Http11NioProtocol
 maxThreads=150 connectionTimeout=2 acceptorThreadCount=2
 redirectPort=8443 socket.directBuffer=false/
  
 Is this mean that there is a tomcat version that uses NIO?
No there isn't a version of Tomcat that uses NIO. There are many versions
thast use it and have done for a number of years.

 Or maybe is this a tweak?
No.

 Any comments.
Try reading the documentation, starting with this:
http://tomcat.apache.org/tomcat-6.0-doc/config/http.html

Mark



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Tomcat with NIO???

2010-04-08 Thread Cin Lung
Let me rephrase:

Which setting should I use for my server.xml to get better performance under
heavy duty job (and under light duty as well if posible to get both):
Connector port=8080
protocol=org.apache.coyote.http11.Http11NioProtocol
   maxThreads=150 connectionTimeout=2
acceptorThreadCount=2
   redirectPort=8443 socket.directBuffer=false/ 

Or the standard setting that comes with tomcat installation:
Connector port=8080 protocol=HTTP/1.1
   connectionTimeout=2
   redirectPort=8443 /

Mark: can you point any site that shows benchmark result for both protocol
above?

In the mean time I will read the doc that Mark gave to me.

Thanks


-Original Message-
From: Mark Thomas [mailto:ma...@apache.org] 
Sent: Thursday, April 08, 2010 7:45 PM
To: Tomcat Users List
Subject: Re: Tomcat with NIO???

On 08/04/2010 13:41, Cin Lung wrote:
 Oooohhh... I just found out that the protocol is bundled inside 
 tomcat-coyote.jar. I never looked into the tomcat lib folder.
 
 Has anyone benchmark which protocol is better performance?
Yes.

 The Http11NioProtocol or Http/1.1?
That question makes no sense. NIO is an implementation of HTTP/1.1

Mark

 
 Thanks
 Rendra
 
 -Original Message-
 From: Mark Thomas [mailto:ma...@apache.org]
 Sent: Thursday, April 08, 2010 6:54 PM
 To: Tomcat Users List
 Subject: Re: Tomcat with NIO???
 
 On 08/04/2010 12:50, Cin Lung wrote:
 Is this real?
 Yes.
 
 I found this tomcat setting from the following site:
 http://www.javalobby.org/java/forums/t92965.html
  
 Here is the setting (see the higlighted part):
 Connector port=8080
 protocol=org.apache.coyote.http11.Http11NioProtocol
 maxThreads=150 connectionTimeout=2 acceptorThreadCount=2
 redirectPort=8443 socket.directBuffer=false/
  
 Is this mean that there is a tomcat version that uses NIO?
 No there isn't a version of Tomcat that uses NIO. There are many 
 versions thast use it and have done for a number of years.
 
 Or maybe is this a tweak?
 No.
 
 Any comments.
 Try reading the documentation, starting with this:
 http://tomcat.apache.org/tomcat-6.0-doc/config/http.html
 
 Mark
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Tomcat scalability setting - need help please

2010-04-08 Thread Cin Lung
Hi George

Your remark is almost correct. What I did is that I store the result of the
resultset (which can go up to million lines of rows) in a batch of Java
beans. Then I set the beans to the HTTP Request and pass them to the
receiving JSP.

But I do remember to return the connection to the pool. I also try to kill
the statements, result sets, etc by setting them to null. But I realize that
java might wait for the memory to be cleared by the garbage collector.

This goes back to my second problem. If the user closes the browser, the
request object form the servlet would lost its way to return the result. And
this will hog the tomcat performance for a while.

Any tips would greatly be appreciated.

TIA
Rendra

-Original Message-
From: George Sexton [mailto:geor...@mhsoftware.com] 
Sent: Thursday, April 08, 2010 11:42 PM
To: 'Tomcat Users List'
Subject: RE: Tomcat scalability setting - need help please


 -Original Message-
 From: Pid [mailto:p...@pidster.com]
 Sent: Thursday, April 08, 2010 8:49 AM
 To: Tomcat Users List
 Subject: Re: Tomcat scalability setting - need help please
 
 When you run the query in your application how are you doing it, e.g.
 by
 calling a stored procedure, or by executing exactly the same SQL 
 statement?
 


Most likely the application is storing result sets on the session.



George Sexton
MH Software, Inc.
303 438-9585
www.mhsoftware.com


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Tomcat scalability settings

2010-04-07 Thread Cin Lung
Dear All Dev

Can anyone help me with my problem? I have two biggest problems as follow:

1. Multi Connection Problem:
I have a web application that service to multiple users. Everytime the users
accessing the server reach 100 users at the same time, the tomcat would
slows down. I tried to set -xmx1024 and -xms1024, but it did not have any
impact at all.
I tried to set the memory cache to 2048 and above, but the tomcat won't
start.
My current server is running AMD Athlon 64 3000+ with 8GB memory running
windows server 2003 SP1.
I am running tomcat 6 for the app server.
Before upgrading to Windows 2003 SP1 I also had the same problem. I thought
by upgrading would make a difference, but it didn't.
Is there any way to improve tomcat's performance. Will there be any use of
Java NIO Framework in tomcat? I mean apache has Mina, why not combine with
tomcat?

2. User cancellation problem
Another thing that really bug me is that user would click on a web
application that perform a very extensive task. The user was not patient and
just close the browser accessing the app. This did not make that particular
job stop. In fact the job is still running until finish and then it got no
place to return the result since the user closed the browser. As the result,
my server is working really hard and takes up all the resources available,
and causes other users to lag.

Is there any way to make that particular user task/thread stop working?

Thank you in advance
Rendra


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org