performance issues with clusterj

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

performance issues with clusterj

Mahmoud Ismail
Hi,

I was wondering about clusterj behavior while increasing number of concurrent transactions.

In my test application, i have a number of worker threads each instantiated with a Session object, and each run many transactions in sequence. Each transaction reads 5 rows from the database (primary key operations) using read-committed lock type. Each worker thread reads different set of rows.

I tried first to vary number of worker threads within my test process, as well as adding multiple test processes in parallel. and here's the graph that i got.



As shown in the graph, if we took one process we will see that the average time for a transaction to complete is increasing while increasing number of threads. 

Also, distributing threads among processes gives better performance for example, transaction took almost 9 msec to finish using 1 process with 50 threads in contrast to 3 msec using 5 processes with 10 threads each.

Is this issue normal?! or could it be something related to the way i'm using clusterj?! 

from the behavior i got so far, i would assume, that there is some kind of synchronization point in clusterj, is it true?! if so, how to fix this issue?


here's my code for this test:

Regards,
Mahmoud

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: performance issues with clusterj

Craig L Russell
Hi Mahmoud,

One thing to check is to be sure that you’re not measuring the benchmark environment itself. You have a multi-thread counter that will increase concurrency for each new thread in the process. Perhaps changing the benchmark so that each thread has a specific amount of work to do would allow you to remove this potential concurrency issue.

The other thing is to use connection pooling. With five threads sharing a connection you may not have much contention on the tcp layer but with 50 threads this might be an issue. Try configuring connection pooling and see if that has any effect.

Regards,

Craig

> On Jul 1, 2015, at 10:12 AM, Mahmoud Ismail <[hidden email]> wrote:
>
> Hi,
>
> I was wondering about clusterj behavior while increasing number of concurrent transactions.
>
> In my test application, i have a number of worker threads each instantiated with a Session object, and each run many transactions in sequence. Each transaction reads 5 rows from the database (primary key operations) using read-committed lock type. Each worker thread reads different set of rows.
>
> I tried first to vary number of worker threads within my test process, as well as adding multiple test processes in parallel. and here's the graph that i got.
>
> ​
> As shown in the graph, if we took one process we will see that the average time for a transaction to complete is increasing while increasing number of threads.
>
> Also, distributing threads among processes gives better performance for example, transaction took almost 9 msec to finish using 1 process with 50 threads in contrast to 3 msec using 5 processes with 10 threads each.
>
> Is this issue normal?! or could it be something related to the way i'm using clusterj?!
>
> from the behavior i got so far, i would assume, that there is some kind of synchronization point in clusterj, is it true?! if so, how to fix this issue?
>
>
> here's my code for this test:
> https://github.com/maismail/clusterj-test <https://github.com/maismail/clusterj-test>
>
> Regards,
> Mahmoud
>

Craig L RussellArchitect, Oraclehttp://db.apache.org/jdo408 276-5638 mailto:[hidden email]. A good JDO? O, Gasp!

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Fwd: performance issues with clusterj

Mahmoud Ismail
Hi Craig,

Worker threads are completely independent, reading totally different rows
from the database, and each worker has its own Session object. each worker
run 10000 transactions reading 5 rows.
Also, i've changed the connection pool to be numOfThreads/5.0, for 5
threads i've connection pool of size 1 and for 10 threads i've connection
pool of size 2 and so on. And here's the graph i got with this
configuration.

https://raw.githubusercontent.com/maismail/clusterj-test/master/cluster-rc-one-machine_32cores_variable_connectionpoolsize.png

I did another experiment where i open and close sessions for each
transaction
i got these graphs, for the time for a transaction to finish not including
the time to open/close sessions, and another two graphs for average time to
open and create sessions

https://raw.githubusercontent.com/maismail/clusterj-test/master/cluster-rc-one-machine-transaction.png

https://raw.githubusercontent.com/maismail/clusterj-test/master/cluster-rc-one-machine-open.png

<https://raw.githubusercontent.com/maismail/clusterj-test/master/cluster-rc-one-machine-open.png>
https://raw.githubusercontent.com/maismail/clusterj-test/master/cluster-rc-one-machine-close.png
<https://raw.githubusercontent.com/maismail/clusterj-test/master/cluster-rc-one-machine-open.png>

Regards,
Mahmoud

On Thu, Jul 2, 2015 at 4:05 PM, Craig L Russell <[hidden email]>
wrote:

> Hi Mahmoud,
>
> One thing to check is to be sure that you’re not measuring the benchmark
> environment itself. You have a multi-thread counter that will increase
> concurrency for each new thread in the process. Perhaps changing the
> benchmark so that each thread has a specific amount of work to do would
> allow you to remove this potential concurrency issue.
>
> The other thing is to use connection pooling. With five threads sharing a
> connection you may not have much contention on the tcp layer but with 50
> threads this might be an issue. Try configuring connection pooling and see
> if that has any effect.
>
> Regards,
>
> Craig
>
> On Jul 1, 2015, at 10:12 AM, Mahmoud Ismail <[hidden email]>
> wrote:
>
> Hi,
>
> I was wondering about clusterj behavior while increasing number of
> concurrent transactions.
>
> In my test application, i have a number of worker threads each
> instantiated with a Session object, and each run many transactions in
> sequence. Each transaction reads 5 rows from the database (primary key
> operations) using read-committed lock type. Each worker thread reads
> different set of rows.
>
> I tried first to vary number of worker threads within my test process, as
> well as adding multiple test processes in parallel. and here's the graph
> that i got.
>
> ​
> As shown in the graph, if we took one process we will see that the average
> time for a transaction to complete is increasing while increasing number of
> threads.
>
> Also, distributing threads among processes gives better performance for
> example, transaction took almost 9 msec to finish using 1 process with 50
> threads in contrast to 3 msec using 5 processes with 10 threads each.
>
> Is this issue normal?! or could it be something related to the way i'm
> using clusterj?!
>
> from the behavior i got so far, i would assume, that there is some kind of
> synchronization point in clusterj, is it true?! if so, how to fix this
> issue?
>
>
> here's my code for this test:
> https://github.com/maismail/clusterj-test
>
> Regards,
> Mahmoud
>
>
> Craig L RussellArchitect, Oraclehttp://db.apache.org/jdo408 276-5638
> mailto:[hidden email]. A good JDO? O, Gasp!
>
>
Loading...