X-Original-To: pgsql-www-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 15F2AD1B17E for ; Mon, 10 May 2004 16:17:16 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 17202-04 for ; Mon, 10 May 2004 16:16:55 -0300 (ADT) Received: from ganymede.hub.org (u46n208.hfx.eastlink.ca [24.222.46.208]) by svr1.postgresql.org (Postfix) with ESMTP id 035C4D1B1BE for ; Mon, 10 May 2004 16:16:54 -0300 (ADT) Received: by ganymede.hub.org (Postfix, from userid 1000) id 8BBD83618A; Mon, 10 May 2004 16:16:55 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by ganymede.hub.org (Postfix) with ESMTP id 8AC3936051 for ; Mon, 10 May 2004 16:16:55 -0300 (ADT) Date: Mon, 10 May 2004 16:16:55 -0300 (ADT) From: "Marc G. Fournier" X-X-Sender: scrappy@ganymede.hub.org To: pgsql-www@postgresql.org Subject: Web code ... Message-ID: <20040510160122.S34032@ganymede.hub.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200405/19 X-Sequence-Number: 4398 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/www.postgresql.org/www/globals.php, there are two pconnects: line 220: $db = @pg_pconnect($PortalDB); if (!$db) { header("Location: /unavailable.html\n\n"); die; } line 263: $db = @pg_pconnect($GborgDB); if (!$db) { echo "We are currently experiencing technical difficulies, please stand by."; die(); } 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 (http://www.hub.org) Email: scrappy@hub.org Yahoo!: yscrappy ICQ: 7615664