You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Maarten Bosteels <mb...@gmail.com> on 2007/10/24 10:53:15 UTC

Re: a question when running performance test by loadruner

Hello,

With 8 users or less your server is doing 2600 inserts per second ?
And each insert is a new database transaction ?
First of all, I think that ain't bad at all !

Are you using a database connection pool ?
Check the size of the pool.

Since you don't have problems when you don't perform db operations, I think
your problem is not related to MINA.

The bottleneck in our MINA based server also turned out to be Oracle, more
specifically the number of commits that Oracle could do per second. I am not
saying that Oracle is bad (quite the opposite) just that I think that's
where you should look: it has A LOT of tuning options.

Maarten

On 10/24/07, tiandike <wh...@21cn.com> wrote:
>
>
> I use loadruner to test my server ,my handler performs database
> operations(insert a row a request)
> i disable the default ThreadModel setting following
> http://mina.apache.org/configuring-thread-model.html
>
> when i use loadruner to run performance test , a strange phenomenon is
> that
> when the number of  Running Vusers
>   in loadruner is less than 8 (include 8) the tps is about 2600 ,but when
> the number of Running Vusers is greater than 8 in loadruner ,the tps
> reduce
> to very low  and number of the records that inserted in oracle also reduce
> to very low .
> I don't know why, anyone can help me?
>
> my server is 4 cpu (Intel(R) Xeon(R) CPU            5110  1.60GHz), linux
> my database is oracle
> jvm version is 6.0
>
> (But : if  my handler not perform database operations the condition above
> never happen!)
>
> --
> View this message in context:
> http://www.nabble.com/a-question--when-running-performance--test-by-loadruner-tf4683007s16868.html#a13381592
> Sent from the Apache MINA Support Forum mailing list archive at Nabble.com
> .
>
>

Re: a question when running performance test by loadruner

Posted by tiandike <wh...@21cn.com>.
Thanks! 
when i config these param ,the question disappear.
I find in GenericObjectPool.java   :

    /**
     * The default cap on the total number of active instances from the
pool.
     * @see #getMaxActive
     */
    public static final int DEFAULT_MAX_ACTIVE  = 8;

I doubt the phenomenon has relation with this static field.

and now my config is 
	                <property name="maxActive" value="1000"></property>
		<property name="initialSize" value="10"></property>
		<property name="maxIdle" value="100"></property>
		<property name="minIdle" value="10"></property>	


Maarten Bosteels wrote:
> 
> On 10/25/07, tiandike <wh...@21cn.com> wrote:
>>
>>
>> I didn't set value to  intialSize, maxIdle, minIdle  and use the default
>> value.
>> do these param affect performance?
> 
> 
> yes, very much. check out the docs and play a bit with the settings.
> .
> Your connection pool is probably opening and closing 'physical'
> connections
> all the time
> which is exactly what you try to avoid by using a connection pool.
> 
> try a higher value for maxIdle, maybe also for minIdle and initialSize
> 
> Maarten
> 
> 
> and i find there are other param in BasicDataSource , do i need to set the
>> right value?
>>
>>
>> Maarten Bosteels wrote:
>> >
>> > what are the other values for BasicDataSource ?
>> > initialSize, maxIdle, minIdle ?
>> >
>> > How much threads is your mina app using ?
>> >
>> > You could try to see how much insert/transactions your app can do per
>> > second
>> > without using mina and loadrunner: just start x threads INSIDE your
>> > application that do the db operations in a loop.
>> > Then you know if it's mina related or not.
>> >
>> > Maarten
>> >
>> > On 10/24/07, tiandike <wh...@21cn.com> wrote:
>> >>
>> >>
>> >> I use  org.apache.commons.dbcp.BasicDataSource and set maxActive =1000
>> >>
>> >> i don't know why is 8? why not other number?
>> >>
>> >>
>> >>
>> >> Maarten Bosteels wrote:
>> >> >
>> >> > Hello,
>> >> >
>> >> > With 8 users or less your server is doing 2600 inserts per second ?
>> >> > And each insert is a new database transaction ?
>> >> > First of all, I think that ain't bad at all !
>> >> >
>> >> > Are you using a database connection pool ?
>> >> > Check the size of the pool.
>> >> >
>> >> > Since you don't have problems when you don't perform db operations,
>> I
>> >> > think
>> >> > your problem is not related to MINA.
>> >> >
>> >> > The bottleneck in our MINA based server also turned out to be
>> Oracle,
>> >> more
>> >> > specifically the number of commits that Oracle could do per second.
>> I
>> >> am
>> >> > not
>> >> > saying that Oracle is bad (quite the opposite) just that I think
>> that's
>> >> > where you should look: it has A LOT of tuning options.
>> >> >
>> >> > Maarten
>> >> >
>> >> > On 10/24/07, tiandike <wh...@21cn.com> wrote:
>> >> >>
>> >> >>
>> >> >> I use loadruner to test my server ,my handler performs database
>> >> >> operations(insert a row a request)
>> >> >> i disable the default ThreadModel setting following
>> >> >> http://mina.apache.org/configuring-thread-model.html
>> >> >>
>> >> >> when i use loadruner to run performance test , a strange phenomenon
>> is
>> >> >> that
>> >> >> when the number of  Running Vusers
>> >> >>   in loadruner is less than 8 (include 8) the tps is about 2600
>> ,but
>> >> when
>> >> >> the number of Running Vusers is greater than 8 in loadruner ,the
>> tps
>> >> >> reduce
>> >> >> to very low  and number of the records that inserted in oracle also
>> >> >> reduce
>> >> >> to very low .
>> >> >> I don't know why, anyone can help me?
>> >> >>
>> >> >> my server is 4 cpu (Intel(R) Xeon(R) CPU            5110  1.60GHz),
>> >> linux
>> >> >> my database is oracle
>> >> >> jvm version is 6.0
>> >> >>
>> >> >> (But : if  my handler not perform database operations the condition
>> >> above
>> >> >> never happen!)
>> >> >>
>> >> >> --
>> >> >> View this message in context:
>> >> >>
>> >>
>> http://www.nabble.com/a-question--when-running-performance--test-by-loadruner-tf4683007s16868.html#a13381592
>> >> >> Sent from the Apache MINA Support Forum mailing list archive at
>> >> >> Nabble.com
>> >> >> .
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/a-question--when-running-performance--test-by-loadruner-tf4683007s16868.html#a13383246
>> >> Sent from the Apache MINA Support Forum mailing list archive at
>> >> Nabble.com
>> >> .
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/a-question--when-running-performance--test-by-loadruner-tf4683007s16868.html#a13407640
>> Sent from the Apache MINA Support Forum mailing list archive at
>> Nabble.com
>> .
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/a-question--when-running-performance--test-by-loadruner-tf4683007s16868.html#a13422536
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.


Re: a question when running performance test by loadruner

Posted by Maarten Bosteels <mb...@gmail.com>.
On 10/25/07, tiandike <wh...@21cn.com> wrote:
>
>
> I didn't set value to  intialSize, maxIdle, minIdle  and use the default
> value.
> do these param affect performance?


yes, very much. check out the docs and play a bit with the settings.
.
Your connection pool is probably opening and closing 'physical' connections
all the time
which is exactly what you try to avoid by using a connection pool.

try a higher value for maxIdle, maybe also for minIdle and initialSize

Maarten


