pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: firerox@centrum.cz
To: pgsql-performance@postgresql.org
Subject: slow pg_connect()
Date: Mon, 24 Mar 2008 08:40:15 +0100
Message-ID: <200803240840.8128@centrum.cz> (raw)

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.




view thread (7+ messages)  latest in thread

Message-ID: <200803240840.8128@centrum.cz>
Permalink:  ../200803240840.8128@centrum.cz/
Also on:    postgresql.org/message-id/200803240840.8128@centrum.cz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: firerox@centrum.cz
  Subject: Re: slow pg_connect()
  In-Reply-To: <200803240840.8128@centrum.cz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox