RE: Binding Tomcat Apps to Specific CPUs in Windows

2010-04-20 Thread Marsh, Geoffrey (NIH/CIT) [E]
That is helpful. Thanks Chris.

-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Sent: Tuesday, April 20, 2010 1:10 PM
To: Tomcat Users List
Subject: Re: Binding Tomcat Apps to Specific CPUs in Windows

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Geoff,

On 4/19/2010 5:42 PM, Marsh, Geoffrey (NIH/CIT) [E] wrote:
 Good evening. I would like to bind a specific application within
 Tomcat to a specific CPU or pair of CPUs on a Windows Server.

To follow-up on Andre's reply: you cannot control this from within
Java/your webapp itself: you'll have to do this externally. There are
several reasons for this.

First, I don't believe there's a CPU-oriented API available to Java, so
you can't give threads hints about which CPU to use (affinity is the
term with which I am most familiar).

Second, thread pools are shared across all webapps in a single
Service, so you really can't segregate a single webapp.

If you really want a particular webapp to have a certain CPU affinity,
you'll need to:

1. Create a separate Tomcat environment (see the Advanced section in
RUNNING.txt that came with your TC package).
2. Deploy only that single webapp onto that Tomcat instance.
3. When launching that Tomcat instance, set the processor affinity for
the JVM that you use with Tomcat.
4. (optional) Use a web server or load balancer to front Tomcat to
direct requests from (say) port 80 to port xyz where your webapp is
really being hosted.

Hope that helps,
- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvN3/MACgkQ9CaO5/Lv0PCcCACePp6WnNajT3/KPQ4Uj44GuTvs
HRoAnjpDfKcZfpe74k7hXRwYYZDTuuag
=qvzm
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Binding Tomcat Apps to Specific CPUs in Windows

2010-04-19 Thread André Warnier

Marsh, Geoffrey (NIH/CIT) [E] wrote:

Good evening. I would like to bind a specific application within Tomcat to a 
specific CPU or pair of CPUs on a Windows Server.


I don't think you can.
An application within Tomcat is not a separate process.  Even Tomcat is 
not a process, from the OS's point of view. The JVM (Java Virtual 
Machine) running Tomcat is the process.
So you would have to run a separate JVM, with a separate Tomcat, running 
that webapp only, to do what you want to do.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Binding Tomcat Apps to Specific CPUs in Windows

2010-04-19 Thread Marsh, Geoffrey (NIH/CIT) [E]
Thanks Andre. That makes sense. I appreciate the quick reply.

-Original Message-
From: André Warnier [mailto:a...@ice-sa.com] 
Sent: Monday, April 19, 2010 5:48 PM
To: Tomcat Users List
Subject: Re: Binding Tomcat Apps to Specific CPUs in Windows

Marsh, Geoffrey (NIH/CIT) [E] wrote:
 Good evening. I would like to bind a specific application within Tomcat to a 
 specific CPU or pair of CPUs on a Windows Server.
 
I don't think you can.
An application within Tomcat is not a separate process.  Even Tomcat is 
not a process, from the OS's point of view. The JVM (Java Virtual 
Machine) running Tomcat is the process.
So you would have to run a separate JVM, with a separate Tomcat, running 
that webapp only, to do what you want to do.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org