and i find there are other param in BasicDataSource , do i need to set the
> right value?
>
>
> Maarten Bosteels wrote:
> >
> > what are the other values for BasicDataSource ?
> > initialSize, maxIdle, minIdle ?
> >
> > How much threads is your mina app using ?
> >
> > You could try to see how much insert/transactions your app can do per
> > second
> > without using mina and loadrunner: just start x threads INSIDE your
> > application that do the db operations in a loop.
> > Then you know if it's mina related or not.
> >
> > Maarten
> >
> > On 10/24/07, tiandike <wh...@21cn.com> wrote:
> >>
> >>
> >> I use  org.apache.commons.dbcp.BasicDataSource and set maxActive =1000
> >>
> >> i don't know why is 8? why not other number?
> >>
> >>
> >>
> >> Maarten Bosteels wrote:
> >> >
> >> > Hello,
> >> >
> >> > With 8 users or less your server is doing 2600 inserts per second ?
> >> > And each insert is a new database transaction ?
> >> > First of all, I think that ain't bad at all !
> >> >
> >> > Are you using a database connection pool ?
> >> > Check the size of the pool.
> >> >
> >> > Since you don't have problems when you don't perform db operations, I
> >> > think
> >> > your problem is not related to MINA.
> >> >
> >> > The bottleneck in our MINA based server also turned out to be Oracle,
> >> more
> >> > specifically the number of commits that Oracle could do per second. I
> >> am
> >> > not
> >> > saying that Oracle is bad (quite the opposite) just that I think
> that's
> >> > where you should look: it has A LOT of tuning options.
> >> >
> >> > Maarten
> >> >
> >> > On 10/24/07, tiandike <wh...@21cn.com> wrote:
> >> >>
> >> >>
> >> >> I use loadruner to test my server ,my handler performs database
> >> >> operations(insert a row a request)
> >> >> i disable the default ThreadModel setting following
> >> >> http://mina.apache.org/configuring-thread-model.html
> >> >>
> >> >> when i use loadruner to run performance test , a strange phenomenon
> is
> >> >> that
> >> >> when the number of  Running Vusers
> >> >>   in loadruner is less than 8 (include 8) the tps is about 2600 ,but
> >> when
> >> >> the number of Running Vusers is greater than 8 in loadruner ,the tps
> >> >> reduce
> >> >> to very low  and number of the records that inserted in oracle also
> >> >> reduce
> >> >> to very low .
> >> >> I don't know why, anyone can help me?
> >> >>
> >> >> my server is 4 cpu (Intel(R) Xeon(R) CPU            5110  1.60GHz),
> >> linux
> >> >> my database is oracle
> >> >> jvm version is 6.0
> >> >>
> >> >> (But : if  my handler not perform database operations the condition
> >> above
> >> >> never happen!)
> >> >>
> >> >> --
> >> >> View this message in context:
> >> >>
> >>
> http://www.nabble.com/a-question--when-running-performance--test-by-loadruner-tf4683007s16868.html#a13381592
> >> >> Sent from the Apache MINA Support Forum mailing list archive at
> >> >> Nabble.com
> >> >> .
> >> >>
> >> >>
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/a-question--when-running-performance--test-by-loadruner-tf4683007s16868.html#a13383246
> >> Sent from the Apache MINA Support Forum mailing list archive at
> >> Nabble.com
> >> .
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/a-question--when-running-performance--test-by-loadruner-tf4683007s16868.html#a13407640
> Sent from the Apache MINA Support Forum mailing list archive at Nabble.com
> .
>
>

Re: a question when running performance test by loadruner

Posted by tiandike <wh...@21cn.com>.
I didn't set value to  intialSize, maxIdle, minIdle  and use the default
value.
do these param affect performance?
and i find there are other param in BasicDataSource , do i need to set the
right value?


Maarten Bosteels wrote:
> 
> what are the other values for BasicDataSource ?
> initialSize, maxIdle, minIdle ?
> 
> How much threads is your mina app using ?
> 
> You could try to see how much insert/transactions your app can do per
> second
> without using mina and loadrunner: just start x threads INSIDE your
> application that do the db operations in a loop.
> Then you know if it's mina related or not.
> 
> Maarten
> 
> On 10/24/07, tiandike <wh...@21cn.com> wrote:
>>
>>
>> I use  org.apache.commons.dbcp.BasicDataSource and set maxActive =1000
>>
>> i don't know why is 8? why not other number?
>>
>>
>>
>> Maarten Bosteels wrote:
>> >
>> > Hello,
>> >
>> > With 8 users or less your server is doing 2600 inserts per second ?
>> > And each insert is a new database transaction ?
>> > First of all, I think that ain't bad at all !
>> >
>> > Are you using a database connection pool ?
>> > Check the size of the pool.
>> >
>> > Since you don't have problems when you don't perform db operations, I
>> > think
>> > your problem is not related to MINA.
>> >
>> > The bottleneck in our MINA based server also turned out to be Oracle,
>> more
>> > specifically the number of commits that Oracle could do per second. I
>> am
>> > not
>> > saying that Oracle is bad (quite the opposite) just that I think that's
>> > where you should look: it has A LOT of tuning options.
>> >
>> > Maarten
>> >
>> > On 10/24/07, tiandike <wh...@21cn.com> wrote:
>> >>
>> >>
>> >> I use loadruner to test my server ,my handler performs database
>> >> operations(insert a row a request)
>> >> i disable the default ThreadModel setting following
>> >> http://mina.apache.org/configuring-thread-model.html
>> >>
>> >> when i use loadruner to run performance test , a strange phenomenon is
>> >> that
>> >> when the number of  Running Vusers
>> >>   in loadruner is less than 8 (include 8) the tps is about 2600 ,but
>> when
>> >> the number of Running Vusers is greater than 8 in loadruner ,the tps
>> >> reduce
>> >> to very low  and number of the records that inserted in oracle also
>> >> reduce
>> >> to very low .
>> >> I don't know why, anyone can help me?
>> >>
>> >> my server is 4 cpu (Intel(R) Xeon(R) CPU            5110  1.60GHz),
>> linux
>> >> my database is oracle
>> >> jvm version is 6.0
>> >>
>> >> (But : if  my handler not perform database operations the condition
>> above
>> >> never happen!)
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/a-question--when-running-performance--test-by-loadruner-tf4683007s16868.html#a13381592
>> >> Sent from the Apache MINA Support Forum mailing list archive at
>> >> Nabble.com
>> >> .
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/a-question--when-running-performance--test-by-loadruner-tf4683007s16868.html#a13383246
>> Sent from the Apache MINA Support Forum mailing list archive at
>> Nabble.com
>> .
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/a-question--when-running-performance--test-by-loadruner-tf4683007s16868.html#a13407640
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.


Re: a question when running performance test by loadruner

Posted by Maarten Bosteels <mb...@gmail.com>.
On 10/25/07, tiandike <wh...@21cn.com> wrote:
>
>
> I use jcosole to monitor my app and find many thread is blocked
>
> BLOCKED  on org.apache.commons.pool.impl.GenericObjectPool@1400bd5


that is probably because the dbcp connectionPool is exhausted,
are you sure you are properly returning connections to the pool ?

and i find the number of pool-4-thread-xx is equal with the number of
> connector that my client create .
>
> I add new ExecutorFilter(Executors.newCachedThreadPool())) in filterchain
> ,why the number of thread for handler is equal with the number of
> connector
> that my client create ??


wild guess : every thread created by the ThreadPool is eventually blocked,
waiting for the connectionPool,
these threads are not returned to the pool, hence a new thread must be
created for every user.

Maarten

