Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Multithreaded Throughput Degradation in Java/Oracle Application

Reply
Thread Tools

Multithreaded Throughput Degradation in Java/Oracle Application

 
 
Robert Brown
Guest
Posts: n/a
 
      07-30-2003
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
 
Reply With Quote
 
 
 
 
Bob Kranson
Guest
Posts: n/a
 
      07-30-2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> 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



 
Reply With Quote
 
 
 
 
Robert Brown
Guest
Posts: n/a
 
      07-30-2003
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" <(E-Mail Removed)> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) om...
> > 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

 
Reply With Quote
 
Bob Kranson
Guest
Posts: n/a
 
      07-30-2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> 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" <(E-Mail Removed)> 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" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed) om...
> > > 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





 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      07-30-2003
On Wed, 30 Jul 2003 14:55:34 -0400, "Bob Kranson"
<(E-Mail Removed)> 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.
 
Reply With Quote
 
Harald Hein
Guest
Posts: n/a
 
      07-31-2003
"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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wireless Connection Speed Degradation despite of Strong Signal Strength Netman Wireless Networking 5 10-29-2005 05:46 PM
Degradation Chakra ASP .Net 3 04-23-2005 01:30 AM
application throughput CB Cisco 0 06-24-2004 08:17 PM
Performance degradation Boo R. Ghost ASP .Net 2 05-12-2004 06:05 AM
Safe level of website degradation Paul F. Johnson HTML 3 06-24-2003 11:30 AM



Advertisments