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

c - Compilation of a code: unkown type name string -

java - Bypassing "final local variable defined in an enclosing type" -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -