Should I $mysqli->close a connection after each page load, if PHP runs via FCGI? -



Should I $mysqli->close a connection after each page load, if PHP runs via FCGI? -

i run php via fcgi - web server spawns several php processes , maintain running 10,000 requests until recycled.

my question - if i've $mysqli->connect @ top of php script, need phone call $mysqli->close in when i'm end running script?

since php processes open long time, i'd image each $mysqli->connect leak 1 connection, because process keeps running , no 1 closes connection.

am right in thinking or not? should phone call $mysqli->close?

when php exits closes database connections gracefully.

the reason utilize close method when want terminate database connection you´ll not utilize anymore, , have lots of things do: processing , streaming data, if quick, can forget close statement.

putting in end of script means redundancy, no performance or memory gain.

php mysqli fastcgi

Comments

Popular posts from this blog

Php operator `break` doesn't stop while -

ubuntu - Bash Script to Check That Files Are Being Created -

vim: Search & replace -