logo       

Re: too many clients: msg#00004

Subject: Re: too many clients
At 12:12 PM 12/29/04, Matthew Terenzio wrote:


On Dec 29, 2004, at 11:38 AM, Mitch Pirtle wrote:

You got a couple solutions, one of which is getting a connection
pooler setup between apache(php) and postgres.  SQL Relay
(sqlrelay.sf.net) could be a common candidate, as I have used it in
the past with great results.

Yes, I have taken a look at that before. It might be a good time to try it.

I don't exactly understand the technical difference between pooled connections and persistent ones.

pg_pconnect() is grabbing an existing open connection if one is available.

How is  a connection pool more efficient in doing something along these lines?


Have you read the php docs on persistent connections?
        http://www.php.net/manual/en/features.persistent-connections.php
pg_pconnect is sometimes used in situations where it does not make sense.

As you mentioned, apache uses numerous child process. A persistent connection can only be reused if the following things are the same:
        - same apache child process requests the connection
        - same connect string (ie host, database, user are *all* the same)

If you have a site where there are many databases and/or many users, it is very easy for apache to retain more persistent connections than your postgres limit. There are many variables when trying to figure out which function works better, so simply try it on your own system. If pg_connect does not add significant overhead, and manages to avoid the problems you mentioned, then use it instead of pg_pconnect.

I haven't heard of pooled connections, but can only assume they somehow overcome the problems with pg_pconnect gets out of control - perhaps the connections are shared across apache child processes.

Frank

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

              http://archives.postgresql.org



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
audio.irate.dev...    yellowdog.gener...    ietf.ips/2002-0...    xfree86.fonts/2...    busybox/2003-07...    emacs.jdee/2004...    linux.mandrake....    hardware.microc...    user-groups.lin...    science.analysi...    version-control...    db.filemaker.de...    cluster.openmos...    mail.eyebrowse....    text.xml.xerces...    kde.devel.kwrit...    finance.moneyda...    gcc.regression/...    network.routing...    os.freebsd.deve...    recreation.radi...    qnx.openqnx.dev...    python.xml/2002...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe