From: | Craig Ringer <craig(at)postnewspapers(dot)com(dot)au> |
---|---|
To: | firerox(at)centrum(dot)cz |
Cc: | pgsql-performance(at)postgresql(dot)org |
Subject: | Re: slow pg_connect() |
Date: | 2008-03-24 08:04:23 |
Message-ID: | 47E76087.3050901@postnewspapers.com.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-performance |
Craig Ringer wrote:
> firerox(at)centrum(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | vincent | 2008-03-24 08:35:44 | Re: slow pg_connect() |
Previous Message | Craig Ringer | 2008-03-24 07:58:16 | Re: slow pg_connect() |