Why should I use connect_timeout=5 in pg_connect() function?
I recently got a comment that I should "use connect_timeout in my script".
I went searching for what was actually meant by this and I found this
information on php.net in the user comments:
One thing is to remember, whenever trying to use pg_connect, add the timeout
parameter with it
<?php
$d=pg_connect('host=example.com user=pgsql dbname=postgres
connect_timeout=5');
?>
So, again, same information "you should use it", but no explanation to as
why? So, I was hoping someone can clarify this for me?
Also, is there some "default" connect_timeout that should be set, like as
the user comment suggests 5? Is for some reason pg_connect a bad choice,
and I should add this connect_timeout in every pg_connect call, or?
Anyways, some insights to this would be grateful.
No comments:
Post a Comment