2 Replies Latest reply on Nov 6, 2009 10:33 PM by Ron Sigal

    JBoss RMI + Serialization performance issue

    Ron Sigal Master

       

      "ravi_eze" wrote:

      hi,

      This is w.r.t. http://labs.jboss.com/jbossremoting/docs/benchmark/performance_benchmark.html where comparision between diffarent protocols is done. The page also gives the JUnit code that generated the graphs. we are trying out with 2.5.2. version.

      We are evaluating Java RMI and JBoss RMI over socket + Jboss serialization. We see that Java RMI with Java serialization is always atleast 20% faster than Jboss RMI + socket + Jboss serialization.

      i am unable to understand the below from the test cases.

      1. The payload uses byte[1024] empty array always. and the object is never serialized.
      2. why byte[] as theres not thing there to serialize in it
      3. Even on using byte[1024] to be sent across using jboss and java rmi we see java rmi is superior on our machines.

      If this is the case then how ar the graphs generated? Or am i missing something very important. Please help.

      --
      ravi


      Actually, the byte array gets wrapped in some Remoting objects, which do indeed get serialized.

      By "Java RMI with Java serialization" I assume you mean the "raw_socket" results, or maybe the "raw_rmi" results, and by "Jboss RMI + socket + Jboss serialization" I assume you mean "socket transport with jboss serialization". Is that right? If so, then I can't explain why you're seeing results different than ours. Who knows? Different machines, different jdk's, etc.

      By the way, before I released version 2.4.0.GA, I did a lot of testing and tuning, and, in the end, the performance of 2.4.0.GA and whatever the latest 2.2.x release was at the time were very close, within a few percentage points.

        • 1. Re: JBoss RMI + Serialization performance issue
          ravi c Newbie

          hi,

          Here's a new test. Even here the jboss socket comm (with/ without jboss serialization) does badly.The machines are the same linux boxes and no other process is runnin on it.

          First we ran the test for 1000 times(say this as a batch) and 15 such batches. Took the average of last 12 of them(considering jvm warmups etc). We did this for Java RMI with raw_socket (or javaRMI with java serialization) Then we did the same with Jboss RMI over socket (socket transport with jboss serialization). We did this as the same process and as a different processes. In all the cases socket transport with java serialization took abt 35% more time than java RMI with java serialization.

          Now considering jboss RMI with jboss serialization it takes more than 10 times w.r.t. java RMI with java serialization. I am not sure where i am doing wrong. below is the code

          public class Person implements Serializable {
           int id;
           private Vector<Person> personVector = null;
          
           //HERE WE POPULATE A TREE WITH A GIVEN DEPTH AND BREADTH.
           public Person populateDepth(Person person, int currentDepth, int breadth, int finalDepth) {
           if (currentDepth >= finalDepth) {
           return person;
           } else {
           person.personVector = new Vector<Person>(breadth);
           this.id = this.personID++;
           for (int i = 0; i < breadth; i++) {
           Person p = new Person();
           person.personVector.add(p);
           populateDepth(p, currentDepth + 1, breadth, finalDepth);
           }
           }
           return person;
           }
          
           //DOES THE JAVA SERIALIZATION
           public byte[] getJavaBytes() throws Exception {
           ByteArrayOutputStream st = new ByteArrayOutputStream(64 * 1024);
           ObjectOutputStream os = new ObjectOutputStream(st);
           os.writeObject(this);
           byte[] s = st.toByteArray();
           return s;
           }
          
           //DOES JBOSS SERIALIZATION.
           public byte[] getJbossBytes() throws Exception {
           ByteArrayOutputStream st = new ByteArrayOutputStream(64 * 1024);
           ObjectOutputStream os = new JBossObjectOutputStream(st);
           os.writeObject(this);
           byte[] s = st.toByteArray();
           return s;
           }
          
          //STRESS CODE
          public static long stress(IRemote playerInterface, Person player, int hits) throws Exception {
           long startingTime;
           long endTime;
           startingTime = System.currentTimeMillis();
           for (int i = 0; i < hits; i++) {
           Person result = playerInterface.execute(player);
           }
           endTime = System.currentTimeMillis();
           return endTime - startingTime;
           }
          
          }
          
          


          Also we see Jboss serialization to produce 40% more bytes than java serialization for the above prog.


          Cleint prog is as follows

          uri= "socket://10.1.131.96:8092?serializationtype=jboss";
          int depth=15;
          int breadth =2;
          remote = (IRemote) TransporterClient.createTransporterClient(uri, IRemote.class);
          Person p = new Person();
          p = p.populateDepth(p, 0, breadth, depth);
          return Person.stress(remote, p, hits);
          
          


          • 2. Re: JBoss RMI + Serialization performance issue
            Ron Sigal Master

            One guess is that the use of a proxy, which is how transporters work, is adding some overhead. In our socket transport versus RMI performance, we used plain org.jboss.remoting.Client invocations.

            "ravi_eze" wrote:

            Now considering jboss RMI with jboss serialization it takes more than 10 times w.r.t. java RMI with java serialization.


            Well, that's really bad. I just don't know what's going on.

            By the way, what role is played by getJavaBytes() and getJavaBytes()?

            "ravi_eze" wrote:

            Also we see Jboss serialization to produce 40% more bytes than java serialization for the above prog.


            I have heard that JBossSerialization sometimes uses more space than Java serialization.