You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by jasdeep <js...@gmail.com> on 2007/05/22 16:07:29 UTC

Connection Pooling How To ?

Hi All ,

 i am developing a struts  based web-application with JBoss 4.0.5 as
Application Server and Oracle 10g Express edition .
 I am configuring my application for connection pooling .
 I have tried following methods :
 1. Oracle Connection Pooling  following thius link
http://www.lc.leidenuniv.nl/awcourse/oracle/java.920/a96654/connpoca.htm
 2. Configuring Jboss's Internal Container Level Connection pooling  simply
creating the datasources
 3. JDBC level Connection Pooling  

but unluckily did not succeed in any of these method .
The application works OK with Second method but When it is being hit with 
200 request/second The pool gets exhaulsted .

i am unable to decide which approach i should be using  as my application
can receive large no. of requests around 1000/sec ?

Please help me out ,
 
Tell some useful link if possible ..

Regards ,
Jasdeep




  
 
-- 
View this message in context: http://www.nabble.com/Connection-Pooling--How-To---tf3796605.html#a10738742
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Connection Pooling How To ?

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jasdeep,

jasdeep wrote:
> Yes this is peek load actually .. The requests are through SMS's which
> is forwarded by kannel server to my application . actually we are in
> development phase and we are testing it as per client specifications.
> 
> So this was the load client specified ... i had set the max limit of
> my pool to 100 ... that may be the problem . i will go and increase it
> now...

If you need to serve 200 requests per second, ten you need to evaluate
what percentage of requests result in DB connection use, and then
estimate the number of those that are simple SELECTs versus more complex
queries.

I'll bet that many of your requests use connections for a very short
amount of time, while others take more time. You need to either estimate
or observe that pattern (and you can only estimate right now, since
you're only in the dev phase) and then plan the size of your connection
pool based upon that.

This is crude capacity planning. If each connection lasts 1 second (a
long time) and uses a DB connection through the entire request-response
cycle, then you'll need exactly 200 connections in your connection pool
(plus a few extra for good measure).

200 connections to your database might get very heavy, especially for
Oracle (which at least /used/ to be known for very very heavy
server-side connection memory requirements -- the db server, not the app
server).

Hope that helps,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGVDV19CaO5/Lv0PARAkEPAJ9UlPFD76jlZcTwEUr4Hf4jQXQj0gCfUzM3
ZE3Nb1DdqEh44WPc5l4EoZ8=
=60Zz
-----END PGP SIGNATURE-----

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


Re: Connection Pooling How To ?

Posted by jasdeep <js...@gmail.com>.
Hi Christropher ..
    Yes this is peek load actualy .. 
    The requests are through SMS's which is forwarded by kannel server to my
application .
    actually we are in development phase and we are testing it as per client
specifications.
    So this was the load client specified ...
    i had set the max limit of my pool to 100 ...
    that may be the problem . i wud go and increase it now...

Thanx 

        


Christopher Schultz-2 wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Jasdeep,
> 
> jasdeep wrote:
>>  2. Configuring Jboss's Internal Container Level Connection pooling 
>> simply
>> creating the datasources
> 
> This is the right way to do things.
> 
>> The application works OK with Second method but When it is being hit with 
>> 200 request/second The pool gets [exhausted].
> 
> 200 requests per second is a /lot/ of traffic (8 million requests per
> month, if that load is sustained). Is this a peak load, or a steady load?
> 
> Does your pool become permanently exhausted? Or, do you have some users
> who get exceptions (cannot get connection after timeout) and others who
> get through. If the load drops off, is your pool still exhausted? If
> that's the case, then you have a connection leak in your application.
> 
> With heavy load, usually individual requests fail, but the server is
> still healthy. You might run out of memory, but you can avoid that by
> configuring your server to accept only a certain number of requests and
> refusing the rest.
> 
> How long is your connection pool timeout (the amount of time a thread
> will wait for a connection before giving up). Perhaps you have to
> increase that timeout. You could also increase the number of connections
> in your pool. How many do you have in there, now?
> 
> The last option is to buy more hardware. If you really are getting 200
> requests/sec, then you probably need some more hardware for your
> application.
> 
>> i am unable to decide which approach i should be using  as my application
>> can receive large no. of requests around 1000/sec ?
> 
> Geez... I hope that's /peak/ load. Do you have to handle 1000
> requests/sec or 1000 simultaneous users?
> 
> - -chris
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iD8DBQFGUv4G9CaO5/Lv0PARAvZNAJ9+S6+Oyl5cEyFoxkgCmijHkJBJXgCgrzhP
> lSigTUYwfyzbIkiEfBLT3Qw=
> =ncCh
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Connection-Pooling--How-To---tf3796605.html#a10757338
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Connection Pooling How To ?

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jasdeep,

jasdeep wrote:
>  2. Configuring Jboss's Internal Container Level Connection pooling  simply
> creating the datasources

This is the right way to do things.

> The application works OK with Second method but When it is being hit with 
> 200 request/second The pool gets [exhausted].

200 requests per second is a /lot/ of traffic (8 million requests per
month, if that load is sustained). Is this a peak load, or a steady load?

Does your pool become permanently exhausted? Or, do you have some users
who get exceptions (cannot get connection after timeout) and others who
get through. If the load drops off, is your pool still exhausted? If
that's the case, then you have a connection leak in your application.

With heavy load, usually individual requests fail, but the server is
still healthy. You might run out of memory, but you can avoid that by
configuring your server to accept only a certain number of requests and
refusing the rest.

How long is your connection pool timeout (the amount of time a thread
will wait for a connection before giving up). Perhaps you have to
increase that timeout. You could also increase the number of connections
in your pool. How many do you have in there, now?

The last option is to buy more hardware. If you really are getting 200
requests/sec, then you probably need some more hardware for your
application.

> i am unable to decide which approach i should be using  as my application
> can receive large no. of requests around 1000/sec ?

Geez... I hope that's /peak/ load. Do you have to handle 1000
requests/sec or 1000 simultaneous users?

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGUv4G9CaO5/Lv0PARAvZNAJ9+S6+Oyl5cEyFoxkgCmijHkJBJXgCgrzhP
lSigTUYwfyzbIkiEfBLT3Qw=
=ncCh
-----END PGP SIGNATURE-----

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