You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by arturl <ar...@pi.net.pl> on 2003/03/04 18:10:10 UTC

Datasource from pool

Hello,

My cocoon app is hanging on mysql database access.
I've got following messages in core.log:
DEBUG   (2003-03-04) 18:01.38:704   [core.datasources.foo] (/foo.html)
Thread-268/ResourceLimitingPool: Blocking until a Poolable is available.
Thread: Thread-268

I use this driver class:
com.mysql.jdbc.Driver
Datasource defined in cocoon.xconf:
 <datasources>
    <jdbc logger="core.datasources.foo" name="foo">
      <pool-controller max="10" min="5"/>

<dburl>jdbc:mysql://localhost/base?useUnicode=true&amp;characterEncoding=iso
-8859-2</dburl>
    </jdbc>
  </datasources>

When more pages using this coonection are requested, threads are waiting and
maxThreads parameter is exceeded.

What should I do and when to look for more debug information?

Artur


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Datasource from pool

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 06.Mar.2003 -- 03:45 PM, arturl wrote:
> 
> 
> > > Generally all connections are returned. But increasing number of
> accessing
> > > the pool (by multiplying number of requested xsp pages) results in pool
> > > blocking. Is it a normal situation?
> >
> > Sure, if you have a pool of 10, you may have 10 concurrent
> > users. Every additional user is blocked until a connection is returned
> > to the pool.
> Yes, I understand it. I just wonder, why there's a hangup of the pool  if
> all connections should be returned.

Without knowing the details here, it appears that connections are held
too long for the pool size and incoming rate.

> >OTOH it should only be fractions of a second that a
> > connection is used.
> > Maybe you should just increase the number of
> > connections in your pool.
> I'm trying on that. BTW - is there a formula on counting the optimal size of
> the pool (taking into account number of concurrent connections)?

None that *I* know of. But that doesn't mean much :-)
If your page holds the connection s seconds and you have c incoming
requests per second, you need s*c connections, right? Let's add some
10% slack, that would give ceil(1.1*s*c) Eg. s=0.500 c=5 => 3
But that's probably too obvious to be a good rule ;-)

	Chris.
-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Datasource from pool

Posted by arturl <ar...@pi.net.pl>.

> > Generally all connections are returned. But increasing number of
accessing
> > the pool (by multiplying number of requested xsp pages) results in pool
> > blocking. Is it a normal situation?
>
> Sure, if you have a pool of 10, you may have 10 concurrent
> users. Every additional user is blocked until a connection is returned
> to the pool.
Yes, I understand it. I just wonder, why there's a hangup of the pool  if
all connections should be returned.

>OTOH it should only be fractions of a second that a
> connection is used.
> Maybe you should just increase the number of
> connections in your pool.
I'm trying on that. BTW - is there a formula on counting the optimal size of
the pool (taking into account number of concurrent connections)?

Artur



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Datasource from pool

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 05.Mar.2003 -- 12:11 PM, arturl wrote:
> > ESQL *should* be safe. Look at the logs (set log level to "debug"!)
> > and try to find lines indicating that the connection is returned to
> > the pool.
> >
> Generally all connections are returned. But increasing number of accessing
> the pool (by multiplying number of requested xsp pages) results in pool
> blocking. Is it a normal situation?

Sure, if you have a pool of 10, you may have 10 concurrent
users. Every additional user is blocked until a connection is returned
to the pool. OTOH it should only be fractions of a second that a
connection is used. Maybe you should just increase the number of
connections in your pool.

> Shouldn't  the connections be returned anyway?

Can't parse that.

	Chris.
-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Datasource from pool

Posted by arturl <ar...@pi.net.pl>.
> >
> >
>
> ESQL *should* be safe. Look at the logs (set log level to "debug"!)
> and try to find lines indicating that the connection is returned to
> the pool.
>

Generally all connections are returned. But increasing number of accessing
the pool (by multiplying number of requested xsp pages) results in pool
blocking. Is it a normal situation?
Shouldn't  the connections be returned anyway?

Artur


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Datasource from pool

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 05.Mar.2003 -- 10:33 AM, arturl wrote:
> 
> 
> > On 04.Mar.2003 -- 06:10 PM, arturl wrote:
> > > Hello,
> > >
> > > My cocoon app is hanging on mysql database access.
> > > I've got following messages in core.log:
> > > DEBUG   (2003-03-04) 18:01.38:704   [core.datasources.foo] (/foo.html)
> > > Thread-268/ResourceLimitingPool: Blocking until a Poolable is available.
> > > Thread: Thread-268
> 
> >
> > You sure return all datasources back to the pool, don't you.
> 
> > IOW which components that you have use the datasource? Stock
> > components should be safe, your own may have a leak?
> >
> I use the datasource on my custom xsp pages by esql logicsheet:
> <esql:connection>
>   <esql:pool>connectionName</esql:pool>
> </esql:connection>
> Can you give me a clue how to ensure returning the datasource to the pool
> (and where to check for it)?

ESQL *should* be safe. Look at the logs (set log level to "debug"!)
and try to find lines indicating that the connection is returned to
the pool.

	Chris.
-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Datasource from pool

Posted by arturl <ar...@pi.net.pl>.

> On 04.Mar.2003 -- 06:10 PM, arturl wrote:
> > Hello,
> >
> > My cocoon app is hanging on mysql database access.
> > I've got following messages in core.log:
> > DEBUG   (2003-03-04) 18:01.38:704   [core.datasources.foo] (/foo.html)
> > Thread-268/ResourceLimitingPool: Blocking until a Poolable is available.
> > Thread: Thread-268

>
> You sure return all datasources back to the pool, don't you.

> IOW which components that you have use the datasource? Stock
> components should be safe, your own may have a leak?
>
I use the datasource on my custom xsp pages by esql logicsheet:
<esql:connection>
  <esql:pool>connectionName</esql:pool>
</esql:connection>
Can you give me a clue how to ensure returning the datasource to the pool
(and where to check for it)?

Artur




---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Datasource from pool

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 04.Mar.2003 -- 06:10 PM, arturl wrote:
> Hello,
> 
> My cocoon app is hanging on mysql database access.
> I've got following messages in core.log:
> DEBUG   (2003-03-04) 18:01.38:704   [core.datasources.foo] (/foo.html)
> Thread-268/ResourceLimitingPool: Blocking until a Poolable is available.
> Thread: Thread-268
> 
> I use this driver class:
> com.mysql.jdbc.Driver
> Datasource defined in cocoon.xconf:
>  <datasources>
>     <jdbc logger="core.datasources.foo" name="foo">
>       <pool-controller max="10" min="5"/>
> 
> <dburl>jdbc:mysql://localhost/base?useUnicode=true&amp;characterEncoding=iso
> -8859-2</dburl>
>     </jdbc>
>   </datasources>
> 
> When more pages using this coonection are requested, threads are waiting and
> maxThreads parameter is exceeded.
> 
> What should I do and when to look for more debug information?

You sure return all datasources back to the pool, don't you.

IOW which components that you have use the datasource? Stock
components should be safe, your own may have a leak?

	Chris.
-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org