note 102487 added to memcached.construct

From: Date: Thu, 17 Feb 2011 11:48:34 +0000
Subject: note 102487 added to memcached.construct
Groups: php.notes 
Request: Send a blank email to php-notes+get-177063@lists.php.net to get a copy of this message
Not positive, but it seems like the __construct() creates an instance of Memcache() class that lives (and stays alive) in at least the child Apache procs, if not the main Apache proc. This (seems to) mean that Memcache daemons added to the server "pool" (via ->addServers() ) stay remembered. This is why you do not want to call ->addServers() every time your script runs, because ->addServers() does not check for dups and will add hundreds or thousands of connections to the memcached daemon proc from the Apache proc(s). One side effect is that any other scripts (even across different website domains) can also add to your server "pool" (if they know the server pool name, or if they can get it from the memcached daemon itself (not sure if/how this is possible), or if you or your team has coded several sites using the same server pool (i.e., new Memcached( 'same-server-pool-name' ) ). This may present a security hole. ---- Server IP: 64.71.164.2 Probable Submitter: 70.91.82.193 ---- Manual Page -- http://www.php.net/manual/en/memcached.construct.php Edit -- https://master.php.net/note/edit/102487 Del: integrated -- https://master.php.net/note/delete/102487/integrated Del: useless -- https://master.php.net/note/delete/102487/useless Del: bad code -- https://master.php.net/note/delete/102487/bad+code Del: spam -- https://master.php.net/note/delete/102487/spam Del: non-english -- https://master.php.net/note/delete/102487/non-english Del: in docs -- https://master.php.net/note/delete/102487/in+docs Del: other reasons-- https://master.php.net/note/delete/102487 Reject -- https://master.php.net/note/reject/102487 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#177063) next »