Results 1 to 2 of 2

Thread: Ice performance degrades gradually?

  1. #1
    Sundance is offline Registered User
    Name: John Lo
    Organization: University of Pretoria
    Project: Interchangeable Middlewares
    Join Date
    Jan 2012
    Posts
    1

    Ice performance degrades gradually?

    Hello ZeroC Staff,

    I am trying out your ICE product by stressing it a bit and I encountered something quite odd. I notice ICE performance degrades with mutilple calls over time on the same object.

    To produce this problem, I followed your examples and created my own to illustrate things easier.

    For the slice definitions, I wrote a simple operations that set and get an int counter as shown below:

    module simple {
    exception SimpleException {
    string reason;
    };
    interface Operations {
    int getCounter();
    void setCounter(int c);
    };
    };

    Then I created a Server class that host the servant object:

    public class Server {

    public static void main(String args []) {
    Ice.Communicator ic = null;
    try {
    ic = Ice.Util.initialize(args);
    Ice.ObjectAdapter adapter = ic.createObjectAdapterWithEndpoints(
    "SimpleOperations", "default -p 9500");
    Ice.Object servant = new OperationsI();
    adapter.add(servant, ic.stringToIdentity("SimpleCounter"));
    adapter.activate();
    System.out.println("Server Started...");
    ic.waitForShutdown();
    } catch(Exception e) {e.printStackTrace();}
    if (ic != null) {
    try {
    ic.destroy();
    } catch (Exception e) {
    e.printStackTrace();
    }
    }
    }
    }

    A client class that calls the remote object 10000 times and times the duration of the calls:

    public class Client {
    public static void main(String[] args) {
    int status = 0;
    Ice.Communicator ic = null;
    try {
    ic = Ice.Util.initialize(args);
    Ice.ObjectPrx baseOp = ic.stringToProxy("SimpleCounter:default -h localhost -p 9500");
    OperationsPrx op = OperationsPrxHelper
    .checkedCast(baseOp);
    System.out.println("Processing...");
    int c = 0;
    long startTimer = System.currentTimeMillis();
    for (int i = 0; i < 10000; i++) {
    op.setCounter(i);
    c = op.getCounter();
    System.out.println("Counter: "+c);
    }
    long stopTimer = System.currentTimeMillis() - startTimer;
    System.out.println("Time taken to get counter: "+stopTimer+"ms.");

    } catch (Ice.LocalException e) {
    e.printStackTrace();
    status = 1;
    }
    if (ic != null) {
    try {
    ic.shutdown();
    ic.destroy();
    System.out.println("Thread Destroyed...");
    } catch (Exception e) {
    e.printStackTrace();
    }
    }
    }
    }


    When I perform multiple separate runs of the client, the performance degrades after each run.
    So on my machine it starts from 13 secs (first run), to 17 (second run), then 28 seconds (third run) and goes slower after each run etc.
    Note that I am running both the Server and Client code on the same machine, without using any additional configurations or properties, so I
    think its running using 1 thread per client and server according to your documentation. I am running the latest ICE Java implementation on Windows XP.

    I think its quite common that the same stateless object can be shared and accessed by many clients at the same time.
    I reckon this performance degradation should not happen, but where am I doing things incorrectly?

    I appreciate any comments you can give me.

    Thank-You

  2. #2
    xdm's Avatar
    xdm
    xdm is online now ZeroC Staff
    Name: Jose Gutierrez de la Concha
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Sep 2003
    Location
    La Coruņa, Spain
    Posts
    588
    Hi John

    I have review your code and don't see anything wrong that could cause the degradation in performance, can you show us the implementation of OperationsI?.

    I have tested your demo in Windows 7/ Java 1.6.0_26 and Linux/Java 1.6.0_29 and don't see any degradation in performance, i will test in XP when i have time, what Java version are you using?

    Here my times for 20 runs in Linux, i get similar results in Windows 7

    Code:
    for i in {1..20}; do java Client; done | grep Time
    Time taken to get counter: 2483ms.
    Time taken to get counter: 1885ms.
    Time taken to get counter: 1733ms.
    Time taken to get counter: 1787ms.
    Time taken to get counter: 1830ms.
    Time taken to get counter: 1746ms.
    Time taken to get counter: 1643ms.
    Time taken to get counter: 1889ms.
    Time taken to get counter: 1810ms.
    Time taken to get counter: 1942ms.
    Time taken to get counter: 1733ms.
    Time taken to get counter: 1691ms.
    Time taken to get counter: 1671ms.
    Time taken to get counter: 1807ms.
    Time taken to get counter: 1810ms.
    Time taken to get counter: 1828ms.
    Time taken to get counter: 1792ms.
    Time taken to get counter: 1811ms.
    Time taken to get counter: 1837ms.
    Time taken to get counter: 1834ms.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. performance about ICE on mono
    By mathgl in forum Help Center
    Replies: 1
    Last Post: 01-13-2011, 01:29 PM
  2. Ice C++ Performance
    By gesly in forum Help Center
    Replies: 10
    Last Post: 05-02-2007, 08:05 PM
  3. what performance ice vs ace?
    By BSanLang in forum Comments
    Replies: 1
    Last Post: 10-13-2006, 02:20 PM
  4. Ice Performance
    By marc in forum Announcements
    Replies: 0
    Last Post: 03-28-2005, 07:29 PM
  5. Ice performance ?
    By ChMeessen in forum Comments
    Replies: 5
    Last Post: 09-25-2003, 11:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •