From: Craig Ringer <craig@postnewspapers.com.au>
To: firerox@centrum.cz
Cc: pgsql-performance@postgresql.org
Subject: Re: slow pg_connect()
Date: Mon, 24 Mar 2008 17:04:23 +0900
Message-ID: <47E76087.3050901@postnewspapers.com.au> (raw)
In-Reply-To: <47E75F18.9060206@postnewspapers.com.au>
References: <200803240840.8128@centrum.cz>
<47E75F18.9060206@postnewspapers.com.au>
Craig Ringer wrote:
> firerox@centrum.cz wrote:
>> It takes more then 0.05s :(
>>
>> Only this function reduce server speed max to 20request per second.
>>
> If you need that sort of frequent database access, you might want to
> look into:
>
> - Doing more work in each connection and reducing the number of
> connections required;
> - Using multiple connections in parallel;
> - Pooling connections so you don't need to create a new one for every
> job;
> - Using a more efficient database connector and/or language;
> - Dispatching requests to a persistent database access provider that's
> always connected
>
Oh, I missed:
Use a UNIX domain socket rather than a TCP/IP local socket. Database
interfaces that support UNIX sockets (like psycopg) will normally do
this if you omit the host argument entirely.
--
Craig Ringer
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: craig@postnewspapers.com.au, firerox@centrum.cz
Subject: Re: slow pg_connect()
In-Reply-To: <47E76087.3050901@postnewspapers.com.au>
* 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