[...]
> I'm a bit surprised that Tomcat needs so many processes per instance,

This is because of Linux kernel and JVM design, not Tomcat. AFAIK you can't
do fork() in Java, but instead you have threads. However Linux kernel only
recognizes processes, not threads (that is: stable Linux threads packages
are pure user space threads). People that do JVMs decided to implement Java
threads as Linux processes to achieve load balancing on multiCPUs
architectures.

Why? Look: If you would have 2 CPUs, and Java threads implemented as Linux
threads - then you would have only one CPU dealing with your application,
and other CPU beeing idle all the time. Since Java threads are implemented
as Linux processes - they are distributed on two CPUs. This creates also
other problem - fork() is much slower than pthread_create() which is
probably one of reasons behind not-so-good Linux JVM performance.

Some JDKs (AFAIK IBM) had option to switch between green threads (Java
threads mapped to fork()) and native threads (Java threads mapped to Linux
threads). I think that IBM was first to point that Linux kernel doesn't
recognize threads, and also supplied a beta patch for Linux kernel. So far
it doesn't have effect on Linux kernel gurus (which value stability over
functionality, and threads tends to introduce some complexity, which leads
to errors...)

Try to find other JDK (IBM, blackdown.org, kaffe.org) and see if there's a
native threads switch. Be sure to look at
http://www.ibm.com/developerworks/java/ for articles related Java and
Linux. You might be able to get more information there.

> and also that the Linux/Apache config is brought to its knees if you hit
the
> maximum number of processes?

This is quite strange. It might be that you didn't hit maximum number of
processes, but run out of some other resource like file descriptors. Apache
(when reaching MaxClients) usually is locking down clients (makes them
wait) and outputs to ErrorLog warning message about raising MaxClients
directive.
 
> Next step, I guess, is to look into recompiling Apache with a higher
> number
> of processes specified. Not much fun for a rookie

This is easy... just find HARD_SERVER_LIMIT in httpd.h and raise it to
whatever you'll find necesary. Like I said: this just might not be the
problem...

-- 
Jacek Prucia
7bulls.com S.A.



Reply via email to