killbulle schrieb:
> Hi the list,
> i've two litlles question about using modjk on windows apache mpm_winnt(i'am 
> not using windows for fun...)
> as i understand the documentation
> my worker.template.connection_pool_size=200 must be adequate with he the
> ThreadsPerChild    in the windows mpm
> i have 5 tomcats servers with 200 thread in modjk param
> and  i fix the apache ThreadsPerChild   to 1400 .
> so the idea is 1000 thread  can work with tomcat and  400 dedicated only to
> static content
> my question are
> -my understanding of mod jk connection_pool_size is correct ?
> -i found very few doc on the winnt_mpm tunning ,is the  1400 value for 
> ThreadsPerChild  is a correct value(the server is good boy cpu*2/2GB ram)

For Apache the connection_pool_size can be determined automatically by
mod_jk. You can check that by starting Apache with JkLogLevel debug
(don't do that in normal production) and look for a line like "setting
connection pool size to" in the JkLogFile. You should find the same size
in that log line, that you used for ThreadsPerChild. Make sure you use a
recent mod_jk version, like 1.2.27.

Concerning the amount of threads in Tomcat and in Apache. The basic
problem is, that whenever you have more threads in Apache than in one of
your Tomcats, it could happen, that one of those threads will not be
able to connect to Tomcat, because all Tomcat threads might be busy.
Then you'll run into a timeout. You can make that less likely, by using
connection_pool_size equals to your Tomcat thread size and not equal to
the bigger ThreadsPerChild. But that would only mean, that the problem
already happens inside Apache (an Apache thread will not be able to
aquire a local pool object) and will be determined faster.

Another possibility is to use the additional Tomcat Native connector,
which decouples threads from connections on the Tomcat side.

In general all this comes into play when things go bad, e.g. your
application beacomes slow or gets stuck in Tomcat. Then requests pile up
in front and your whole system can get unresponsive. Therefore it is
very important to set good timeout values for mod_jk (see the mod_jk
timeouts documentation page).

I would expect, that you will get the most robust system by setting your
ThreadsPerChild also to 200 and using good mod_jk timeouts. This sounds
strange, but in general your bottleneck is not the number of threads. If
it is a throughput type application, you will saturate your CPU (or
bandwidth or memory) much earlier than you'll saturate a 200 threads
thread pool. The number of threads only gets limiting, once your
application gets slow. But in that case it doesn't help to accept more
and more request and put them on threads.

Rule of Thumb:

   Concurrency = Throughput * ResponseTime

Concurrency: Number of threads actually in parallel use
Throughput: Number of Requests per second (load)
ResponseTime: Average Response Time in seconds

So you only need a lot of threads, when your load is excessively high,
or your response times are, e.g. when allowing huge downloads over slow
lines.

Example: How many threads do you need for static content?
Assumption: Request rate 500 requests per second, average response time
50 milliseconds. Then on average you'll need 25 threads for static content.

Example: How many threads for dynamic content=
Assumption: Request rate 50 requests per second, average response time 3
seconds. Then on average you'll need 150 threads for dynamic content.

Regards,

Rainer

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to