About performance and scalability of JADE.

This paper presents the measurements of scalability and performance of the messaging transport system of JADE. The source code source code of the benchmark is also available in the add-ons section in order to reproduce all the experiments. It measures the average round-trip time for a message exchange between a couple of agents under different load conditions (i.e. number of simultaneously active agents) and for different platform configurations (i.e. intra- and inter- platform, intra- and inter- container). As a term of comparison, results were compared with a non-JADE implementation based on agents as simple “active objects” communicating through pure RMI.
JADE messaging performance are much superior compared with those provided by RMI (see Figure) when both sender and receiver agents live in the same container.
JADE provides performance comparable with pure RMI when sender and receiver live in different containers where the penalty is well balanced by the benefits of a shorter development time and ease of use (see Figure).
Finally, communication between different platforms via the IIOP-MTP provides performance comparable with the JADE inter-container case (seeFigure), therefore enabling an efficient integration of Multi-MAS.
Globally, the results show that JADE is viable for heavy-loaded applications, that it scales linearly with the load conditions, and that efficient MAS deployment can be obtained and performance can be optimized by properly distributing agents and containers at deployment time or also by using intra-platform agent mobility at run-time.
Of course, performance has been improved through subsequent releases of JADE and the following information are useful for users:
- JADE 2.5 optimized the performance of pattern matching (i.e. the class MessageTemplate), a synchronization bug was also fixed that occasionally created a live deadlock;
- a bug in JADE 2.6 was introduced that made it not suitable for scalability, this bug has been fixed in JADE 2.61.
Therefore, JADE 2.5 or JADE 2.61 at this date (October 2002) appear to be the most effective releases for stress-testing.
Bad Java programming practices might degrade consistently the performance of JADE agents: as well known, it is a good programming practice to move loop-invariant initializations and definitions to outside the loops. The method action() of a Behavior is often inside a loop, as for instance in the obvious case of a CyclicBehaviour. Therefore, all data structure initialization and assignment should be moved outside the method action() for getting better performance. For instance, this code

  
  class myBehaviour extends CyclicBehaviour {

    ACLMessage msg;
    ACLMessage msg2;

    myBehaviour(Agent myAgent) {
      super(myAgent);
      msg2 = new ACLMessage(ACLMessage.INFORM);
      msg2.setSender(myAgent.getAID());
      AID receiver = new AID('myReceiver', AID.ISLOCALNAME);
      msg2.addReceiver(receiver);
      msg2.setProtocol('myprotocol');
      msg2.setContent('hello world');
    }

    public void action() {
      msg = receive();
      if (msg != null) {
        send(msg2);
      }
    }

  }
  

Gives better performance than this code:

  
  class myBehaviour extends CyclicBehaviour {

    public void action() {
      ACLMessage msg = receive();
      if (msg != null) {
        ACLMessage msg2 = new ACLMessage(ACLMessage.INFORM);
        AID receiver = new AID('myReceiver', AID.ISLOCALNAME);
        msg2.setSender(myAgent.getAID());
        msg2.addReceiver(receiver);
        msg2.setProtocol('myprotocol');
        msg2.setContent('hello world');
        send(msg2);
      }
    }
  }
  

Where all initialization and creation of objects have been moved from theaction() method into the constructor of the class.
Good programming practice, optimization of the compiled code (-O flag of java compiler), and usage of the best versions of JADE in some cases allowed to decrease the values of measured performances from 122 seconds down to 8 seconds!

Posted in: General Questions about Jade