tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leon Rosenberg <>
Subject Re: Tomcat scalability setting - need help please
Date Thu, 08 Apr 2010 10:30:48 GMT
Hello Rendra,

comments inline.

On Thu, Apr 8, 2010 at 11:00 AM, 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. 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.


> Thank you in advance
> Rendra
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message