使用php在postgresql中的数据库连接时间

时间:2014-05-14 07:28:17

标签: php postgresql

我想找出我的postgresql服务器可以处理的最大连接数,我使用Php连接到我的postgresql数据库。我有什么方法可以找到连接所需的时间。

这是我写的连接到postgresql数据库的代码。

for($i=0;$i<1000000000:$i++){
try{
$link=pg_connect("dbname=testdatabase user=xxxx password=xxxxx");

}
catch{
catch(Exception $e) {
  echo 'Message: ' .$e->getMessage();
}

}

我用过

 /timing 



select * from pg_stat_activity

但我想知道在执行该代码时多次连接数据库所花费的时间。我该怎么办?

0 个答案:

没有答案