<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: session-clustering with memcache</title>
	<atom:link href="http://phpslacker.com/2009/03/02/php-session-clustering-with-memcache/feed/" rel="self" type="application/rss+xml" />
	<link>http://phpslacker.com/2009/03/02/php-session-clustering-with-memcache/</link>
	<description>yet another g33k blog *sigh*</description>
	<lastBuildDate>Tue, 07 Sep 2010 09:56:27 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: phpslacker</title>
		<link>http://phpslacker.com/2009/03/02/php-session-clustering-with-memcache/#comment-266</link>
		<dc:creator>phpslacker</dc:creator>
		<pubDate>Tue, 07 Sep 2010 09:56:27 +0000</pubDate>
		<guid isPermaLink="false">http://phpslacker.com/?p=197#comment-266</guid>
		<description>This is not a general help forum but here&#039;s the best possible advice anyone can give you. You have a lot of questions. Nobody can make those decisions for you. You have specific needs/requirements for your unique environment. You need to gather all the facts and make a decision yourself for yourself. Let go of broad-spectrum best practices. Every problem has context. Seek it. Understand it

OR

hire a consultant at $$$$ / hour</description>
		<content:encoded><![CDATA[<p>This is not a general help forum but here&#8217;s the best possible advice anyone can give you. You have a lot of questions. Nobody can make those decisions for you. You have specific needs/requirements for your unique environment. You need to gather all the facts and make a decision yourself for yourself. Let go of broad-spectrum best practices. Every problem has context. Seek it. Understand it</p>
<p>OR</p>
<p>hire a consultant at $$$$ / hour</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://phpslacker.com/2009/03/02/php-session-clustering-with-memcache/#comment-265</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Mon, 06 Sep 2010 21:16:08 +0000</pubDate>
		<guid isPermaLink="false">http://phpslacker.com/?p=197#comment-265</guid>
		<description>Hello, 
thanks for the article and your following of discussion since then. 
Related to the DB approach which many follow (the guy from the Lift framework among others), what about using MongoDB instead of MySQL ?
I&#039;m currently wondering what would be the best approach between MongoDB or simply use Zend cluster Manager. What do you think of ?
Does someone know the price of Zend cluster Manager by the way ? :)</description>
		<content:encoded><![CDATA[<p>Hello,<br />
thanks for the article and your following of discussion since then.<br />
Related to the DB approach which many follow (the guy from the Lift framework among others), what about using MongoDB instead of MySQL ?<br />
I&#8217;m currently wondering what would be the best approach between MongoDB or simply use Zend cluster Manager. What do you think of ?<br />
Does someone know the price of Zend cluster Manager by the way ? <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tfotherby</title>
		<link>http://phpslacker.com/2009/03/02/php-session-clustering-with-memcache/#comment-261</link>
		<dc:creator>tfotherby</dc:creator>
		<pubDate>Tue, 27 Jul 2010 12:51:48 +0000</pubDate>
		<guid isPermaLink="false">http://phpslacker.com/?p=197#comment-261</guid>
		<description>Thanks for replying, again really useful info. 

I used the technique to successfully get sessions to transparently failover. i.e. the user was not logged out if I stop a pooled memcached instance on one of the machines.

I didn&#039;t manage to use the technique to share sessions across two servers: http://serverfault.com/questions/164350/can-a-pool-of-memcache-daemons-be-used-to-share-sessions-more-efficiently</description>
		<content:encoded><![CDATA[<p>Thanks for replying, again really useful info. </p>
<p>I used the technique to successfully get sessions to transparently failover. i.e. the user was not logged out if I stop a pooled memcached instance on one of the machines.</p>
<p>I didn&#8217;t manage to use the technique to share sessions across two servers: <a href="http://serverfault.com/questions/164350/can-a-pool-of-memcache-daemons-be-used-to-share-sessions-more-efficiently" rel="nofollow">http://serverfault.com/questions/164350/can-a-pool-of-memcache-daemons-be-used-to-share-sessions-more-efficiently</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: phpslacker</title>
		<link>http://phpslacker.com/2009/03/02/php-session-clustering-with-memcache/#comment-260</link>
		<dc:creator>phpslacker</dc:creator>
		<pubDate>Tue, 27 Jul 2010 12:13:15 +0000</pubDate>
		<guid isPermaLink="false">http://phpslacker.com/?p=197#comment-260</guid>
		<description>Look. The solution i posted for session clustering is a fiery hack. FYI Memcached does not do replication between instances

For the default php.ini memcache configuration both servers should have an identical php.ini line like this:

session.save_path=”tcp://primary_memcached_instance:11211, Tcp://secondary_memcached_instance:11211″

Because the default hashing method is &quot;standard&quot; not &quot;consistent&quot;. The type of hashing algorithm (chosen for memcached) determines how the keys are distributed across the pool of memcached servers. Consistent hashing would offer full failover. Then you can use the settings you describe in your comment to achieve 50% hit/miss on local reads

See http://www.php.net/manual/en/memcache.ini.php#ini.memcache.hash-strategy</description>
		<content:encoded><![CDATA[<p>Look. The solution i posted for session clustering is a fiery hack. FYI Memcached does not do replication between instances</p>
<p>For the default php.ini memcache configuration both servers should have an identical php.ini line like this:</p>
<p>session.save_path=”tcp://primary_memcached_instance:11211, Tcp://secondary_memcached_instance:11211″</p>
<p>Because the default hashing method is &#8220;standard&#8221; not &#8220;consistent&#8221;. The type of hashing algorithm (chosen for memcached) determines how the keys are distributed across the pool of memcached servers. Consistent hashing would offer full failover. Then you can use the settings you describe in your comment to achieve 50% hit/miss on local reads</p>
<p>See <a href="http://www.php.net/manual/en/memcache.ini.php#ini.memcache.hash-strategy" rel="nofollow">http://www.php.net/manual/en/memcache.ini.php#ini.memcache.hash-strategy</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://phpslacker.com/2009/03/02/php-session-clustering-with-memcache/#comment-259</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Tue, 27 Jul 2010 10:41:41 +0000</pubDate>
		<guid isPermaLink="false">http://phpslacker.com/?p=197#comment-259</guid>
		<description>Hi,

Thanks for a great article. I have a question about using this session clustering technique across two round-robin load-balanced LAMP servers.

From my understanding of this article, it should be possible to share sessions across two webservers by defining the save_path on each server to have a local memcache store AND a remote memcache store:

session.save_path=&quot;tcp://localhost:11211, Tcp://192.168.0.[$othermachine]:11211&quot;

That way, the users session should be accessible from whatever server they get landed on and 50% of the time it will be on the localhost and so avoid network traffic? Am I correct or did I misunderstand something?

I haven&#039;t got it to work in testing but I&#039;m thinking that on CentOS 5.5, the PHP memcache extension in the repos might not support transparent replication. It seems the session is only in the first instance and when the user gets sent to the other server, it just creates a new session in the new servers local instance (therefore the user is logged out). i.e. it doesn&#039;t seem to peak inside each instance in turn to work out whether it can find the session - it just peaks into the first instance and then creates a new session if it finds nothing.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Thanks for a great article. I have a question about using this session clustering technique across two round-robin load-balanced LAMP servers.</p>
<p>From my understanding of this article, it should be possible to share sessions across two webservers by defining the save_path on each server to have a local memcache store AND a remote memcache store:</p>
<p>session.save_path=&#8221;tcp://localhost:11211, Tcp://192.168.0.[$othermachine]:11211&#8243;</p>
<p>That way, the users session should be accessible from whatever server they get landed on and 50% of the time it will be on the localhost and so avoid network traffic? Am I correct or did I misunderstand something?</p>
<p>I haven&#8217;t got it to work in testing but I&#8217;m thinking that on CentOS 5.5, the PHP memcache extension in the repos might not support transparent replication. It seems the session is only in the first instance and when the user gets sent to the other server, it just creates a new session in the new servers local instance (therefore the user is logged out). i.e. it doesn&#8217;t seem to peak inside each instance in turn to work out whether it can find the session &#8211; it just peaks into the first instance and then creates a new session if it finds nothing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bahmani</title>
		<link>http://phpslacker.com/2009/03/02/php-session-clustering-with-memcache/#comment-254</link>
		<dc:creator>bahmani</dc:creator>
		<pubDate>Wed, 16 Jun 2010 04:25:54 +0000</pubDate>
		<guid isPermaLink="false">http://phpslacker.com/?p=197#comment-254</guid>
		<description>Thank you.
Your solution is very useful. I&#039;ve tested and it works fine.
before it, I&#039;ve changed php.ini parameters but it failed.</description>
		<content:encoded><![CDATA[<p>Thank you.<br />
Your solution is very useful. I&#8217;ve tested and it works fine.<br />
before it, I&#8217;ve changed php.ini parameters but it failed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: phpslacker</title>
		<link>http://phpslacker.com/2009/03/02/php-session-clustering-with-memcache/#comment-250</link>
		<dc:creator>phpslacker</dc:creator>
		<pubDate>Wed, 14 Apr 2010 12:53:32 +0000</pubDate>
		<guid isPermaLink="false">http://phpslacker.com/?p=197#comment-250</guid>
		<description>php-memcache extension does not overwrite php&#039;s session-handling mechanism it merely implements a session save handler http://www.php.net/manual/en/function.session-set-save-handler.php so garbage collections, id generation is the same as if you used the default &quot;file&quot; save handler for php sessions. that answers both of ur comments

interesting idea to use memcachedb as persistent storage. u should run more than one instance of memcachedb for redundancy sake and bear in mind that memcachedb DOES NOT implement the full memcache protocol so it may not be compatible with php&#039;s memcached extension</description>
		<content:encoded><![CDATA[<p>php-memcache extension does not overwrite php&#8217;s session-handling mechanism it merely implements a session save handler <a href="http://www.php.net/manual/en/function.session-set-save-handler.php" rel="nofollow">http://www.php.net/manual/en/function.session-set-save-handler.php</a> so garbage collections, id generation is the same as if you used the default &#8220;file&#8221; save handler for php sessions. that answers both of ur comments</p>
<p>interesting idea to use memcachedb as persistent storage. u should run more than one instance of memcachedb for redundancy sake and bear in mind that memcachedb DOES NOT implement the full memcache protocol so it may not be compatible with php&#8217;s memcached extension</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carrie</title>
		<link>http://phpslacker.com/2009/03/02/php-session-clustering-with-memcache/#comment-249</link>
		<dc:creator>Carrie</dc:creator>
		<pubDate>Tue, 13 Apr 2010 21:15:25 +0000</pubDate>
		<guid isPermaLink="false">http://phpslacker.com/?p=197#comment-249</guid>
		<description>We are experimenting with php-memcache extension and memcachedb back-end.

memcachedb provides persistent storage.  Does anyone know if the garbage collection is handled by the php-memcache front-end?  Or do we have to manually delete the expired session ids ourselves from the back-end db?</description>
		<content:encoded><![CDATA[<p>We are experimenting with php-memcache extension and memcachedb back-end.</p>
<p>memcachedb provides persistent storage.  Does anyone know if the garbage collection is handled by the php-memcache front-end?  Or do we have to manually delete the expired session ids ourselves from the back-end db?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carrie</title>
		<link>http://phpslacker.com/2009/03/02/php-session-clustering-with-memcache/#comment-248</link>
		<dc:creator>Carrie</dc:creator>
		<pubDate>Tue, 13 Apr 2010 21:05:38 +0000</pubDate>
		<guid isPermaLink="false">http://phpslacker.com/?p=197#comment-248</guid>
		<description>Does this solution ensure that session ids will be unique across the cluster?  What is preventing duplicate session ids from being assigned?</description>
		<content:encoded><![CDATA[<p>Does this solution ensure that session ids will be unique across the cluster?  What is preventing duplicate session ids from being assigned?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: phpslacker</title>
		<link>http://phpslacker.com/2009/03/02/php-session-clustering-with-memcache/#comment-247</link>
		<dc:creator>phpslacker</dc:creator>
		<pubDate>Tue, 30 Mar 2010 06:53:04 +0000</pubDate>
		<guid isPermaLink="false">http://phpslacker.com/?p=197#comment-247</guid>
		<description>well firstly, there&#039;s nothing wrong with the behaviour of session.save_handler. Secondly, there&#039;s no reason why ur shopping cart data cannot share the same storage as ur captcha data. thats what &quot;namespaces&quot; are for

$_SESSION[&#039;cart_data&#039;] = &#039;blah&#039;;
$_SESSION[&#039;captcha_data&#039;] = &#039;blah&#039;;</description>
		<content:encoded><![CDATA[<p>well firstly, there&#8217;s nothing wrong with the behaviour of session.save_handler. Secondly, there&#8217;s no reason why ur shopping cart data cannot share the same storage as ur captcha data. thats what &#8220;namespaces&#8221; are for</p>
<p>$_SESSION['cart_data'] = &#8216;blah&#8217;;<br />
$_SESSION['captcha_data'] = &#8216;blah&#8217;;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
