|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesBug55473.diff (last revision 2011-08-22 08:33 UTC by laruence@php.net)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-08-22 03:05 UTC] laruence@php.net
[2011-08-22 06:20 UTC] littlesavage at rambler dot ru
[2011-08-22 08:33 UTC] laruence@php.net
[2011-08-22 08:35 UTC] laruence@php.net
[2011-08-22 08:35 UTC] laruence@php.net
-Status: Open
+Status: Analyzed
[2011-08-22 09:01 UTC] laruence@php.net
[2011-08-22 10:42 UTC] andrey@php.net
[2011-08-22 10:57 UTC] laruence@php.net
-Status: Analyzed
+Status: Closed
-Assigned To:
+Assigned To: andrey
[2011-08-22 10:57 UTC] laruence@php.net
[2011-08-23 19:19 UTC] neweracracker at gmail dot com
[2012-02-28 06:46 UTC] jim at addmired dot com
[2012-04-18 09:49 UTC] laruence@php.net
[2012-07-24 23:40 UTC] rasmus@php.net
[2013-11-17 09:36 UTC] laruence@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 11:00:01 2025 UTC |
Description: ------------ Whem Mysql closes created by mysql_pconnect() peristent connection, file descriptor lefts opened and is never reused. I have a server that stops working due to opened file descriptors limit. Test script: --------------- <?php function connect($passwd) { $conn = mysql_pconnect('localhost:3306','root', $passwd); if (!$conn) die(mysql_error()."\n"); mysql_query("set wait_timeout=5", $conn); return $conn; } $passwd = $argv[1]; $conn = connect($passwd); for($i=0;$i<10;$i++) { /* wait while mysql closes connection */ sleep(6); if (!mysql_ping($conn)) { echo "reconnect\n"; $conn = connect($passwd); } $r = mysql_query('select 1', $conn); $error = $r ? 'OK' : mysql_error(); $opened_files = trim(exec("lsof -np " . getmypid() . " | wc -l")); echo "$error. opened files: $opened_files\n"; } ?> Expected result: ---------------- $ php ./test.php reconnect OK. opened files: 76 reconnect OK. opened files: 76 reconnect OK. opened files: 76 reconnect OK. opened files: 76 ... Actual result: -------------- $ php ./test.php reconnect OK. opened files: 76 reconnect OK. opened files: 77 reconnect OK. opened files: 78 reconnect OK. opened files: 79 ...