Skip to Content.
Sympa Menu

freetds - Re: php pconnect

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Michael Peppler <mpeppler AT peppler.org>
  • To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
  • Subject: Re: php pconnect
  • Date: Wed, 16 Jan 2002 10:49:49 -0800


Brian Bruns writes:
>
> The only alternatives to this would be a) threaded apache (ie 2.0) should
> be capable of storing this type of stuff globally, however php would need
> to support it and since 2.0 is not yet solid (haven't been tracking it in
> a while, i may be a bit pessimistic) it'd be a while. b) a connection
> pool of some sort, well not of some sort, of a very particular sort
> actually. The connection pool would have to run as its own process. The
> FreeTDS connection pool is just such a beast, although it is arduous to
> configure and only support TDS 4.2 currently.

Actually there is another way, although I don't know if that works
with FreeTDS, or with php.

Sybase OpenClient connections can be shared across forks, as long as
only one process uses the connection at any given moment, and that the
entire query is executed and all results fetched before control of
that connection is reliquished.

I have a perl/mod_perl module called Apache::Sybase::ConPool that uses
this feature - you use the module to create a number of connections in
the parent Apache process when apache starts, and then you access
these connections in the child processes, using SysV semaphores to
control access to each connection. The message boards/photo albums of
www.classmates.com use this code, allocating 8 connections per web
server. This works quite well, with the caveat that if the database
server is rebooted you have to restart the web servers as the
connections can't be re-initialized from the child httpd processes.

Michael
--
Michael Peppler - Data Migrations Inc. - http://www.mbay.net/~mpeppler
mpeppler AT peppler.org - mpeppler AT mbay.net
International Sybase User Group - http://www.isug.com




Archive powered by MHonArc 2.6.24.

Top of Page