Mantis - Resin
Viewing Issue Advanced Details
3991 minor always 04-12-10 08:25 05-20-10 10:06
closed 3.1.10  
none 4.0.7  
0003991: Resin does not use more than 1 CPU
rep by: SHINOMIYA Nobuaki

related bug: [^]
 TestThread.class [^] (2,560 bytes) 05-05-10 00:01
 HttpTest.class [^] (2,984 bytes) 05-05-10 00:50 [^] (2,007 bytes) 05-05-10 02:09 [^] (1,753 bytes) 05-05-10 02:10

05-04-10 02:47   
Bad performance confirmed in 3.1.10 with quad core.
It's possible to fix in the 3.1.x without migrating to 4.0.x?
05-04-10 04:28   
More info.
Centos 5.4 32bits default install. Quad core CPU. 1GB RAM. Java Sun 1.6 rev18.
Under heavy load "top" only shows one core in use and others idle. In test application one thread used CPU at 100% and other requests to the server were served but very slowly (like with old green threads). Older server with Pentium 4HT+Resin 2.1+Java 1.4.2 worked better than new Xeon+Resin 3.1+1.6 under concurrency.

05-05-10 00:05   
Unable to reproduce error. Checked with this class and this jsp.
This jsp puts heavy cpu load in all cores and lets one free for resin. Resin works fine.

Then it's not true or only happens with resin jsp requests. Maybe a resin thread pooling problem?

<%@ page contentType="text/plain; charset=utf-8" language="java" import="" %>

int cpus=Runtime.getRuntime().availableProcessors();
int cores=cpus-1;
if (cores==0) cores=1;
out.println("threads to test="+cores);
java.util.Vector v=new java.util.Vector();
    for(int i=1;i<=cores;i++) {
      cputest.TestThread t=new cputest.TestThread(i,out);
    try {
    }catch(Exception err) {}
    for(int i=0;i<v.size();i++) {
      cputest.TestThread t=(cputest.TestThread)v.elementAt(i);

I will try with some http stress tool.

05-05-10 00:53   
Resin seems to work fine. Try HttpTest with a simple hello world jsp page.
First parameter it's the number of concurrent clients(threads).
Second parameter it's the time to test.
Third parameter it's the url

I launched 3-4 threads against my quad core and top showed all cpus in use. I think now that maybe it's not a bug

05-20-10 10:06   
Resin itself does not limit the number of cores or CPUs.

However, Resin 4.0.x has removed a good deal of synchronization blocks compared to Resin 3.1.x. By reducing the locking, Resin 4.0.x has improved the multi-cpu performance.

These changes cannot be made in Resin 3.1.x because it's not like a bug fix where you fix a few lines or code; it's a system-wide cleanup of locking code.