|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchesrrdcached-disconnect-support (last revision 2013-11-13 13:11 UTC by killing at multiplay dot co dot uk)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-01-13 21:10 UTC] koubel@php.net
[2014-01-13 21:19 UTC] koubel@php.net
-Status: Open
+Status: Feedback
[2014-01-13 21:19 UTC] koubel@php.net
[2014-01-14 09:49 UTC] koubel@php.net
-Status: Feedback
+Status: Closed
-Assigned To:
+Assigned To: koubel
[2014-01-14 09:49 UTC] koubel@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 15:00:01 2025 UTC |
Description: ------------ If rrdcached is used then the connections to the daemon are never closed resulting in more and more socket resources being consumed the more php-fpm handlers are active. The attached patch adds support for rrdcached connections which adds: 1. rrdc_disconnect method, allowing the user to manually disconnect any active connection. 2. rrdc_persistent_connections(enabled) method which allows the user to configure rrd to support persistent connections. 3. RRDC_PERSISTENT_CONNECTIONS compile time define which allows the use to change default for persistent connections (default is disabled). 4. Module shutdown handler which always closes any active rrdcached connection 5. Request shutdown handler which closes any active rrdcached connection depending on the current rrdc persistent connection setting. Test script: --------------- Complete the following replacing the required variables (<host>, <file>, <options>) with valid values, then run the script via a php-fpm instance. <?php putenv('RRDCACHED_ADDRESS=<host>'); rrd_update('<file>', '<options>'); ?> Once run, check for open connections to <host> e.g. netstat -an |grep <host> You'll see ESTABLISHED connections even though the script is no longer running so doesn't require the connection any more. Expected result: ---------------- Running the following should return no ESTABLISHED connections netstat -na | grep <host> Actual result: -------------- All php-fpm instances which have run the script have an ESTABLISHED connection to <host>