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

Reply via email to