Frédéric Brégier wrote:
> >
> > I can say some more point (I had such problem) related to Oracle and
> Java
> > performance.
> >
> > When you try a loop of requests over the database as suggested Maarten,
> > try to see also how is configured Oracle.
> > For instance, Oracle can have two levels of pool of connections :
> > - one from the application point of vue (using dbcp.BasicDataSource for
> > instance as you said)
> > - another one using thread pool of connection directly in Oracle
> > Both can be used.
> > By default, in Oracle, 1 connection from the application is 1
> > thread/connection in Oracle,
> > so 10000 connections = 10000 threads.connections in the Oracle server.
> > In this mode, Oracle can have a limitation on accepting multiple
> > connections
> > (perhaps 8 in your case ?).
> > Using thread pool in Oracle, 1 connection from the application is still
> 1
> > thread/connection
> > but using a pool of 200 directly in Oracle, 10 000 connections from
> > applications
> > will means 200 connections. In fact, in this mode, requests are
> > multiplexed
> > so using less
> > thread/connection in Oracle.
> > What I want to say is looking only at the Java code might not be
> enough...
> >
> > Also, if you can, recheck you use pooled connection since
> > connect/disconnect
> > can be very heavy.
> > Finally, try to use a prepared statement instead of a standard statement
> > since Oracle will perform really faster. Even more, if you can, try to
> use
> > a
> > stored procedure.
> >
> > Frederic
> > ----- Original Message -----
> >
> > what are the other values for BasicDataSource ?
> > initialSize, maxIdle, minIdle ?
> >
> > How much threads is your mina app using ?
> >
> > You could try to see how much insert/transactions your app can do per
> > second
> > without using mina and loadrunner: just start x threads INSIDE your
> > application that do the db operations in a loop.
> > Then you know if it's mina related or not.
> >
> > Maarten
> >
> > On 10/24/07, tiandike <wh...@21cn.com> wrote:
> >>
> >>
> >> I use  org.apache.commons.dbcp.BasicDataSource and set maxActive =1000
> >>
> >> i don't know why is 8? why not other number?
> >>
> >>
> >>
> >> Maarten Bosteels wrote:
> >> >
> >> > Hello,
> >> >
> >> > With 8 users or less your server is doing 2600 inserts per second ?
> >> > And each insert is a new database transaction ?
> >> > First of all, I think that ain't bad at all !
> >> >
> >> > Are you using a database connection pool ?
> >> > Check the size of the pool.
> >> >
> >> > Since you don't have problems when you don't perform db operations, I
> >> > think
> >> > your problem is not related to MINA.
> >> >
> >> > The bottleneck in our MINA based server also turned out to be Oracle,
> >> more
> >> > specifically the number of commits that Oracle could do per second. I
> >> am
> >> > not
> >> > saying that Oracle is bad (quite the opposite) just that I think
> that's
> >> > where you should look: it has A LOT of tuning options.
> >> >
> >> > Maarten
> >> >
> >> > On 10/24/07, tiandike <wh...@21cn.com> wrote:
> >> >>
> >> >>
> >> >> I use loadruner to test my server ,my handler performs database
> >> >> operations(insert a row a request)
> >> >> i disable the default ThreadModel setting following
> >> >> http://mina.apache.org/configuring-thread-model.html
> >> >>
> >> >> when i use loadruner to run performance test , a strange phenomenon
> is
> >> >> that
> >> >> when the number of  Running Vusers
> >> >>   in loadruner is less than 8 (include 8) the tps is about 2600 ,but
> >> when
> >> >> the number of Running Vusers is greater than 8 in loadruner ,the tps
> >> >> reduce
> >> >> to very low  and number of the records that inserted in oracle also
> >> >> reduce
> >> >> to very low .
> >> >> I don't know why, anyone can help me?
> >> >>
> >> >> my server is 4 cpu (Intel(R) Xeon(R) CPU            5110  1.60GHz),
> >> linux
> >> >> my database is oracle
> >> >> jvm version is 6.0
> >> >>
> >> >> (But : if  my handler not perform database operations the condition
> >> above
> >> >> never happen!)
> >> >>
> >> >> --
> >> >> View this message in context:
> >> >>
> >>
> http://www.nabble.com/a-question--when-running-performance--test-by-loadruner-tf4683007s16868.html#a13381592
> >> >> Sent from the Apache MINA Support Forum mailing list archive at
> >> >> Nabble.com
> >> >> .
> >> >>
> >> >>
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/a-question--when-running-performance--test-by-loadruner-tf4683007s16868.html#a13383246
> >> Sent from the Apache MINA Support Forum mailing list archive at
> >> Nabble.com
> >> .
> >>
> >>
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/a-question--when-running-performance--test-by-loadruner-tf4683007s16868.html#a13406063
> Sent from the Apache MINA Support Forum mailing list archive at Nabble.com
> .
>
>

Re: a question when running performance test by loadruner

Posted by tiandike <wh...@21cn.com>.
I use jcosole to monitor my app and find many thread is blocked

BLOCKED  on org.apache.commons.pool.impl.GenericObjectPool@1400bd5 

and i find the number of pool-4-thread-xx is equal with the number of
connector that my client create .

I add new ExecutorFilter(Executors.newCachedThreadPool())) in filterchain
,why the number of thread for handler is equal with the number of connector
that my client create ??



