[jboss-user] [JBossCache] - Performence
lior.dra
do-not-reply at jboss.com
Wed Sep 6 11:10:43 EDT 2006
Hi
I have been trying to use JbossCache 1.4 SP1, as a caching solution,
However I encounter performence issues,
I have not been able to write more then 1000 updates per sec, on a single node, and I need a solution able to write as many as 15,000 per sec.
I have been written a small test to demonstrate:
I have been using MR. Ben Wang's Address and Student classes, along with
../etc/META-INF/replSync-service.xml
I have compiled the classes with the aopc compiler.
the jboss-aop.xml file I am using is the one under the .../examples/PojoCache/ ....... .
Test setup 2 nodes:
Machine 1:
JVM 1.5.07
Fedora 5 linux.
1GM memory
Machine 2
JVM 1.5.07
Solaris 10 2GM memory
Use Case 1:
When I run this code unclustered I can update 12,000 times per second
Use Case 2:
When I run this code in a 2 node cluster the performence drops to something like 900 - 1200 updates per second.
Use Case 3:
When I run this code with the 's' param, one one node, meaning I have just one writer node, I get the same results: 900 - 1200 updates per second.
I have noticed that the CPU usage rises to 80 - 100 % even when the node is not writing / reading the cache.
What am I doing wring ?
is this the kind of performence I can expect?
According to the following link
http://wiki.jboss.org/wiki/Wiki.jsp?page=WhatShouldWeExpectOfThePojoCachePerformance I should be just fine, but the results I am getting is very far from it, whay is that ?
Thanks
Lior
my class is:
package com.protagonis.cache;
//import org.jboss.cache.Fqn;
//import org.jboss.cache.PropertyConfigurator;
//mport org.jboss.cache.aop.PojoCache;
import java.util.*;
import javax.naming.*;
import javax.transaction.*;
import org.jboss.cache.*;
import org.jboss.cache.aop.*;
import com.protagonis.test.utils.*;
public class ManualTestCacheJbossExample {
private static final String base_dir = "./etc/resources/configuration/";
private PojoCache tree;
public static void main(String[] argv) throws Exception {
ManualTestCacheJbossExample ct = new ManualTestCacheJbossExample();
ct.tree = ct.StartCache();
if (argv.length > 1)
if (argv[1].equals("s")) {
while (true) {
Thread.sleep(0, 10);
}
}
/*
* Timing.assertElapseTime(ct, "doAspect", new Object[] { new Integer(
* argv[0]).intValue(), }, 100000L);
*/
ct.doAspect(new Integer(argv[0]).intValue());
ct.tree.stop();
}
public ManualTestCacheJbossExample() {
}
public void doAspect(int howMany) {
try {
Student st1 = new Student();
st1.setSchool("school1");
st1.setName("Name1");
Address adr = new Address();
adr.setCity("city");
adr.setStreet("str");
adr.setZip(1);
st1.setAddress(adr);
Fqn fqn = Fqn.fromString("a/b");
int count = 1;
while (count < howMany) {
try {
Student std2 = (Student) tree.getObject(fqn);
if (std2 == null) {
tree.putObject(fqn, st1);
continue;
}
Address adr2 = std2.getAddress();
adr.setZip(adr.getZip() + 1);
if (count % 1000 == 0)
System.out
.println(" Count " + count + " Zip "
+ adr2.getZip() + 1 + " Name "
+ std2.getName());
} catch (Exception e) {
e.printStackTrace();
}
count++;
}
} catch (Exception e) {
e.printStackTrace();
}
}
public PojoCache StartCache() {
try {
InitJvm.init();
tree = new PojoCache();
PropertyConfigurator config = new PropertyConfigurator(); // configure
config.configure(tree, base_dir + "replSync-service.xml");
tree.setClusterName("Sample-Cluster");
tree.start(); // kick start the cache
Thread.sleep(5000);
return tree;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969769#3969769
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969769
More information about the jboss-user
mailing list