RE: Strange number of processes....

2003-12-10 Thread Ralph Einfeldt
First of all keep in mind that it aren't processes, they are 
threads. As the threads share the same memory they do not 
use much additionals memory (some memory for the thread local
objects and the thread stack and so on)

I can't explain all your numbers.

- Even the simplest java program has more than one thread.
  Depending on the vendor and the vm version you may have 
  several threads. (Mine has 'Finalizer', 'Reference Handler',
  'Suspend Checker Thread', 'VM Periodic Task Thread', 
  'VM Thread', 'Signal Dispatcher' and 'main')

- Tomcat uses some threads as monitors. The number of monitors 
  depends on the tomcat version and the services you enable/disable

- There might be no relation between minProcessors and the number
  of threads, as it's tomcat's choice if and when additional threads
  are created (which may be stored in a thread pool for later reuse).

- If you set minProcessors = maxProcessors this might give a better 
  relation to the number of threads but there is no contract that
  enforces tomcat (or any other servlet container) to limit it self
  to a certain amount of threads.

- If you want to know what the threads are doing, you can issue a 
  'kill -QUIT ' and look at the stacktrace in catalina.out. 
  (the thread names give a good hint about purpose)

> -Original Message-
> From: Scott Queen [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, December 10, 2003 2:12 AM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Strange number of processes
> 
> 
> Ok I'm running Tomcat 4.1.18 as a standalone server on a Linux box.
> I've configured 6 virtual hosts in the Tomcat-Standalone 
> server having a
> non-SSL Coyote HTTP/1.1 Connector (probably obvious) and a Coyote/JK2
> AJP 1.3 Connector (I don't think this is used, but I'm not
> sureunfortunately reveals my lack of experise!).
> 
> I'm confused with the number of java processes spawned when I start
> Tomcat.  Here is what I see:
>  # of initial
> minProcessors |  maxProcessors |  java processes | comments
>1   |  1   | 25
>   | can't
> get a page
>1   |  2   | 27
>   | pages
> served to 1 session
>2   |  4   | 31
>4   |  4   | 31  | slow
> response, 1 session at a time
>4   |  7   | 31  | 3
> sessions respond, 4 add'l java procs created
>5   |  7   | 31  | same
> as above
>4   | 20  | 31  | 5
> sessions respond (all tested), 9 add'l java procs 
> 
> So. First question:  why are there so many java processes when I
> specify only a few minProcessors (i.e. 1 minProc, 1 maxProc, 6 virtual
> hosts - I would expect 6 java sessions)?  Second question: 
> why isn't the
> number of initial java processes a linear relationship relative to the
> number of minProcessors specified?
> 
> I'm concerned about this because in the end, only about half the
> processes are ever used, but they all take up a significant amount of
> memory.  How do I reduce the memory utilization?
> 
> Thanks,
> Scott Queen
> 

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



Strange number of processes....

2003-12-09 Thread Scott Queen
Ok…. I'm running Tomcat 4.1.18 as a standalone server on a Linux box.
I've configured 6 virtual hosts in the Tomcat-Standalone server having a
non-SSL Coyote HTTP/1.1 Connector (probably obvious) and a Coyote/JK2
AJP 1.3 Connector (I don't think this is used, but I'm not
sure….unfortunately reveals my lack of experise!).

I'm confused with the number of java processes spawned when I start
Tomcat.  Here is what I see:
 # of initial
minProcessors |  maxProcessors |  java processes | comments
   1   |  1   | 25  | can't
get a page
   1   |  2   | 27  | pages
served to 1 session
   2   |  4   | 31
   4   |  4   | 31  | slow
response, 1 session at a time
   4   |  7   | 31  | 3
sessions respond, 4 add'l java procs created
   5   |  7   | 31  | same
as above
   4   | 20  | 31  | 5
sessions respond (all tested), 9 add'l java procs 

So….. First question:  why are there so many java processes when I
specify only a few minProcessors (i.e. 1 minProc, 1 maxProc, 6 virtual
hosts - I would expect 6 java sessions)?  Second question: why isn't the
number of initial java processes a linear relationship relative to the
number of minProcessors specified?

I'm concerned about this because in the end, only about half the
processes are ever used, but they all take up a significant amount of
memory.  How do I reduce the memory utilization?

Thanks,
Scott Queen


Re: Number of processes and relationship to mod_jk, Apache, tomcat

2003-10-28 Thread Christopher Schultz
Andrew,
I am trying to understand the relationship between applications in Tomcat,
the number of Tomcat processes, Apache mod_jk and the number of threads.

Apache: lsof -i tcp:80 | wc -l
This gives me 12 processes listening to port 80 (I checked these are related
to the number of Apache instances)
You should be able to predict this from the httpd.conf file. Do the 
numbers add up for Apache?

Tomcat direct port: lsof -i tcp:8080 | wc -l
This gives me 50 process that also correspond to the number of tomcat
instances running(i.e. the number of java instances I see in ps )
What UNIX flavor are you running? I know that in old versions of Linux, 
each pthread was shown as a separate process. Thus, it looked like many 
processes (really threads) all held the same resource. For example, they 
all had the same resident memory footprint (because the memory is 
shared) and they all were bound to the same ports.

In the later versions (mine being one of them, I've got kernel 2.4.20), 
they only show up as one process. Thus, I get this output:

[EMAIL PROTECTED] ]# /usr/sbin/lsof -i tcp:8009
COMMAND  PID   USER   FD   TYPE DEVICE SIZE NODE NAME
java9313 tomcat   15u  IPv4  69785   TCP *:8009 (LISTEN)
[EMAIL PROTECTED] ]#
I'm guessing that you're getting multiple lines that all look like this. 
Is this accurate? Only one process can bind to a port at any given time, 
so multiple processes (even with separate pids) might appear to be bound 
to that port.

Tomcat mod_jk port:
lsof -i tcp:8009 | wc -l
gives me 550
Again, see the discussion of the threads/processes above.

Also note that you may have many more threads that you thought you 
would. I recall that each (non-"nio") stream in Java requires a separate 
thread, so System.in, System.out, and System.err already give you three 
threads. Then, you've got the main thread, plus the thread pool to serve 
requests from remote clients. That may be large, although having that 
number higher than your Apache request processor limit is probably a waste.

Now I know that these numbers will change depending on load but I am trying
to understand the relationship.
Well, some numbers should not change. For example, there should be a 
hard limit on the number of Apache threads/processes running. You can 
tune that in httpd.conf.

For the Java process, it's harder to predict because of the way the VM 
retires threads and when your server is creating them. Ideally, new 
threads wouldn't be created at all because there would be a closed 
thread pool (unless you have a min and max thread pool size and the 
number of threads depends on load).

So my questions is how do the numbers relate to each other?
The number of Apache processes is usually completely unrelated to the 
java process counts (except that there will be more java threads than 
Apache processes :).

How does this effect performance?
Most of the "processes" are very lightweight. Apache is a lean, mean, 
web-serving machine so don't worry about that. What you should worry 
about is if your thread count continually goes up and never comes back 
down. You'd have a nasty resource leak, then. If you avoid creating your 
own threads in your web application (which you should be avoiding 
anyway), you're generally okay.

-chris

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


Number of processes and relationship to mod_jk, Apache, tomcat

2003-10-28 Thread Andrew Panagos
I am trying to understand the relationship between applications in Tomcat,
the number of Tomcat processes, Apache mod_jk and the number of threads.

For instance on a system I have the following
Apache 1.3.28, Tomcat 4.1.27, Java 1.4.2_02
I use the follow commands to see what is listening to different ports to get
an idea of what process or threads are running.
Apache: lsof -i tcp:80 | wc -l
This gives me 12 processes listening to port 80 (I checked these are related
to the number of Apache instances)

Tomcat direct port: lsof -i tcp:8080 | wc -l
This gives me 50 process that also correspond to the number of tomcat
instances running(i.e. the number of java instances I see in ps )

Tomcat mod_jk port:
lsof -i tcp:8009 | wc -l
gives me 550

I have included my condensed jk.properties and workers.properties files at
the end if that may help.
Now I now that these numbers will change depending on load but I am trying
to understand the relationship.

So my questions is how do the numbers relate to each other?
How does this effect performance?
How could I tune these numbers?

Now I have a vague understanding of how these relate but the numbers don't
add up for me. I have read the docs and searched for quite a while for a
better description.

Thanks

FILE: jk.properties

###
LoadModule jk_module libexec/mod_jk.so
JkWorkersFile /usr/local/tomcat/conf/workers.properties
JkLogFile /usr/local/tomcat/logs/mod_jk.log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat "%w %V %U %T %b"

## /examples1
Alias /examples1 /usr/local/tomcat/webapps/examples1

AllowOverride None
deny from all

JkMount /examples1/* worker1

## /ctrials
Alias /ctrials /usr/local/tomcat/webapps/ctrials

AllowOverride None
deny from all

JkMount /ctrials/* worker1

## /syndication
Alias /syndication /usr/local/tomcat/webapps/syndication

AllowOverride None
deny from all

JkMount /syndication/* worker1

## /fellowship
Alias /fellowship /usr/local/tomcat/webapps/fellowship

AllowOverride None
deny from all

JkMount /fellowship/* worker1

## /test
Alias /test /usr/local/tomcat/webapps/test

AllowOverride None
deny from all

JkMount /test/* worker1

# All jsp go to worker1
JkMount /*.jsp worker1
# All servlets goes to worker1
JkMount /*/servlet/ worker1


##

FILE: workers.properties

##
# Define some properties
workers.apache_log=/usr/local/apache/logs/
workers.tomcat_home=/usr/local/tomcat
workers.java_home=/usr/local/java/
ps=/

# Define workers
worker.list=worker1
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
worker.worker1.lbfactor=1
#worker.worker1.cachesize=10
#worker.worker1.cache_timeout=300
worker.worker1.socket_keepalive=1
worker.worker1.socket_timeout=300

# how many ms to wait for PONG after sending a PING for connection
worker.worker1.connect_timeout=2000
# how many ms to wait for PONG after sending a PING before posting data
worker.worker1.prepost_timeout=2000
# how long to wait for a reply after sending data before server considers
connection dead
worker.worker1.reply_timeout=180


##


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



Re: Number of Processes

2003-07-07 Thread Kwok Peng Tuck
Try 'ps -elfm' ; the 'm' will show the other threads.
You can also achieve the same thing with top by using the 'H' command.
Shannon Scott wrote:

Hello,
I have noticed that tomcat uses only one process on my new redhat 8.0 machine.
( ps -elf | grep tomcat )
There is an interesting explanation here.
http://marc.theaimsgroup.com/?l=tomcat-user&m=103762836306068&w=2

So I wrote a short test_process.jsp page ( below ) that I thought would force another process, but I still only show one when I try to open the page with multiple browsers.  
Does anyone have a way to force another process to begin?

Could something in my configuration not allow other processes?
I have set the minProcessors=5 in my server.xml Connector.
Linux RedHat 8.0
Apache 2.0.43 ( mod_jk )
Tomcat 4.1.24
Any help is greatly appreciated.
Thank You.
Shannon
test_process.jsp:
<%@ page session="false" %> 
<% 
Thread.sleep(1);
out.print(" Done... "); 
%> 

 



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


Re: Number of Processes

2003-07-07 Thread John Smith
Can you point out the JVM version you are using. on Redhat 7 and 8.

John

[EMAIL PROTECTED] 7/8/2003 1:03:56 AM >>>
As far as I understand it, top and ps changed in Redhat due to the
confusion of processes vs. threads. I am not positive that this is the
case, but you might just look up the CHANGE docs for the package that
supplies Redhat's ps and top (probably two different RPMs).
Ben Ricker
Wellinx.com
On Mon, 2003-07-07 at 12:38, Shannon Scott wrote:
Thank You for helping, but I still think I am having a threading problem.
I read here:
http://marc.theaimsgroup.com/?l=tomcat-user&m=104378596024043&w=2 that "On 
linux, the top command displays every java thread as a separate
line item."

On my Linux Redhat 7.2 machine I get several listed with the top ( and ps )
command, but on my redhat 8.0 machines I only get 1 listed with the top (
and ps ) command.
Does anyone understand this behavior?
Thanks again.
Shannon
- Original Message -
From: "Tim Funk" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Monday, July 07, 2003 11:56 AM
Subject: Re: Number of Processes
> The JVM is one process. One process with many threads. minProcessors!=OS
> processes.
>
> minProcessors == number of concurrent workers at any given point in time
>
> -Tim
>
> Shannon Scott wrote:
> > Hello,
> > I have noticed that tomcat uses only one process on my new redhat 8.0
machine.
> > ( ps -elf | grep tomcat )
> > There is an interesting explanation here.
> >
> > http://marc.theaimsgroup.com/?l=tomcat-user&m=103762836306068&w=2 > >
> > So I wrote a short test_process.jsp page ( below ) that I thought 
would
force another process, but I still only show one when I try to open the 
page
with multiple browsers.
> > Does anyone have a way to force another process to begin?
> >
> > Could something in my configuration not allow other processes?
> > I have set the minProcessors=5 in my server.xml Connector.
> >
> > Linux RedHat 8.0
> > Apache 2.0.43 ( mod_jk )
> > Tomcat 4.1.24
> >
> > Any help is greatly appreciated.
> > Thank You.
> > Shannon
> >
> > test_process.jsp:
> > <%@ page session="false" %>
> > <%
> > Thread.sleep(1);
> > out.print(" Done... ");
> > %>
> >
> >
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED] > For 
additional commands, e-mail: [EMAIL PROTECTED] >
>

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




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
Watch Hallmark. Enjoy cool movies. 
http://server1.msn.co.in/sp03/hallmark/index.asp Win hot prizes!

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


Re: Number of Processes

2003-07-07 Thread Ben Ricker
As far as I understand it, top and ps changed in Redhat due to the
confusion of processes vs. threads. I am not positive that this is the
case, but you might just look up the CHANGE docs for the package that
supplies Redhat's ps and top (probably two different RPMs).

Ben Ricker
Wellinx.com

On Mon, 2003-07-07 at 12:38, Shannon Scott wrote:
> Thank You for helping, but I still think I am having a threading problem.
> I read here:
> http://marc.theaimsgroup.com/?l=tomcat-user&m=104378596024043&w=2
> that "On linux, the top command displays every java thread as a separate
> line item."
> 
> On my Linux Redhat 7.2 machine I get several listed with the top ( and ps )
> command, but on my redhat 8.0 machines I only get 1 listed with the top (
> and ps ) command.
> Does anyone understand this behavior?
> Thanks again.
> Shannon
> 
> - Original Message -
> From: "Tim Funk" <[EMAIL PROTECTED]>
> To: "Tomcat Users List" <[EMAIL PROTECTED]>
> Sent: Monday, July 07, 2003 11:56 AM
> Subject: Re: Number of Processes
> 
> 
> > The JVM is one process. One process with many threads. minProcessors!=OS
> > processes.
> >
> > minProcessors == number of concurrent workers at any given point in time
> >
> > -Tim
> >
> > Shannon Scott wrote:
> > > Hello,
> > > I have noticed that tomcat uses only one process on my new redhat 8.0
> machine.
> > > ( ps -elf | grep tomcat )
> > > There is an interesting explanation here.
> > >
> > > http://marc.theaimsgroup.com/?l=tomcat-user&m=103762836306068&w=2
> > >
> > > So I wrote a short test_process.jsp page ( below ) that I thought would
> force another process, but I still only show one when I try to open the page
> with multiple browsers.
> > > Does anyone have a way to force another process to begin?
> > >
> > > Could something in my configuration not allow other processes?
> > > I have set the minProcessors=5 in my server.xml Connector.
> > >
> > > Linux RedHat 8.0
> > > Apache 2.0.43 ( mod_jk )
> > > Tomcat 4.1.24
> > >
> > > Any help is greatly appreciated.
> > > Thank You.
> > > Shannon
> > >
> > > test_process.jsp:
> > > <%@ page session="false" %>
> > > <%
> > > Thread.sleep(1);
> > > out.print(" Done... ");
> > > %>
> > >
> > >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


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



Re: Number of Processes

2003-07-07 Thread Shannon Scott
Thank You for helping, but I still think I am having a threading problem.
I read here:
http://marc.theaimsgroup.com/?l=tomcat-user&m=104378596024043&w=2
that "On linux, the top command displays every java thread as a separate
line item."

On my Linux Redhat 7.2 machine I get several listed with the top ( and ps )
command, but on my redhat 8.0 machines I only get 1 listed with the top (
and ps ) command.
Does anyone understand this behavior?
Thanks again.
Shannon

- Original Message -
From: "Tim Funk" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Monday, July 07, 2003 11:56 AM
Subject: Re: Number of Processes


> The JVM is one process. One process with many threads. minProcessors!=OS
> processes.
>
> minProcessors == number of concurrent workers at any given point in time
>
> -Tim
>
> Shannon Scott wrote:
> > Hello,
> > I have noticed that tomcat uses only one process on my new redhat 8.0
machine.
> > ( ps -elf | grep tomcat )
> > There is an interesting explanation here.
> >
> > http://marc.theaimsgroup.com/?l=tomcat-user&m=103762836306068&w=2
> >
> > So I wrote a short test_process.jsp page ( below ) that I thought would
force another process, but I still only show one when I try to open the page
with multiple browsers.
> > Does anyone have a way to force another process to begin?
> >
> > Could something in my configuration not allow other processes?
> > I have set the minProcessors=5 in my server.xml Connector.
> >
> > Linux RedHat 8.0
> > Apache 2.0.43 ( mod_jk )
> > Tomcat 4.1.24
> >
> > Any help is greatly appreciated.
> > Thank You.
> > Shannon
> >
> > test_process.jsp:
> > <%@ page session="false" %>
> > <%
> > Thread.sleep(1);
> > out.print(" Done... ");
> > %>
> >
> >
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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