Frédéric Brégier wrote:
> 
> I can say some more point (I had such problem) related to Oracle and Java 
> performance.
> 
> When you try a loop of requests over the database as suggested Maarten,
> try to see also how is configured Oracle.
> For instance, Oracle can have two levels of pool of connections :
> - one from the application point of vue (using dbcp.BasicDataSource for 
> instance as you said)
> - another one using thread pool of connection directly in Oracle
> Both can be used.
> By default, in Oracle, 1 connection from the application is 1 
> thread/connection in Oracle,
> so 10000 connections = 10000 threads.connections in the Oracle server.
> In this mode, Oracle can have a limitation on accepting multiple
> connections 
> (perhaps 8 in your case ?).
> Using thread pool in Oracle, 1 connection from the application is still 1 
> thread/connection
> but using a pool of 200 directly in Oracle, 10 000 connections from 
> applications
> will means 200 connections. In fact, in this mode, requests are
> multiplexed 
> so using less
> thread/connection in Oracle.
> What I want to say is looking only at the Java code might not be enough...
> 
> Also, if you can, recheck you use pooled connection since
> connect/disconnect
> can be very heavy.
> Finally, try to use a prepared statement instead of a standard statement
> since Oracle will perform really faster. Even more, if you can, try to use
> a 
> stored procedure.
> 
> Frederic
> ----- Original Message ----- 
> 
> what are the other values for BasicDataSource ?
> initialSize, maxIdle, minIdle ?
> 
> How much threads is your mina app using ?
> 
> You could try to see how much insert/transactions your app can do per
> second
> without using mina and loadrunner: just start x threads INSIDE your
> application that do the db operations in a loop.
> Then you know if it's mina related or not.
> 
> Maarten
> 
> On 10/24/07, tiandike <wh...@21cn.com> wrote:
>>
>>
>> I use  org.apache.commons.dbcp.BasicDataSource and set maxActive =1000
>>
>> i don't know why is 8? why not other number?
>>
>>
>>
>> Maarten Bosteels wrote:
>> >
>> > Hello,
>> >
>> > With 8 users or less your server is doing 2600 inserts per second ?
>> > And each insert is a new database transaction ?
>> > First of all, I think that ain't bad at all !
>> >
>> > Are you using a database connection pool ?
>> > Check the size of the pool.
>> >
>> > Since you don't have problems when you don't perform db operations, I
>> > think
>> > your problem is not related to MINA.
>> >
>> > The bottleneck in our MINA based server also turned out to be Oracle,
>> more
>> > specifically the number of commits that Oracle could do per second. I
>> am
>> > not
>> > saying that Oracle is bad (quite the opposite) just that I think that's
>> > where you should look: it has A LOT of tuning options.
>> >
>> > Maarten
>> >
>> > On 10/24/07, tiandike <wh...@21cn.com> wrote:
>> >>
>> >>
>> >> I use loadruner to test my server ,my handler performs database
>> >> operations(insert a row a request)
>> >> i disable the default ThreadModel setting following
>> >> http://mina.apache.org/configuring-thread-model.html
>> >>
>> >> when i use loadruner to run performance test , a strange phenomenon is
>> >> that
>> >> when the number of  Running Vusers
>> >>   in loadruner is less than 8 (include 8) the tps is about 2600 ,but
>> when
>> >> the number of Running Vusers is greater than 8 in loadruner ,the tps
>> >> reduce
>> >> to very low  and number of the records that inserted in oracle also
>> >> reduce
>> >> to very low .
>> >> I don't know why, anyone can help me?
>> >>
>> >> my server is 4 cpu (Intel(R) Xeon(R) CPU            5110  1.60GHz),
>> linux
>> >> my database is oracle
>> >> jvm version is 6.0
>> >>
>> >> (But : if  my handler not perform database operations the condition
>> above
>> >> never happen!)
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/a-question--when-running-performance--test-by-loadruner-tf4683007s16868.html#a13381592
>> >> Sent from the Apache MINA Support Forum mailing list archive at
>> >> Nabble.com
>> >> .
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/a-question--when-running-performance--test-by-loadruner-tf4683007s16868.html#a13383246
>> Sent from the Apache MINA Support Forum mailing list archive at
>> Nabble.com
>> .
>>
>>
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/a-question--when-running-performance--test-by-loadruner-tf4683007s16868.html#a13406063
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.


Re: a question when running performance test by loadruner

Posted by Frédéric Brégier <fr...@free.fr>.
I can say some more point (I had such problem) related to Oracle and Java 
performance.

When you try a loop of requests over the database as suggested Maarten,
try to see also how is configured Oracle.
For instance, Oracle can have two levels of pool of connections :
- one from the application point of vue (using dbcp.BasicDataSource for 
instance as you said)
- another one using thread pool of connection directly in Oracle
Both can be used.
By default, in Oracle, 1 connection from the application is 1 
thread/connection in Oracle,
so 10000 connections = 10000 threads.connections in the Oracle server.
In this mode, Oracle can have a limitation on accepting multiple connections 
(perhaps 8 in your case ?).
Using thread pool in Oracle, 1 connection from the application is still 1 
thread/connection
but using a pool of 200 directly in Oracle, 10 000 connections from 
applications
will means 200 connections. In fact, in this mode, requests are multiplexed 
so using less
thread/connection in Oracle.
What I want to say is looking only at the Java code might not be enough...

Also, if you can, recheck you use pooled connection since connect/disconnect
can be very heavy.
Finally, try to use a prepared statement instead of a standard statement
since Oracle will perform really faster. Even more, if you can, try to use a 
stored procedure.

Frederic
----- Original Message ----- 

what are the other values for BasicDataSource ?
initialSize, maxIdle, minIdle ?

How much threads is your mina app using ?

You could try to see how much insert/transactions your app can do per second
without using mina and loadrunner: just start x threads INSIDE your
application that do the db operations in a loop.
Then you know if it's mina related or not.

Maarten

On 10/24/07, tiandike <wh...@21cn.com> wrote:
>
>
> I use  org.apache.commons.dbcp.BasicDataSource and set maxActive =1000
>
> i don't know why is 8? why not other number?
>
>
>
> Maarten Bosteels wrote:
> >
> > Hello,
> >
> > With 8 users or less your server is doing 2600 inserts per second ?
> > And each insert is a new database transaction ?
> > First of all, I think that ain't bad at all !
> >
> > Are you using a database connection pool ?
> > Check the size of the pool.
> >
> > Since you don't have problems when you don't perform db operations, I
> > think
> > your problem is not related to MINA.
> >
> > The bottleneck in our MINA based server also turned out to be Oracle,
> more
> > specifically the number of commits that Oracle could do per second. I am
> > not
> > saying that Oracle is bad (quite the opposite) just that I think that's
> > where you should look: it has A LOT of tuning options.
> >
> > Maarten
> >
> > On 10/24/07, tiandike <wh...@21cn.com> wrote:
> >>
> >>
> >> I use loadruner to test my server ,my handler performs database
> >> operations(insert a row a request)
> >> i disable the default ThreadModel setting following
> >> http://mina.apache.org/configuring-thread-model.html
> >>
> >> when i use loadruner to run performance test , a strange phenomenon is
> >> that
> >> when the number of  Running Vusers
> >>   in loadruner is less than 8 (include 8) the tps is about 2600 ,but
> when
> >> the number of Running Vusers is greater than 8 in loadruner ,the tps
> >> reduce
> >> to very low  and number of the records that inserted in oracle also
> >> reduce
> >> to very low .
> >> I don't know why, anyone can help me?
> >>
> >> my server is 4 cpu (Intel(R) Xeon(R) CPU            5110  1.60GHz),
> linux
> >> my database is oracle
> >> jvm version is 6.0
> >>
> >> (But : if  my handler not perform database operations the condition
> above
> >> never happen!)
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/a-question--when-running-performance--test-by-loadruner-tf4683007s16868.html#a13381592
> >> Sent from the Apache MINA Support Forum mailing list archive at
> >> Nabble.com
> >> .
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/a-question--when-running-performance--test-by-loadruner-tf4683007s16868.html#a13383246
> Sent from the Apache MINA Support Forum mailing list archive at Nabble.com
> .
>
>


Re: a question when running performance test by loadruner

Posted by Maarten Bosteels <mb...@gmail.com>.
what are the other values for BasicDataSource ?
initialSize, maxIdle, minIdle ?

How much threads is your mina app using ?

You could try to see how much insert/transactions your app can do per second
without using mina and loadrunner: just start x threads INSIDE your
application that do the db operations in a loop.
Then you know if it's mina related or not.

Maarten

