Thanks Chris for the response.

-Venky



-----Original Message-----
From: Christopher Schultz [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 22, 2007 1:04 PM
To: Tomcat Users List
Subject: Re: Number of Threads in request processing pool and JVM heap
size

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Venky,

Venkatesh Jayaraman (jvenky) wrote:
> I have 80 servlets on tomcat and each of them can have 5 five
concurrent
> requests to be processed as per design.

That is an odd design. Why up to five, but no more?

> 80     * 5 = 400 thread I need for on the connector?  ( So I can set
> this to maxThreads = 400)

These settings have more to do with what your hardware can handle than
what your software specification is. Don't forget that if you allow 400
concurrent connections, they might /all/ go to the same servlet. If you
really allow only 5 concurrent connections to a single servlet
(weird?!), then you might end up with lots of stalled threads
(potentially 395 of them) waiting for those 5 magic slots.

> Each thread needs 2 MB per thread then

Is that an observation, or a guess?

> JVM heap size   max          = 400 * 2 MB  (1GB) + 20 % buffer =
> 1GB

I think you mean 800MB + 20% buffer ~= 1GB. Don't forget that there is
some non-thread-related overhead, like session data (you might not have
any), any shared caches you might have, and the weight of Tomcat itself.

> Does this seems a better assumptions for designing web server using
> tomcat?

What you really need to do is load testing. Set up a test where you have
100 threads exercising your system and watch the memory usage. Bump it
up to 200 and observe again.

You can't do this just with guesses and mathematics: at some point, you
have to actually try it. You might find that you can't reliably support
400 connections on a single machine. You may also find out that your
memory requirements are lighter than you expected. You may also find
that you don't really /need/ 400 simultaneous connections, and that 250
is fine, even if you'd like to support more.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHHQJC9CaO5/Lv0PARAqIvAKC2HV8RcyN294EqeW8RBRM3w3RWVgCfVs2t
wx0Pdazmj5vBPLw5Tt4M9NE=
=n02p
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
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]

Reply via email to