3 Replies Latest reply on Jul 30, 2005 1:04 PM by treespace

    Setting Processor Affinity

      We are running multiple JVMs on a dual CPU box. Each is running the same application under JBoss so they are sharing the same code and within a JVM sharing a lot of application data.

      Best practice seems to indicate that multi-threaded applications should set processor affinity to keep the threads for a given JVM pinned down to one processor and also to ensure that each machine (load balanced) is pinned to its own CPU (or two virtual CPUs in the case of a hyperthreaded Intel chip).

      http://www.linuxjournal.com/node/6799/print

      Can anybody confirm or deny whether this is a good or bad idea running JBoss. Again, many threads, two JVMs, same code, same data, all running in parallel.

      TIA

        • 1. Re: Setting Processor Affinity

          Correction: keep one JVM pinned to a range of CPUs from one to several. Main point is each JVM has its own resources to retain cache and minimize memory contention.

          • 2. Re: Setting Processor Affinity
            starksm64

            I don't believe that in general j2ee type of apps have sufficient locality of cache references, especially as the number of user increases, for this to make a difference. The only way to know for sure if this has any effect is to benchmark it.

            • 3. Re: Setting Processor Affinity

              Agreed, need metrics from production system or a reasonable fax. Pinning each JVM in a multiple JVM configuration with many threads per JVM may be beneficial but the proof of the pudding is in the eating as they say.