Apache::DBI limit on connection pool

Apache::DBI limit on connection pool

am 25.04.2008 15:43:26 von Slinky

------=_Part_2965_5551859.1209131006686
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Good afternoon guys and girls,

I'm looking for a tip regarding my use of mod_perl and Apache DBI.

I'm making use of the two to maintain a pool of connections to Oracle. Great
set of modules, works a treat, so big thanks to Edmund, Doug, Tim and others
for their hard work :)

But slight issue. I have two Oracle "accounts", one dev and one prod. prod
and dev have different profiles set by the database team. The major issue is
a dev profile has an SESSIONS_PER_USER value of 10, but the prod profile
value is much higher.

Now when I'm working with dev, a pool of connections is created, in the
mod_perl namespace but this pool hits the 10 SESSIONS_PER_USER limit and
stops. Anything under mod_perl names spaces reuses the available connections
and doesn't suffer any problems, but a cron job for example which does not
run under the mod_perl namespace croaks because of the max out on the
SESSIONS_PER_USER. Same if I just wanted to run a sqlplus session.
Connection disallowed because of the limit.

Is that clear?

Want I'd like to know is, is there a way to limit the size of the pool? I've
skimmed the Apache::DBI source, and I mean "skimmed" but nothing obvious hit
me... It's not really a problem with prod because SESSIONS_PER_USER is a
decent figure, but it would be mightily useful for dev.

Look forward to hearing your suggestions.

Slinky

------=_Part_2965_5551859.1209131006686
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


Good afternoon guys and girls,



I'm looking for a tip regarding my use of mod_perl and Apache DBI.



I'm making use of the two to maintain a pool of connections to Oracle. Great

set of modules, works a treat, so big thanks to Edmund, Doug, Tim and others

for their hard work :)



But slight issue. I have two Oracle "accounts", one dev and one prod. prod

and dev have different profiles set by the database team. The major issue is

a dev profile has an SESSIONS_PER_USER value of 10, but the prod profile

value is much higher.



Now when I'm working with dev, a pool of connections is created, in the

mod_perl namespace but this pool hits the 10 SESSIONS_PER_USER limit and

stops. Anything under mod_perl names spaces reuses the available connections

and doesn't suffer any problems, but a cron job for example which does not

run under the mod_perl namespace croaks because of the max out on the

SESSIONS_PER_USER. Same if I just wanted to run a sqlplus session.

Connection disallowed because of the limit.



Is that clear?



Want I'd like to know is, is there a way to limit the size of the pool? I've

skimmed the Apache::DBI source, and I mean "skimmed" but nothing obvious hit

me... It's not really a problem with prod because SESSIONS_PER_USER is a

decent figure, but it would be mightily useful for dev.



Look forward to hearing your suggestions.



Slinky

------=_Part_2965_5551859.1209131006686--

Re: Apache::DBI limit on connection pool

am 25.04.2008 18:14:41 von Douglas Hunter

Slinky wrote:
>
> Want I'd like to know is, is there a way to limit the size of the pool? I've
> skimmed the Apache::DBI source, and I mean "skimmed" but nothing obvious hit
> me... It's not really a problem with prod because SESSIONS_PER_USER is a
> decent figure, but it would be mightily useful for dev.
>

Assuming one connection per process, I'd just set my MaxClients to fewer
than the number of SESSIONS_PER_USER. Not exactly an Apache::DBI
solution, but if you have control over your dev environment's httpd.conf
it might could work.

-- Douglas Hunter

Re: Apache::DBI limit on connection pool

am 25.04.2008 20:13:24 von Perrin Harkins

On Fri, Apr 25, 2008 at 9:43 AM, Slinky wrote:
> I'm making use of the two to maintain a pool of connections to Oracle.

Well, you're not really. :)
Apache::DBI doesn't do what most people would consider "pooling" since
sharing connections between processes is not possible. It just makes
your connections persistent so that you don't have to reconnect each
time.

> Want I'd like to know is, is there a way to limit the size of the pool?

Either set the number of processes low, as Doug suggested, or don't
use Apache::DBI on your dev server.

- Perrin

Re: Apache::DBI limit on connection pool

am 25.04.2008 21:08:26 von Philip Gollucci

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Perrin Harkins wrote:
| On Fri, Apr 25, 2008 at 9:43 AM, Slinky wrote:
|> I'm making use of the two to maintain a pool of connections to Oracle.
|
| Well, you're not really. :)
| Apache::DBI doesn't do what most people would consider "pooling" since
| sharing connections between processes is not possible. It just makes
| your connections persistent so that you don't have to reconnect each
| time.
|
|> Want I'd like to know is, is there a way to limit the size of the pool?
|
| Either set the number of processes low, as Doug suggested, or don't
| use Apache::DBI on your dev server.
|
| - Perrin
FWIW: For what its worth, Stas and someone where workign on DBI::Pool,
but gave up.

See Also, httpd's mod_dbd and mod_dbd_mysql which would be cool to get
some perl bindings for.


- --
- ------------------------------------------------------------ ------------
Philip M. Gollucci (philip@ridecharge.com)
o:703.549.2050x206
Senior System Admin - Riderway, Inc.
http://riderway.com / http://ridecharge.com
1024D/DB9B8C1C B90B FBC3 A3A1 C71A 8E70 3F8C 75B8 8FFB DB9B 8C1C

Work like you don't need the money,
love like you'll never get hurt,
and dance like nobody's watching.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.8 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIEiwqdbiP+9ubjBwRAsqnAJwL2QFblgbm2W+Y7eFn0fKOkcFQKQCf cDX8
0lApeJcnndOcIcom4kKny3I=
=bAE5
-----END PGP SIGNATURE-----

Re: Apache::DBI limit on connection pool

am 25.04.2008 21:12:44 von Perrin Harkins

On Fri, Apr 25, 2008 at 3:08 PM, Philip M. Gollucci
wrote:
> FWIW: For what its worth, Stas and someone where workign on DBI::Pool,
> but gave up.
>
> See Also, httpd's mod_dbd and mod_dbd_mysql which would be cool to get
> some perl bindings for.

If anyone actually needs a production-ready DBI connection pool, I'd
recommend DBI::Gofer:
http://www.slideshare.net/oscon2007/os-bunce

- Perrin