On 10/24/07, tiandike <wh...@21cn.com> wrote:
>
>
> I use  org.apache.commons.dbcp.BasicDataSource and set maxActive =1000
>
> i don't know why is 8? why not other number?
>
>
>
> Maarten Bosteels wrote:
> >
> > Hello,
> >
> > With 8 users or less your server is doing 2600 inserts per second ?
> > And each insert is a new database transaction ?
> > First of all, I think that ain't bad at all !
> >
> > Are you using a database connection pool ?
> > Check the size of the pool.
> >
> > Since you don't have problems when you don't perform db operations, I
> > think
> > your problem is not related to MINA.
> >
> > The bottleneck in our MINA based server also turned out to be Oracle,
> more
> > specifically the number of commits that Oracle could do per second. I am
> > not
> > saying that Oracle is bad (quite the opposite) just that I think that's
> > where you should look: it has A LOT of tuning options.
> >
> > Maarten
> >
> > On 10/24/07, tiandike <wh...@21cn.com> wrote:
> >>
> >>
> >> I use loadruner to test my server ,my handler performs database
> >> operations(insert a row a request)
> >> i disable the default ThreadModel setting following
> >> http://mina.apache.org/configuring-thread-model.html
> >>
> >> when i use loadruner to run performance test , a strange phenomenon is
> >> that
> >> when the number of  Running Vusers
> >>   in loadruner is less than 8 (include 8) the tps is about 2600 ,but
> when
> >> the number of Running Vusers is greater than 8 in loadruner ,the tps
> >> reduce
> >> to very low  and number of the records that inserted in oracle also
> >> reduce
> >> to very low .
> >> I don't know why, anyone can help me?
> >>
> >> my server is 4 cpu (Intel(R) Xeon(R) CPU            5110  1.60GHz),
> linux
> >> my database is oracle
> >> jvm version is 6.0
> >>
> >> (But : if  my handler not perform database operations the condition
> above
> >> never happen!)
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/a-question--when-running-performance--test-by-loadruner-tf4683007s16868.html#a13381592
> >> Sent from the Apache MINA Support Forum mailing list archive at
> >> Nabble.com
> >> .
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/a-question--when-running-performance--test-by-loadruner-tf4683007s16868.html#a13383246
> Sent from the Apache MINA Support Forum mailing list archive at Nabble.com
> .
>
>

Re: a question when running performance test by loadruner

Posted by tiandike <wh...@21cn.com>.
I use  org.apache.commons.dbcp.BasicDataSource and set maxActive =1000

i don't know why is 8? why not other number?



Maarten Bosteels wrote:
> 
> Hello,
> 
> With 8 users or less your server is doing 2600 inserts per second ?
> And each insert is a new database transaction ?
> First of all, I think that ain't bad at all !
> 
> Are you using a database connection pool ?
> Check the size of the pool.
> 
> Since you don't have problems when you don't perform db operations, I
> think
> your problem is not related to MINA.
> 
> The bottleneck in our MINA based server also turned out to be Oracle, more
> specifically the number of commits that Oracle could do per second. I am
> not
> saying that Oracle is bad (quite the opposite) just that I think that's
> where you should look: it has A LOT of tuning options.
> 
> Maarten
> 
> On 10/24/07, tiandike <wh...@21cn.com> wrote:
>>
>>
>> I use loadruner to test my server ,my handler performs database
>> operations(insert a row a request)
>> i disable the default ThreadModel setting following
>> http://mina.apache.org/configuring-thread-model.html
>>
>> when i use loadruner to run performance test , a strange phenomenon is
>> that
>> when the number of  Running Vusers
>>   in loadruner is less than 8 (include 8) the tps is about 2600 ,but when
>> the number of Running Vusers is greater than 8 in loadruner ,the tps
>> reduce
>> to very low  and number of the records that inserted in oracle also
>> reduce
>> to very low .
>> I don't know why, anyone can help me?
>>
>> my server is 4 cpu (Intel(R) Xeon(R) CPU            5110  1.60GHz), linux
>> my database is oracle
>> jvm version is 6.0
>>
>> (But : if  my handler not perform database operations the condition above
>> never happen!)
>>
>> --
>> View this message in context:
>> http://www.nabble.com/a-question--when-running-performance--test-by-loadruner-tf4683007s16868.html#a13381592
>> Sent from the Apache MINA Support Forum mailing list archive at
>> Nabble.com
>> .
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/a-question--when-running-performance--test-by-loadruner-tf4683007s16868.html#a13383246
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.