Обсуждение: Postgres and AOLServer
Does anybody know if PHP would do connection pooling to Postgres as a module under AOLServer? If it would, does anyone have any idea how to configure AOLServer to connect with pools to Postgres? My thinking was that the threaded nature of AS would enable PHP to do connection pooling. Is it not the webserver that does the actual connection to the database rather than any module such as PHP? Thanks. gh
GH wrote: > Does anybody know if PHP would do connection pooling to Postgres as a > module under AOLServer? From the rough read of the module, no. It's like using a Perl CGI, where you'd create, and then destroy, the connection. > If it would, does anyone have any idea how to configure AOLServer to > connect with pools to Postgres? Blisteringly easy. If you've struggled with a single db migration in PHP, you'll wonder what went wrong in their design. They have beautiful logic abstracting the db connection _away_ from the display logic, from the scripts themselves. > My thinking was that the threaded nature of AS would enable PHP to > do connection pooling. Nope. It doesn't glue in that deeply, instead, you'd be creating tons of little PHP threads... same problem as apache+PHP. > Is it not the webserver that does the actual connection to the database > rather than any module such as PHP? This depends. AOLserver can do it. Or AOLserver can hand it off to Perl, to PHP, to whatever, and let that code do it. If AOLserver does it on it's own, it manages it all. Otherwise, it's like using Perl CGI connections... no persistance, no pool. -Bop -- Brought to you from iBop the iMac, a MacOS, Win95, Win98, LinuxPPC machine, which is currently in MacOS land. Your bopping may vary.
Ron Chmara wrote: > [. . .] > > My thinking was that the threaded nature of AS would enable PHP to > > do connection pooling. > > Nope. It doesn't glue in that deeply, [. . .] Correct, here's what the PHP manual says about persistent connections and multithreaded webservers such as AOLServer (although it doesn't mention it explicitly): ------------------------------ snip ------------------------------ The last method is to use PHP as a plug-in for a multithreaded web server. Currently this is only theoretical -- PHP does not yet work as a plug-in for any multithreaded web servers. Work is progressing on support for ISAPI, WSAPI, and NSAPI (on Windows), which will all allow PHP to be used as a plug-in on multithreaded servers like Netscape FastTrack, Microsoft's Internet Information Server (IIS), and O'Reilly's WebSite Pro. When this happens, the behavior will be essentially the same as for the multiprocess model described before. ------------------------------ snap ------------------------------ I'm getting worried about this connection pooling issue now too, being a PosgreSQL/PHP person. I haven't run into the problem yet but am currently building the biggest site I've ever done . . . what I don't really get about it: Since you will have one db connection per Apache process at the most, the issue depends on whether _Apache_ reuses its child processes; if those are sitting around idly whilst new ones are being created, then there's something wrong with the way Apache behaves or is configured(!). - Frank