Getfile mysql_close()? [message #164693] |
Tue, 01 March 2011 04:12 |
Ernesto
Messages: 413 Registered: August 2005
Karma: 0
|
Senior Member |
|
|
If you are grabbing a large file attachment with getfile.php.t it will keep the current mysql connection in sleepmode until the file finishes downloading. This might make you reach your max_connections or max_user_connections in mysql since the processess will sit in sleepmode until the script finishes.
I tried adding a db_close() function to db.inc but it seems I cannot call that from getfile.php.t.
Do I have to make those functions global somehow, or should I define that function somewhere else? I figured it would be correct to do it in db.inc since we have the fud_sql_connect variable defined there, so that we can easier access the proper string for mysql_close().
I tried running mysql_close() with the global variables in it, but that didn't close the connection, shouldn't that work?
IE - close the mysql connection just before we run @readfile($r[2]); and that would hopefully not keep a connection open while the user has the run/save/cancel box open (or while they download the file)
Anyone have any suggestions, other than raising the max_connections in mysql.
Ginnunga Gaming
|
|
|
Re: Getfile mysql_close()? [message #164694 is a reply to message #164693] |
Tue, 01 March 2011 04:13 |
Ernesto
Messages: 413 Registered: August 2005
Karma: 0
|
Senior Member |
|
|
The above applies even if you do not use persistant connections. (That you cannot close with mysql_close())
Maybe switching to persistant connections would actually help since it could then perhaps pick up the sleeping threads/processes and use them?
Ginnunga Gaming
|
|
|
|
|
|