Skip site navigation (1) Skip section navigation (2)

Web code ...

From: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>
To: pgsql-www(at)postgresql(dot)org
Subject: Web code ...
Date: 2004-05-10 19:16:55
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-www
Our Database server is being pounded right now with >500 connections for
just 186_gborg and 186_pgsql ... figuring to take a quick look at the
code, can someone explain to me a few things?

in /usr/local/www/, there are two

line 220:
  $db = @pg_pconnect($PortalDB);

  if (!$db) {
    header("Location: /unavailable.html\n\n");

line 263:
$db = @pg_pconnect($GborgDB);

if (!$db)
        echo "We are currently experiencing technical difficulies, please
stand by.";

am I missing something, or does the second pconnect overwrite the first?
and, if so, doesn't that then leave a 'dangling' connection, or does it
know better?

Then, in index.php, you do *another* pconnect at line 3:

  $db = pg_pconnect($PortalDB);

and you have it all over the place from what I can tell here:

www# grep pconnect *
bugsub.php:  $db = pg_pconnect($PortalDB);
event-archive.php:  $db = pg_pconnect($PortalDB);
event.php:  $db = pg_pconnect($PortalDB);
globals.php:  $db = @pg_pconnect($PortalDB);
globals.php:$db = @pg_pconnect($GborgDB);
index.php:  $db = pg_pconnect($PortalDB);
mirrors-ftp.php:  $conn = @pg_pconnect($PortalDB);
mirrors-www.php:  $conn = @pg_pconnect($PortalDB);
news-archive.php:  $db = pg_pconnect($PortalDB);
news.php:  $db = pg_pconnect($PortalDB);
submission.php:  $db = pg_pconnect($PortalDB);
survey.php:  $db = pg_pconnect($PortalDB);

why not just one pconnect in global.php that everythign shares?

Marc G. Fournier           Hub.Org Networking Services (
Email: scrappy(at)hub(dot)org           Yahoo!: yscrappy              ICQ: 7615664

pgsql-www by date

Next:From: Dave PageDate: 2004-05-11 09:01:12
Subject: Re: Web code ...
Previous:From: Rick GiggerDate: 2004-05-07 19:03:14
Subject: Re: pgFoundry Open For Business

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group