Search Postgresql Archives

Re: Persistent Connections in Webserver Environment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02.05.2005 16:41, Marco Colombo wrote:

Have you measured the real gain in using persistent connections at all?

As simple as possible:

<?php
require_once('Benchmark/Timer.php');
$timer =& new Benchmark_Timer();
$timer->start();

pg_pconnect('host=myhost dbname=database user=user');
pg_query("SET search_path TO myschema;");

$q = "SELECT u.login FROM users WHERE u.user_id = 1;";

$qr = pg_query($q);

print_r(pg_fetch_all($qr));

$timer->setMarker('Database');
$timer->stop();
$timer->display();
?>

Results:

pconnect: 0.001435995101928
connect:  0.016793966293335

It's factor 10 on such simple things on the BSD box.

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux