I ran into a similar problem,
On an older version of Resin, the performance was not what I expected from a
dual cpu. By creating two instances of Resin and under Windows, tying each
one to a cpu by setting the affinity, we were able to get the performance I
had expected. I thought I had heard that the latest JDK's had fixes for some
of these issues.

MC

-----Original Message-----
From: resin-interest-boun...@caucho.com
[mailto:resin-interest-boun...@caucho.com]on Behalf Of Mattias Jiderhamn
Sent: Tuesday, March 17, 2009 4:08 AM
To: Resin
Subject: [Resin-interest] Resin on multiple CPUs


Is there anyone that is running Resin on multiple CPUs that could tell
me if you did some special configuration to get this going?

We are currently running Resin 3.1.8 under Red Hat Enterprise Linux 5.3
and we are evaluating using multi CPU servers for running Resin, but it
just doesn't work.
When running standalone Java applications we get multi CPU use,
confirmed with both "sar" and the test class below. When running the
same test (in a JSP) under Resin only one CPU is used.
Why??? Is there some additional configuration we have to do?
(It shouldn't be a licensing issue since we have a 4 CPU evaluation license)

import java.lang.management.*;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicLong;

public class MultiCoreTester {
  private static final int THREADS = 8;
  private static CountDownLatch ct = new CountDownLatch(THREADS);
  private static AtomicLong total = new AtomicLong();

  public static void main(String[] args) throws InterruptedException {
    long elapsedTime = System.nanoTime();
    for (int i = 0; i < THREADS; i++) {
      Thread thread = new Thread() {
        public void run() {
          total.addAndGet(measureThreadCpuTime());
          ct.countDown();
        }
      };
      thread.start();
    }
    ct.await();
    elapsedTime = System.nanoTime() - elapsedTime;
    System.out.println("Total elapsed time " + elapsedTime);
    System.out.println("Total thread CPU time " + total.get());
    double factor = total.get();
    factor /= elapsedTime;
    System.out.printf("Factor: %.2f%n", factor);
  }

  private static long measureThreadCpuTime() {
    ThreadMXBean tm = ManagementFactory.getThreadMXBean();
    long cpuTime = tm.getCurrentThreadCpuTime();
    double junk = 1;
    for (int j = 0; j< 18; j++) {
      for (int i = 0; i < 100000 * 1000 * 1000; i++) {
        // keep ourselves busy for a while ...
        junk = junk + i-i;
      }
    }
    System.out.println("junk = " + junk);
    cpuTime = tm.getCurrentThreadCpuTime() - cpuTime;
    System.out.println(Thread.currentThread() + ": cpuTime = " + cpuTime);
    return cpuTime;
  }
}

--

  </Mattias>



_______________________________________________
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.0.237 / Virus Database: 270.11.15/2004 - Release Date: 03/16/09
07:04:00




_______________________________________________
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

Reply via email to