Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id ED3542E002D for ; Mon, 24 Mar 2008 04:40:31 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 68620-04 for ; Mon, 24 Mar 2008 04:40:26 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from mail1003.centrum.cz (mail1003.centrum.cz [213.29.7.172]) by postgresql.org (Postfix) with ESMTP id 3AE4B2E002C for ; Mon, 24 Mar 2008 04:40:29 -0300 (ADT) Received: by mail1003.centrum.cz id S1610740548AbYCXHkP (ORCPT ); Mon, 24 Mar 2008 08:40:15 +0100 Received: from 147.32.124.245 by mail1003.centrum.cz (Centrum Mail) with HTTP Date: Mon, 24 Mar 2008 08:40:15 +0100 From: To: X-Mailer: Centrum Mail 1.0 MIME-Version: 1.0 X-Priority: 3 Message-ID: <200803240840.8128@centrum.cz> Subject: slow pg_connect() Content-Type: text/plain; charset="windows-1250" Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200803/435 X-Sequence-Number: 29389 Hi, I'm uning postgres 8.1 at P4 2.8GHz with 2GB RAM. (web server + database on the same server) Please, how long takes your connectiong to postgres? $starttimer=time()+microtime(); $dbconn = pg_connect("host=localhost port=5432 dbname=xxx user=xxx password=xxx") or die("Couldn't Connect".pg_last_error()); $stoptimer = time()+microtime(); echo "Generated in ".round($stoptimer-$starttimer,4)." s"; It takes more then 0.05s :( Only this function reduce server speed max to 20request per second. Than you for any Help! Best regards.