You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-cs@ibatis.apache.org by Jonathan Lim <jl...@ueic.com> on 2009/08/06 21:34:53 UTC

speeding up web service using ibatis

Hi,

I'm a relative iBatis novice. The guy who knew much about iBatis left the
company about 3 years ago.

We have iBatis.Net DataMapper 1.5.1 running on a Windows Server 2003 behind
some web services.

We're having some trouble with IIS and/or iBatis and I was wondering if you
could point me in the right direction.

The problem is we would like to quickly run multiple instances of a
repetitive web service query.

A single call takes about half a second currently.

Separating the ibatis calls into a regular multithreaded app and then
profiling with 10 threads shows the section of the code involved with
opening a connection takes about 30% of the time. These should be the
relevant parts:

public static volatile ISqlMapper mapper =
IBatisNet.DataMapper.Mapper.Instance();

mapper.OpenConnection(connStr);

At 30% this routine has the highest percentage time usage, but I don't see
any obvious way of avoiding it.

Any suggestion would be appreciated.

Thanks,
Jonathan
-- 
View this message in context: http://www.nabble.com/speeding-up-web-service-using-ibatis-tp24852995p24852995.html
Sent from the iBATIS - User - Cs mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-cs-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-cs-help@ibatis.apache.org


Re: speeding up web service using ibatis

Posted by Michael McCurrey <mm...@gmail.com>.
Awesome, glad to see it worked

On Thu, Aug 6, 2009 at 2:21 PM, Jonathan Lim <jl...@ueic.com> wrote:

>
> Michael,
>
> Thank you for your quick reply. A quick test of adding
>
> Max Pool Size=100;Pooling=true
>
> to the connection string did improve the performance of the open connection
> routine enough that it is no longer the slowest routine.
>
> Thanks again for the direction to go towards,
> Jonathan
>
>
> Michael McCurrey-3 wrote:
> >
> > Couple of things.
> >
> > What database are you backing this against?  Do you have connection
> > pooling
> > enabled?
> >
> >
> > On Thu, Aug 6, 2009 at 12:34 PM, Jonathan Lim <jl...@ueic.com> wrote:
> >
> >>
> >> Hi,
> >>
> >> I'm a relative iBatis novice. The guy who knew much about iBatis left
> the
> >> company about 3 years ago.
> >>
> >> We have iBatis.Net DataMapper 1.5.1 running on a Windows Server 2003
> >> behind
> >> some web services.
> >>
> >> We're having some trouble with IIS and/or iBatis and I was wondering if
> >> you
> >> could point me in the right direction.
> >>
> >> The problem is we would like to quickly run multiple instances of a
> >> repetitive web service query.
> >>
> >> A single call takes about half a second currently.
> >>
> >> Separating the ibatis calls into a regular multithreaded app and then
> >> profiling with 10 threads shows the section of the code involved with
> >> opening a connection takes about 30% of the time. These should be the
> >> relevant parts:
> >>
> >> public static volatile ISqlMapper mapper =
> >> IBatisNet.DataMapper.Mapper.Instance();
> >>
> >> mapper.OpenConnection(connStr);
> >>
> >> At 30% this routine has the highest percentage time usage, but I don't
> >> see
> >> any obvious way of avoiding it.
> >>
> >> Any suggestion would be appreciated.
> >>
> >> Thanks,
> >> Jonathan
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/speeding-up-web-service-using-ibatis-tp24852995p24852995.html
> >> Sent from the iBATIS - User - Cs mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-cs-unsubscribe@ibatis.apache.org
> >> For additional commands, e-mail: user-cs-help@ibatis.apache.org
> >>
> >>
> >
> >
> > --
> > Michael J. McCurrey
> > Read with me at http://www.mccurrey.com
> > http://chaoticmindramblings.blogspot.com/
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/speeding-up-web-service-using-ibatis-tp24852995p24854671.html
> Sent from the iBATIS - User - Cs mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-cs-unsubscribe@ibatis.apache.org
> For additional commands, e-mail: user-cs-help@ibatis.apache.org
>
>


-- 
Michael J. McCurrey
Read with me at http://www.mccurrey.com
http://chaoticmindramblings.blogspot.com/

Re: speeding up web service using ibatis

Posted by Jonathan Lim <jl...@ueic.com>.
The database was sql server. From what I've read so far I agree that those
are the default settings. I don't know exactly why the speed improved. The
profiled timings of the calls even with the same connection string do have
some significant variation. There is more work to do, but after 4 tries each
the fastest time (14.7) occurred with the addition and the worst (21.1)
without it. 


Andrea Tassinari wrote:
> 
> 
> On Thu, August 6, 2009 11:21 pm, Jonathan Lim said:
>>
>> Michael,
>>
>> Thank you for your quick reply. A quick test of adding
>>
>> Max Pool Size=100;Pooling=true
>>
>> to the connection string did improve the performance of the open
>> connection
>> routine enough that it is no longer the slowest routine.
> 
> which database are you using? Correct me if I am wrong but "Max Pool
> Size=100;Pooling=true" are exactly the default values for the SqlClient,
> so the pooling should be enabled without specify then in the connection
> string.
> 
> http://msdn.microsoft.com/en-us/library/8xx3tyca%28VS.71%29.aspx
> 
> 
> -- 
> AndreaT
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-cs-unsubscribe@ibatis.apache.org
> For additional commands, e-mail: user-cs-help@ibatis.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/speeding-up-web-service-using-ibatis-tp24852995p24869146.html
Sent from the iBATIS - User - Cs mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-cs-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-cs-help@ibatis.apache.org


Re: speeding up web service using ibatis

Posted by AndreaT <an...@i-mconsulting.com>.
On Thu, August 6, 2009 11:21 pm, Jonathan Lim said:
>
> Michael,
>
> Thank you for your quick reply. A quick test of adding
>
> Max Pool Size=100;Pooling=true
>
> to the connection string did improve the performance of the open
> connection
> routine enough that it is no longer the slowest routine.

which database are you using? Correct me if I am wrong but "Max Pool
Size=100;Pooling=true" are exactly the default values for the SqlClient,
so the pooling should be enabled without specify then in the connection
string.

http://msdn.microsoft.com/en-us/library/8xx3tyca%28VS.71%29.aspx


-- 
AndreaT


---------------------------------------------------------------------
To unsubscribe, e-mail: user-cs-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-cs-help@ibatis.apache.org


Re: speeding up web service using ibatis

Posted by Jonathan Lim <jl...@ueic.com>.
Michael,

Thank you for your quick reply. A quick test of adding

Max Pool Size=100;Pooling=true

to the connection string did improve the performance of the open connection
routine enough that it is no longer the slowest routine.

Thanks again for the direction to go towards,
Jonathan


Michael McCurrey-3 wrote:
> 
> Couple of things.
> 
> What database are you backing this against?  Do you have connection
> pooling
> enabled?
> 
> 
> On Thu, Aug 6, 2009 at 12:34 PM, Jonathan Lim <jl...@ueic.com> wrote:
> 
>>
>> Hi,
>>
>> I'm a relative iBatis novice. The guy who knew much about iBatis left the
>> company about 3 years ago.
>>
>> We have iBatis.Net DataMapper 1.5.1 running on a Windows Server 2003
>> behind
>> some web services.
>>
>> We're having some trouble with IIS and/or iBatis and I was wondering if
>> you
>> could point me in the right direction.
>>
>> The problem is we would like to quickly run multiple instances of a
>> repetitive web service query.
>>
>> A single call takes about half a second currently.
>>
>> Separating the ibatis calls into a regular multithreaded app and then
>> profiling with 10 threads shows the section of the code involved with
>> opening a connection takes about 30% of the time. These should be the
>> relevant parts:
>>
>> public static volatile ISqlMapper mapper =
>> IBatisNet.DataMapper.Mapper.Instance();
>>
>> mapper.OpenConnection(connStr);
>>
>> At 30% this routine has the highest percentage time usage, but I don't
>> see
>> any obvious way of avoiding it.
>>
>> Any suggestion would be appreciated.
>>
>> Thanks,
>> Jonathan
>> --
>> View this message in context:
>> http://www.nabble.com/speeding-up-web-service-using-ibatis-tp24852995p24852995.html
>> Sent from the iBATIS - User - Cs mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-cs-unsubscribe@ibatis.apache.org
>> For additional commands, e-mail: user-cs-help@ibatis.apache.org
>>
>>
> 
> 
> -- 
> Michael J. McCurrey
> Read with me at http://www.mccurrey.com
> http://chaoticmindramblings.blogspot.com/
> 
> 

-- 
View this message in context: http://www.nabble.com/speeding-up-web-service-using-ibatis-tp24852995p24854671.html
Sent from the iBATIS - User - Cs mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-cs-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-cs-help@ibatis.apache.org


Re: speeding up web service using ibatis

Posted by Michael McCurrey <mm...@gmail.com>.
Couple of things.

What database are you backing this against?  Do you have connection pooling
enabled?


On Thu, Aug 6, 2009 at 12:34 PM, Jonathan Lim <jl...@ueic.com> wrote:

>
> Hi,
>
> I'm a relative iBatis novice. The guy who knew much about iBatis left the
> company about 3 years ago.
>
> We have iBatis.Net DataMapper 1.5.1 running on a Windows Server 2003 behind
> some web services.
>
> We're having some trouble with IIS and/or iBatis and I was wondering if you
> could point me in the right direction.
>
> The problem is we would like to quickly run multiple instances of a
> repetitive web service query.
>
> A single call takes about half a second currently.
>
> Separating the ibatis calls into a regular multithreaded app and then
> profiling with 10 threads shows the section of the code involved with
> opening a connection takes about 30% of the time. These should be the
> relevant parts:
>
> public static volatile ISqlMapper mapper =
> IBatisNet.DataMapper.Mapper.Instance();
>
> mapper.OpenConnection(connStr);
>
> At 30% this routine has the highest percentage time usage, but I don't see
> any obvious way of avoiding it.
>
> Any suggestion would be appreciated.
>
> Thanks,
> Jonathan
> --
> View this message in context:
> http://www.nabble.com/speeding-up-web-service-using-ibatis-tp24852995p24852995.html
> Sent from the iBATIS - User - Cs mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-cs-unsubscribe@ibatis.apache.org
> For additional commands, e-mail: user-cs-help@ibatis.apache.org
>
>


-- 
Michael J. McCurrey
Read with me at http://www.mccurrey.com
http://chaoticmindramblings.blogspot.com/