You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Harikrishnan R <ha...@inxsasia.com> on 2012/05/29 08:23:45 UTC
Standalone application makes parallel read.
Hi,
I am creating a standalone application, which queries(reads) the
database upon each request. I am using Jetty server for handling incoming
request.
For each request it is creating *DataContext.createDataContext() *to
perform query .
By using jmeter, I put 10 request per second. It is executing the select
statements one by one, then only it is responding back.
The poolmanager is configured (min,max) as (5,50). I am sure that
webserver is reading the 10 request simultaneously.
Is there any way to make the database queries(read) parallel, so that It
can respond to the request as fast as possible and withstand the load.
I am sure that I am missing some basic things, please guide me.
-Regards
Harikrishnan R
Re: Standalone application makes parallel read.
Posted by Joe Baldwin <jf...@earthlink.net>.
Harikrishnan,
My assumption is that you may be referring to optimizing parallel communication with the DBMS (since the DBMS architecture itself is highly parallel). Based on that assumption, here is my experience.
I changed over to using DBCP to solve a different problem than yours, however my experience may help.
Cayenne is designed to work well with a few different connection pool frameworks. If warranted, you could configure Cayenne to use DBCP, which will give you more control over the connection pooling behavior. (Since a lot of these configurations are actually requests vs commands, you will need to monitor your DBMS to determine if your requests result in the intended behavior. i.e. just because you request a connection configuration, doesn't mean you will always get it in practice - at least that is what I found - so you have to fiddle with the parameters until it works as intended)
You can then use the DBCP configuration file to set your maxActive connections to 10 or higher. (I think you may also need to verify the connections configuration on the DBMS, but this is usually pretty high.)
Check out this configuration page
http://commons.apache.org/dbcp/configuration.html
Hope this helps.
Joe
On May 29, 2012, at 2:23 AM, Harikrishnan R wrote:
> Hi,
>
> I am creating a standalone application, which queries(reads) the
> database upon each request. I am using Jetty server for handling incoming
> request.
>
> For each request it is creating *DataContext.createDataContext() *to
> perform query .
>
> By using jmeter, I put 10 request per second. It is executing the select
> statements one by one, then only it is responding back.
>
> The poolmanager is configured (min,max) as (5,50). I am sure that
> webserver is reading the 10 request simultaneously.
>
>
> Is there any way to make the database queries(read) parallel, so that It
> can respond to the request as fast as possible and withstand the load.
>
>
> I am sure that I am missing some basic things, please guide me.
>
> -Regards
> Harikrishnan R
Re: Standalone application makes parallel read.
Posted by Michael Gentry <mg...@masslight.net>.
Hi Harikrishnan,
Most databases today support some degree of parallelism. (You didn't
say which database you were using.) However, number of CPUs and I/O
can greatly effect how well they perform, along with RAM caches and
network speeds and many other such things. (The same is true for the
system where you are running Jetty.)
On Tue, May 29, 2012 at 2:23 AM, Harikrishnan R
<ha...@inxsasia.com> wrote:
> Hi,
>
> I am creating a standalone application, which queries(reads) the
> database upon each request. I am using Jetty server for handling incoming
> request.
>
> For each request it is creating *DataContext.createDataContext() *to
> perform query .
>
> By using jmeter, I put 10 request per second. It is executing the select
> statements one by one, then only it is responding back.
>
> The poolmanager is configured (min,max) as (5,50). I am sure that
> webserver is reading the 10 request simultaneously.
>
>
> Is there any way to make the database queries(read) parallel, so that It
> can respond to the request as fast as possible and withstand the load.
>
>
> I am sure that I am missing some basic things, please guide me.
>
> -Regards
> Harikrishnan R
Re: Standalone application makes parallel read.
Posted by Joe Baldwin <jf...@earthlink.net>.
Addendum:
I just read this advise from the DBCP configuration page, and it appears to be applicable in your case. (It seems very logical to set the maxIdle to 10 or more for your test)
If maxIdle is set too low on heavily loaded systems it is possible you will see connections being closed and almost immediately new connections being opened. This is a result of the active threads momentarily closing connections faster than they are opening them, causing the number of idle connections to rise above maxIdle. The best value for maxIdle for heavily loaded system will vary but the default is a good starting point.
On May 29, 2012, at 2:23 AM, Harikrishnan R wrote:
> Hi,
>
> I am creating a standalone application, which queries(reads) the
> database upon each request. I am using Jetty server for handling incoming
> request.
>
> For each request it is creating *DataContext.createDataContext() *to
> perform query .
>
> By using jmeter, I put 10 request per second. It is executing the select
> statements one by one, then only it is responding back.
>
> The poolmanager is configured (min,max) as (5,50). I am sure that
> webserver is reading the 10 request simultaneously.
>
>
> Is there any way to make the database queries(read) parallel, so that It
> can respond to the request as fast as possible and withstand the load.
>
>
> I am sure that I am missing some basic things, please guide me.
>
> -Regards
> Harikrishnan R
Re: Standalone application makes parallel read.
Posted by Joe Baldwin <jf...@earthlink.net>.
Sorry for any duplicates - Resending this because of email problems
Harikrishnan,
My assumption is that you may be referring to optimizing parallel communication with the DBMS (since the DBMS architecture itself is highly parallel). Based on that assumption, here is my experience.
I changed over to using DBCP to solve a different problem than yours, however my experience may help.
Cayenne is designed to work well with a few different connection pool frameworks. If warranted, you could configure Cayenne to use DBCP, which will give you more control over the connection pooling behavior. (Since a lot of these configurations are actually requests vs commands, you will need to monitor your DBMS to determine if your requests result in the intended behavior. i.e. just because you request a connection configuration, doesn't mean you will always get it in practice - at least that is what I found - so you have to fiddle with the parameters until it works as intended)
You can then use the DBCP configuration file to set your maxActive connections to 10 or higher. (I think you may also need to verify the connections configuration on the DBMS, but this is usually pretty high.)
Check out this configuration page
http://commons.apache.org/dbcp/configuration.html
Hope this helps.
Joe
On May 29, 2012, at 2:23 AM, Harikrishnan R wrote:
> Hi,
>
> I am creating a standalone application, which queries(reads) the
> database upon each request. I am using Jetty server for handling incoming
> request.
>
> For each request it is creating *DataContext.createDataContext() *to
> perform query .
>
> By using jmeter, I put 10 request per second. It is executing the select
> statements one by one, then only it is responding back.
>
> The poolmanager is configured (min,max) as (5,50). I am sure that
> webserver is reading the 10 request simultaneously.
>
>
> Is there any way to make the database queries(read) parallel, so that It
> can respond to the request as fast as possible and withstand the load.
>
>
> I am sure that I am missing some basic things, please guide me.
>
> -Regards
> Harikrishnan R