[JBoss Cache: Core Edition] - Stress Tests
by lovelyliatroim
Ok I have been doing a bit of stress testing on my side. I have a scenario where my client has asked me to see if it is possible. Scenario is as follows, they current have at peak time 1500 pushes/writes a second going on in there DB. This 1500 writes a occurs on a data size of about 300,000 records. Due to re-design in their architecture they want to move this feed out of their DB.
Ive been asked to see if it is feasible to push it into there cache.
So following is used in the simulation Tomcat 6.0.13,JDK 1.6.0_06 and Jboss Cache 2.1.0
I created a local cache with 300,000 records. Code looks like so
| public void handleRequest(HashMap params, OutputStream out) {
| // TODO Auto-generated method stub
| //Create the cache on the first call and load it with records
| if(cache == null){
| cache = CacheManager.createCache("RealTime", "realtime-cache.xml");
| for(int i = 0; i < noOfRecords;i++){
| Map record = createQuoteMap();
| String path = "/"+ i+ "/" + i +"/" +i ;
| Fqn nodePath = Fqn.fromString(path);
| cache.put(nodePath, "item", record);
| if(i%500 == 0){
| log.debug("Currently at Index"+i);
| }
| }
| log.debug("Set up cache with "+noOfRecords +" records in the cache");
|
| }
|
| requestCounter++;
|
| String action= RequestUtil.getString("action", params);
| int index = generator.nextInt(noOfRecords);
| String path = "/"+ index+ "/" + index +"/" + index ;
| Fqn nodePath = Fqn.fromString(path);
|
| try {
| if(action == null || action.compareTo("add") == 0){
| Map record = createQuoteMap();
| cache.put(path, "item", record);
| writeCounter++;
| }else{
| //read operation
| Map record = (Map)cache.get(nodePath, "item");
| path = path +"\n";
| out.write(path.getBytes());
| DebugUtil.dumpMap(record, new PrintStream(out));
| out.close();
| readCounter++;
| }
|
| if(requestCounter%1000 == 0){
| log.debug("Read = "+readCounter + " Write = "+writeCounter);
| }
| } catch (IOException e) {
| // TODO Auto-generated catch block
| e.printStackTrace();
| }
| }
|
JMeter was set up to generate requests. Tests carried out on my local machine, Xp professional,2g ram, VM given 1G. VM is warmed up before recording begins.
Results are like so
Test Case Duration No of Read Clients No of Write/Update Threads No of Reads No of Updates/Writes Throughput Reads (sec) Throughput Updates/Writes(sec) Isolation Level Comments
Reading and Writing 1 Hour 10 10 1,889,946 1,754,769 525/sec 487.4/sec NONE 39% error recorded in JMeter for updates and 36% error recorded as well for reads.Heap size between 100-175MB
Reading and Writing 1 Hour 10 10 5,741,899 5,974,218 1,594/sec 1,659/sec READ_UNCOMMITTED Heap size in between 300MB and 400MB range during processing. 0% error on both reading and writing.
Reading and Writing 30 Mins 10 10 2,940,466 3,046,956 1633.56/sec 1692.70/sec READ_UNCOMMITTED Heap size in between 300MB and 450MB range during processing. 0% error on both reading and writing.
Reading and Writing 30 Mins 10 10 728,026 743353 404.45/sec 412.95/sec NONE Heap size in between 100MB and 175MB range during processing. 44% error on reads and 43% on the writes.
-
Writing 30 mins - 10 - 1,151,919 - 640/sec NONE 56% error reported during run
Writing 30 mins - 20 - 1,047,963 - 582.2/sec NONE 63% error reported during run
Writing 30 mins - 10 - 1,928,110 - 1071/sec READ_UNCOMMITTED 21% error reported during run. Heap size between 300-400MB during run.
-
Reading 30 mins 10 - 5,670,148 - 3150.1/sec - NONE 0% error reported during run
Reading 30 mins 10 - 5,443,498 - 3018/sec/sec - READ_UNCOMMITTED 0% error reported during run. Heap size ranges from 280-400MB
Reading 30 mins 20 - 5,313,351 - 2951.8/sec - NONE 0% error reported during run
Ok figures are taken from JMeters Summary report
http://jakarta.apache.org/jmeter/usermanual/component_reference.html#Summ....
Things that struck me are this
1. heap size difference, just by having a different isolation level from NONE to READ_UNCOMMITTED. I have seen this https://jira.jboss.org/jira/browse/JBCACHE-1383 and maybe that is playing a factor in this case. Will download latest CR version and see if it makes a difference. Heap Size when cache loaded with records in NONE mode was 100MB, when loaded in "READ_UNCOMIITED" 225MB. I possibly would have expected abit more in memory but not that much,its practically bigger than whats put in the cache.
2. Error % which is logged by JMeter, i tried to find their definition of what is classed as an error, unfortunately no such luck, best i could find was this definition " "Error % - Percent of requests with errors". So i will assume that this is possibly timeouts, maybe cache taking to long to write/read.
3. I would have thought that having an ISOLATION level of NONE would turn out to be quicker but apparently not. What goes on behind the scenes when its set to "NONE"?.
4. What I also found interesting was when in "READ_UNCOMMITTED" mode for just doing writes, I got 21% error back. Possibly contention to write to the same node?
Just thought Id post it, any feedback is welcome, any tips to improve throughput??
Thanks,
LL
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4166155#4166155
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4166155
17 years, 9 months
[JNDI/Naming/Network] - could not find datasource
by 1womps1
sorry my last post didn't show up here is my problem
i'm trying to install seam on tomcat,and i have a problem wich is blocking me,the server can't find the datasource,here is a part from the stacktrace
| GRAVE: Could not find datasource: java:/mysqlds
| javax.naming.NameNotFoundException: Le Nom mysqlds n'est pas lié àce Contexte
| at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
| at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
| at org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
| at javax.naming.InitialContext.lookup(Unknown Source)
| at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52)
| at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)|
|
i have created a file mysql-ds.xml in seam\bootstrap\deploy ,and deleted hsql-ds.xml since i'm working with mysql here is the file
| <datasources>
| <local-tx-datasource>
| <jndi-name>MySqlDS</jndi-name>
| <connection-url>jdbc:mysql://mysql-hostname:3306/jbossdb</connection-url>
| <driver-class>com.mysql.jdbc.Driver</driver-class>
| <user-name>x</user-name>
| <password>y</password>
| <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
| <!-- should only be used on drivers after 3.22.1 with "ping" support
| <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker</valid-connection-checker-class-name>
| -->
| <!-- sql to call when connection is created
| <new-connection-sql>some arbitrary sql</new-connection-sql>
| -->
| <!-- sql to call on an existing pooled connection when it is obtained from pool - MySQLValidConnectionChecker is preferred for newer drivers
| <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
| -->
|
| <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml -->
| <metadata>
| <type-mapping>mySQL</type-mapping>
| </metadata>
| </local-tx-datasource>
| </datasources>
|
|
could you please help me to figure out where is the problem
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4166149#4166149
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4166149
17 years, 9 months
[Beginners Corner] - JBoss classloading problem
by venuwin
Hi,
We have developed one web application which has to be deployed seperately for seperate clients.
say for example : customer X ,customer Y and customer Z are our clients.
we need to deploy three different build for all these 3 customers. Source code and package structure will be the same, but some XML files and images will differ. We have to have 3 different builds, all running on the same jboss server, but with different Context names and URLs.
The problem is here : when we deploy all these 3 war files, the class files which are repeated in all the 3 war files are loaded only once for all the 3 deployments. But our requirement is to load 3 different versions of class files , but with different state and data.
How do we force JBoss to load these classes again and again. Say if there are 10 customer, we need 10 builds, and the same classes should be loaded 10 times.
If we change the package names different in all the 3 war files, no issues. Working fine ..may be because all these classes have different absolute names, although the source is exactly the same .
Thanks in advance,
Venu
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4166147#4166147
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4166147
17 years, 9 months
[Management, JMX/JBoss] - MBeanServer.getDefaultDomain returns null
by vrsn-rbuck
When JBoss is run with these additional options, to expose JBoss MBean's in JConsole, application code that looks up the MBeanServer gets an NPE.
When one starts JBoss with the following options:
set JAVA_OPTS=%JAVA_OPTS% -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl
| set JAVA_OPTS=%JAVA_OPTS% -Djboss.platform.mbeanserver
| set JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote
|
which is detailed here on your site:
http://wiki.jboss.org/wiki/JBossMBeansInJConsole
Calls to server.getDefaultDomain() returns null when should not have. Here is my applications JMX helper:
public static MBeanServer getDefaultMBeanServer() {
| // detects if we are running from within jboss...
| MBeanServer server = findMBeanServer("jboss");
|
| // otherwise falls back to the default platform mbean server...
| if (server == null) {
| server = ManagementFactory.getPlatformMBeanServer();
| }
| return server;
| }
|
| private static MBeanServer findMBeanServer(String agentId) {
| List servers = MBeanServerFactory.findMBeanServer(null);
| if (servers != null && servers.size() > 0) {
| for (Object object : servers) {
| MBeanServer server = (MBeanServer) object;
| if (server.getDefaultDomain().equals(agentId)) {
| return server;
| }
| }
| }
| return null;
| }
|
There was a related thread that never got an answer back in 2007:
http://lists.jboss.org/pipermail/jboss-user/2007-February/038880.html
This looks like a defect in JBoss. If so, what workaround exists for it?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4166145#4166145
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4166145
17 years, 9 months