"; echo "
Stressing postmaster with $max connections
"; echo "
Connection type
Time (seconds)
"; /* * tcpip connections */ $host = "localhost"; $port = "5432"; $tt = time(); for($i=0; $i<$max; $i++) { $conn = pg_Connect($host, $port, "", "", $db); pg_Close($conn); } $tt = time() - $tt; echo "
tcpip local
$tt
"; /* * tcpip connections with selects */ $host = "localhost"; $port = "5432"; $tt = time(); for($i=0; $i<$max; $i++) { $conn = pg_Connect($host, $port, "", "", $db); $res = pg_Exec($conn, "select 17"); pg_Close($conn); } $tt = time() - $tt; echo "
tcpip local with select
$tt
"; /* * unix sockets connections */ $host = ""; $port = ""; $tt = time(); for($i=0; $i<$max; $i++) { $conn = pg_Connect($host, $port, "", "", $db); pg_Close($conn); } $tt = time() - $tt; echo "
unix sockets
$tt
"; /* * unix sockets connections with selects */ $host = ""; $port = ""; $tt = time(); for($i=0; $i<$max; $i++) { $conn = pg_Connect($host, $port, "", "", $db); $res = pg_Exec($conn, "select 17"); pg_Close($conn); } $tt = time() - $tt; echo "
unix sockets with select
$tt
"; /* * tcpip persistent connections */ $host = "localhost"; $port = "5432"; $tt = time(); for($i=0; $i<$max; $i++) { $conn = pg_pConnect($host, $port, "", "", $db); pg_Close($conn); } $tt = time() - $tt; echo "
tcpip local persistent
$tt
"; /* * tcpip persistent connections with selects */ $host = "localhost"; $port = "5432"; $tt = time(); for($i=0; $i<$max; $i++) { $conn = pg_pConnect($host, $port, "", "", $db); $res = pg_Exec($conn, "select 17"); pg_Close($conn); } $tt = time() - $tt; echo "
tcpip local persistent with select
$tt
"; /* * unix persistent sockets connections */ $host = ""; $port = ""; $tt = time(); for($i=0; $i<$max; $i++) { $conn = pg_pConnect($host, $port, "", "", $db); pg_Close($conn); } $tt = time() - $tt; echo "
unix sockets persistent
$tt
"; /* * unix sockets persistent connections with selects */ $host = ""; $port = ""; $tt = time(); for($i=0; $i<$max; $i++) { $conn = pg_pConnect($host, $port, "", "", $db); $res = pg_Exec($conn, "select 17"); pg_Close($conn); } $tt = time() - $tt; echo "
unix sockets persistent with select
$tt
"; echo ""; ?>