Re: Number of Processes

2003-07-07 Thread Tim Funk
The JVM is one process. One process with many threads. minProcessors!=OS 
processes.

minProcessors == number of concurrent workers at any given point in time

-Tim

Shannon Scott wrote:
Hello,
I have noticed that tomcat uses only one process on my new redhat 8.0 machine.
( ps -elf | grep tomcat )
There is an interesting explanation here.
http://marc.theaimsgroup.com/?l=tomcat-user&m=103762836306068&w=2

So I wrote a short test_process.jsp page ( below ) that I thought would force another process, but I still only show one when I try to open the page with multiple browsers.  
Does anyone have a way to force another process to begin?

Could something in my configuration not allow other processes?
I have set the minProcessors=5 in my server.xml Connector.
Linux RedHat 8.0
Apache 2.0.43 ( mod_jk )
Tomcat 4.1.24
Any help is greatly appreciated.
Thank You.
Shannon
test_process.jsp:
<%@ page session="false" %> 
<% 
Thread.sleep(1);
out.print(" Done... "); 
%> 




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


Number of Processes

2003-07-07 Thread Shannon Scott
Hello,
I have noticed that tomcat uses only one process on my new redhat 8.0 machine.
( ps -elf | grep tomcat )
There is an interesting explanation here.

http://marc.theaimsgroup.com/?l=tomcat-user&m=103762836306068&w=2

So I wrote a short test_process.jsp page ( below ) that I thought would force another 
process, but I still only show one when I try to open the page with multiple browsers. 
 
Does anyone have a way to force another process to begin?

Could something in my configuration not allow other processes?
I have set the minProcessors=5 in my server.xml Connector.

Linux RedHat 8.0
Apache 2.0.43 ( mod_jk )
Tomcat 4.1.24

Any help is greatly appreciated.
Thank You.
Shannon

test_process.jsp:
<%@ page session="false" %> 
<% 
Thread.sleep(1);
out.print(" Done... "); 
%> 



RE: Number of processes growing.

2001-11-14 Thread Laurent Michenaud

Hi,

Code already checked.
Debug information in our pool.log is ok too.

Note that the server is able to run ok during 4-5 hours without any
problems.

a+


-Message d'origine-
De : Thomas Rickal, IOP Unternehmensberatung GmbH
[mailto:[EMAIL PROTECTED]]
Envoyé : mercredi 14 novembre 2001 15:23
À : 'Tomcat Users List'
Objet : AW: Number of processes growing.


Hi Michenaud,

maybe not all of your connections are freed so that users open new
connections although there are "should be free connections" in your
connection pool. Check your code.

Thomas

--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>




AW: Number of processes growing.

2001-11-14 Thread Thomas Rickal, IOP Unternehmensberatung GmbH

Hi Michenaud,

maybe not all of your connections are freed so that users open new
connections although there are "should be free connections" in your
connection pool. Check your code.

Thomas



winmail.dat
Description: application/ms-tnef

--
To unsubscribe:   
For additional commands: 
Troubles with the list: 


Number of processes growing.

2001-11-14 Thread Laurent Michenaud

Hi,

Our web server :
Apache 1.3.14
Tomcat 3.2.3
Oracle 8.1.6 with Jdbc Thin drivers

We've got the following problem ( appearing about 10 times per day )
- The number of request on port 80 is stable( between 15-25 )
- The number of apache threads suddenly grows ( from 30 to 100 )
- The number of request on port 8009 suddently grows too ( from 50 to
190 )
- Our pool connection suddendly grows too ( from 3-4 connections to 80
max connections )

It cannot be an extern attack because the number of requests on port 80
is stable.
It seems that there is a bug somewhere.
Connections to database are not released( Pool is filled ). 
Tomcat and Apache processes are not released too even if the client
disconnected.

We only restart Tomcat to return to a stable status.

In attachment, a jpeg picture that shows a crash ( lines represent the
number of request on
port 80, on port 8009 and the number of process httpd ).

Can u help ?
 <> 

Michenaud Laurent
- Adeuza -
[ Développeur Web - Administrateur Réseau ]




crash.gif
Description: crash.gif

--
To unsubscribe:   
For additional commands: 
Troubles with the list: