Up Prev Next
From: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: openclient overhead and connection concentrators
Date: Apr 27 2001 2:22PM
Arne Claassen writes:
> We've just brought up a farm of linux machines using DBD::Sybase that used
> to connect to DBD::mysql, and the machines are suffering from some serious
> load increases. From our investigation, the load is coming from the
> increased overhead of opening and closing Sybase connections vs. mysql
> connections. We confirmed this by connecting to a DBD::Proxy server on
> Solaris, so that our farm just made DBD::Proxy connections and the Solaris
> box did all the openclient connects/disconnect (btw, never got DBD::Proxy to
> hold on to handles for caching). This slowed down the transactions, but the
> load on the linux farm dropped significantly.
> Our assessment is that we need some type of connection concentrator to cache
> connections and avoid the constant opening and closing. The options we know
> of are these:
> - Apache::DBI - this will keep one open connection per apache thread, which
> may turn into excessive open connections if we roll Sybase to more DBs
> - DBD::Proxy - figure out why caching isn't working
> - Roll our own Connection caching daemon to sit on each machine to reduce
> the connection pool and keep connections open longer
> Are there any connection caching/concentration daemons out there that people
> are using, or how have you solved your overhead problems with web apps?
I do connection pooling at the apache level - I've got a module that I
preload and that opens 10 connections in a BEGIN block, and stores
them in a hash. Then I use semaphores to synchornize access to the
connections. Basically the connections are opened in the parent httpd,
and are then available in each of the children. The downside is that
if the database server goes down you have to restart all the httpd
servers, and you have to make sure that each database request
terminates correctly and leaves the connection in a stable state
before releasing the semaphore.
However - I use Sybase::CTlib, not DBD::Sybase, but it should work
with DBD::Sybase too.
Email me directly if you want more details.
Michael Peppler - Data Migrations Inc. - firstname.lastname@example.org
http://www.mbay.net/~mpeppler - email@example.com
International Sybase User Group - http://www.isug.com
Sybase on Linux mailing list: firstname.lastname@example.org