Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: max DBPROCESS problem
Date: Mar 12 2001 11:29PM

jimmy mcdonald writes:
 > >First, I question the real need for an apache process to have more
 > >than 25 open connections (unless you open the connections during
 > >startup and share them later on among the apache children, but even
 > >then you shouldn't need that many)
 > the goal is to keep persistent connections so that one of the perl
 > scripts can easily connect to the database.
 > we have about 50 different scripts that someone might use
 > from the website.

OK - but why would each script need it's own connection?

You should instead write a small module that does something like this:

package My::Sybase;

use Sybase::DBlib;

my $dbh;

sub connect {
    return $dbh if $dbh;

    $dbh = new Sybase::DBlib ...;

and in your scripts you do

use My::Sybase;
use Sybase::DBlib;

my $dbh = My::Sybase::connect();


[Note: the above is for illustration - you need to add proper error
handling so that the $dbh is refreshed if the database server goes
down, for example]

If each apache httpd process can have up to 50 open connections then
your DB server will have to be configured to handle a *lot* of
connections, and that's just wasting space.

(unless each script connects to a different database server, of course)

Michael Peppler - Data Migrations Inc. - -
International Sybase User Group -
Sybase on Linux mailing list: