Multithreaded Throughput Degradation in Java/Oracle Application

Discussion in 'Java' started by Robert Brown, Jul 30, 2003.

  1. Robert Brown

    Robert Brown Guest

    I have a multithreaded Java application which a part of a standard
    three tier architecture. There are some users in the database and each
    user can request his account details (such as the items they've
    bought). Each user request is executing on a separate thread borrows a
    db connection from the db pool, retrieves the data (via a select),
    performs some computations and returns the results to the user. I am
    using PreparedStatements, reusing connections etc. The db pool is
    sized to allow each thread to have its own connection so that at no
    time do threads have to wait for a connection to become available. The
    JVM is using native threads (jdk1.3).

    In these conditions when running a benchmark test on a 4CPU box I
    would expect the throughput (total ops per minute) to grow linearly as
    go from 1 concurrent thread to 2,3,4 concurrent threads.

    With 1 thread I can call retrieveAccountInfo() about 500 times a
    minute. I would expect with 4 threads to be able to execute a total of
    2000 calls a minute across all threads since each thread can run on a
    different CPU and the application is completely parallel (that is, no
    synchronization points and no contention for the db connections).
    However with 4 threads I am only able to execute about 850 calls a
    minute which is a really disappointing scalability.

    Given the scenario described above would you expect linear throughput
    increase as long as there are as many CPUs as there threads (no
    contention for the CPU)?

    If not why not?

    If all the conditions described above hold, what other factors may be
    inhibiting scalability? How can I find out? That is, what OS commands
    can I run to see what the choke point is?

    Thanks so much!

    - robert
     
    Robert Brown, Jul 30, 2003
    #1
    1. Advertising

  2. Robert Brown

    Bob Kranson Guest

    You can look at the Java and Oracle vendor sites for some tuning
    information. These are some suggestions.

    Did you enable the JVM for concurrent garbage collection?
    Add any JVM parameters to allow the maximum heap for your RAM install?
    Is the JVM set with a '-server' configuration?

    Maybe an analysis tool can help?
    http://www.compuware.com/products/devpartner/java.htm

    Regards,
    BobK
    "Robert Brown" <> wrote in message
    news:...
    > I have a multithreaded Java application which a part of a standard
    > three tier architecture. There are some users in the database and each
    > user can request his account details (such as the items they've
    > bought). Each user request is executing on a separate thread borrows a
    > db connection from the db pool, retrieves the data (via a select),
    > performs some computations and returns the results to the user. I am
    > using PreparedStatements, reusing connections etc. The db pool is
    > sized to allow each thread to have its own connection so that at no
    > time do threads have to wait for a connection to become available. The
    > JVM is using native threads (jdk1.3).
    >
    > In these conditions when running a benchmark test on a 4CPU box I
    > would expect the throughput (total ops per minute) to grow linearly as
    > go from 1 concurrent thread to 2,3,4 concurrent threads.
    >
    > With 1 thread I can call retrieveAccountInfo() about 500 times a
    > minute. I would expect with 4 threads to be able to execute a total of
    > 2000 calls a minute across all threads since each thread can run on a
    > different CPU and the application is completely parallel (that is, no
    > synchronization points and no contention for the db connections).
    > However with 4 threads I am only able to execute about 850 calls a
    > minute which is a really disappointing scalability.
    >
    > Given the scenario described above would you expect linear throughput
    > increase as long as there are as many CPUs as there threads (no
    > contention for the CPU)?
    >
    > If not why not?
    >
    > If all the conditions described above hold, what other factors may be
    > inhibiting scalability? How can I find out? That is, what OS commands
    > can I run to see what the choke point is?
    >
    > Thanks so much!
    >
    > - robert
     
    Bob Kranson, Jul 30, 2003
    #2
    1. Advertising

  3. Robert Brown

    Robert Brown Guest

    So if the application I described were ideally tuned would you expect
    to have linear throughput improvement when you increase the number of
    threads from 1 to 4 on a 4-CPU box?


    "Bob Kranson" <> wrote in message news:<3f27ca08$1@10.10.0.241>...
    > You can look at the Java and Oracle vendor sites for some tuning
    > information. These are some suggestions.
    >
    > Did you enable the JVM for concurrent garbage collection?
    > Add any JVM parameters to allow the maximum heap for your RAM install?
    > Is the JVM set with a '-server' configuration?
    >
    > Maybe an analysis tool can help?
    > http://www.compuware.com/products/devpartner/java.htm
    >
    > Regards,
    > BobK
    > "Robert Brown" <> wrote in message
    > news:...
    > > I have a multithreaded Java application which a part of a standard
    > > three tier architecture. There are some users in the database and each
    > > user can request his account details (such as the items they've
    > > bought). Each user request is executing on a separate thread borrows a
    > > db connection from the db pool, retrieves the data (via a select),
    > > performs some computations and returns the results to the user. I am
    > > using PreparedStatements, reusing connections etc. The db pool is
    > > sized to allow each thread to have its own connection so that at no
    > > time do threads have to wait for a connection to become available. The
    > > JVM is using native threads (jdk1.3).
    > >
    > > In these conditions when running a benchmark test on a 4CPU box I
    > > would expect the throughput (total ops per minute) to grow linearly as
    > > go from 1 concurrent thread to 2,3,4 concurrent threads.
    > >
    > > With 1 thread I can call retrieveAccountInfo() about 500 times a
    > > minute. I would expect with 4 threads to be able to execute a total of
    > > 2000 calls a minute across all threads since each thread can run on a
    > > different CPU and the application is completely parallel (that is, no
    > > synchronization points and no contention for the db connections).
    > > However with 4 threads I am only able to execute about 850 calls a
    > > minute which is a really disappointing scalability.
    > >
    > > Given the scenario described above would you expect linear throughput
    > > increase as long as there are as many CPUs as there threads (no
    > > contention for the CPU)?
    > >
    > > If not why not?
    > >
    > > If all the conditions described above hold, what other factors may be
    > > inhibiting scalability? How can I find out? That is, what OS commands
    > > can I run to see what the choke point is?
    > >
    > > Thanks so much!
    > >
    > > - robert
     
    Robert Brown, Jul 30, 2003
    #3
  4. Robert Brown

    Bob Kranson Guest

    I would first ask which operating system you are using....Windows, Unix,
    Mainframe, AS400, VMS? Each has its own implementation of the JVM and its
    own multi-processor logic. Each of these OS's have system-kernal settings
    which can 'ulimit' files, processes, etc. These are usually hidden
    adversaries to the greatest performance intentions!@

    "Robert Brown" <> wrote in message
    news:...
    > So if the application I described were ideally tuned would you expect
    > to have linear throughput improvement when you increase the number of
    > threads from 1 to 4 on a 4-CPU box?
    >
    >
    > "Bob Kranson" <> wrote in message

    news:<3f27ca08$1@10.10.0.241>...
    > > You can look at the Java and Oracle vendor sites for some tuning
    > > information. These are some suggestions.
    > >
    > > Did you enable the JVM for concurrent garbage collection?
    > > Add any JVM parameters to allow the maximum heap for your RAM install?
    > > Is the JVM set with a '-server' configuration?
    > >
    > > Maybe an analysis tool can help?
    > > http://www.compuware.com/products/devpartner/java.htm
    > >
    > > Regards,
    > > BobK
    > > "Robert Brown" <> wrote in message
    > > news:...
    > > > I have a multithreaded Java application which a part of a standard
    > > > three tier architecture. There are some users in the database and each
    > > > user can request his account details (such as the items they've
    > > > bought). Each user request is executing on a separate thread borrows a
    > > > db connection from the db pool, retrieves the data (via a select),
    > > > performs some computations and returns the results to the user. I am
    > > > using PreparedStatements, reusing connections etc. The db pool is
    > > > sized to allow each thread to have its own connection so that at no
    > > > time do threads have to wait for a connection to become available. The
    > > > JVM is using native threads (jdk1.3).
    > > >
    > > > In these conditions when running a benchmark test on a 4CPU box I
    > > > would expect the throughput (total ops per minute) to grow linearly as
    > > > go from 1 concurrent thread to 2,3,4 concurrent threads.
    > > >
    > > > With 1 thread I can call retrieveAccountInfo() about 500 times a
    > > > minute. I would expect with 4 threads to be able to execute a total of
    > > > 2000 calls a minute across all threads since each thread can run on a
    > > > different CPU and the application is completely parallel (that is, no
    > > > synchronization points and no contention for the db connections).
    > > > However with 4 threads I am only able to execute about 850 calls a
    > > > minute which is a really disappointing scalability.
    > > >
    > > > Given the scenario described above would you expect linear throughput
    > > > increase as long as there are as many CPUs as there threads (no
    > > > contention for the CPU)?
    > > >
    > > > If not why not?
    > > >
    > > > If all the conditions described above hold, what other factors may be
    > > > inhibiting scalability? How can I find out? That is, what OS commands
    > > > can I run to see what the choke point is?
    > > >
    > > > Thanks so much!
    > > >
    > > > - robert
     
    Bob Kranson, Jul 30, 2003
    #4
  5. Robert Brown

    Roedy Green Guest

    On Wed, 30 Jul 2003 14:55:34 -0400, "Bob Kranson"
    <> wrote or quoted :

    > Each of these OS's have system-kernal settings
    >which can 'ulimit' files, processes, etc.


    Ulimit = user limit? In other words, unbeknownst to you, you are
    queuiing up to access a common file?

    Is there any I/O going on OUTSIDE SQL? You could find out by
    temporarily moving the SQL server to another machine and monitoring
    i/o.


    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Roedy Green, Jul 30, 2003
    #5
  6. Robert Brown

    Harald Hein Guest

    "Robert Brown" wrote:

    > So if the application I described were ideally tuned would you expect
    > to have linear throughput improvement when you increase the number of
    > threads from 1 to 4 on a 4-CPU box?


    Never. Already the hardware architecture will prevent this.
    Communication overhead will prevent this, I/O will prevent this.
     
    Harald Hein, Jul 31, 2003
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. walala
    Replies:
    0
    Views:
    638
    walala
    Sep 8, 2003
  2. Replies:
    0
    Views:
    499
  3. Gordon Beaton

    Algorithm - UDP Throughput Calculation

    Gordon Beaton, Nov 17, 2005, in forum: Java
    Replies:
    2
    Views:
    6,577
    Roedy Green
    Nov 17, 2005
  4. JPractitioner

    Slow throughput problem

    JPractitioner, Feb 17, 2006, in forum: Java
    Replies:
    13
    Views:
    650
    JPractitioner
    Feb 22, 2006
  5. Feyruz
    Replies:
    4
    Views:
    2,333
    Sherm Pendley
    Oct 14, 2005
Loading...

Share This Page