<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Linux Windows System Administrator Help &#187; memcached</title>
	<atom:link href="http://linuxwindowsmaster.com/tag/memcached/feed/" rel="self" type="application/rss+xml" />
	<link>http://linuxwindowsmaster.com</link>
	<description></description>
	<lastBuildDate>Mon, 30 Jan 2012 19:54:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to install memcache on linux server?</title>
		<link>http://linuxwindowsmaster.com/how-to-install-memcache-on-linux-server/</link>
		<comments>http://linuxwindowsmaster.com/how-to-install-memcache-on-linux-server/#comments</comments>
		<pubDate>Sun, 12 Apr 2009 21:02:03 +0000</pubDate>
		<dc:creator>Alex P</dc:creator>
				<category><![CDATA[ASP.NET, IIS, MS SQL]]></category>
		<category><![CDATA[Cpanel Server]]></category>
		<category><![CDATA[Dedicated Server]]></category>
		<category><![CDATA[PHP, MySQL, Apache]]></category>
		<category><![CDATA[Libevent]]></category>
		<category><![CDATA[memcache.so]]></category>
		<category><![CDATA[memcached]]></category>

		<guid isPermaLink="false">http://linuxwindowsmaster.com/?p=224</guid>
		<description><![CDATA[memcached is a high-performance memory object caching system intended to speed up dynamic web applications by alleviating database load. memcached is meant to work in concert with something like the MySQL query cache, not replace it. The two implementations excel at vastly different things: memcached is an object cache, while MySQL provides a query cache. [...]]]></description>
			<content:encoded><![CDATA[<p><!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:Compatibility> <w:BreakWrappedTables /> <w:SnapToGridInCell /> <w:WrapTextWithPunct /> <w:UseAsianBreakRules /> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--> <!--[if gte mso 10]><br />
<mce:style><!   /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman";} --></p>
<p><!--[endif]--></p>
<p class="MsoNormal" style="text-align: justify;"><span style="font-size: 10pt; font-family: Georgia;"><strong>memcached</strong> is a high-performance memory object caching system intended to speed up dynamic web applications by alleviating database load. </span></p>
<p class="MsoNormal" style="text-align: justify;"><span style="font-size: 10pt; font-family: Georgia;"> </span></p>
<p class="MsoNormal" style="text-align: justify;"><span style="font-size: 10pt; font-family: Georgia;"><strong>memcached</strong> is meant to work in concert with something like the MySQL query cache, not replace it. The two implementations excel at vastly different things: <strong>memcached</strong> is an object cache, while MySQL provides a query cache.</span></p>
<p class="MsoNormal" style="text-align: justify;"><span style="font-size: 10pt; font-family: Georgia;"> </span></p>
<p class="MsoNormal" style="text-align: justify;"><span style="font-size: 10pt; font-family: Georgia;"><strong>memcached</strong> is extremely fast. It uses <strong>libevent</strong>, which provides a mechanism to execute a callback function when a specific event occurs on a file descriptor, to scale to any number of open connections. On a modern Linux system memcached utilizes epoll, is completely non-blocking for network I/O, ensures memory never gets fragmented, and uses its own slab allocator and hash table to achieve 0(1) virtual memory allocation.</span></p>
<p class="MsoNormal" style="text-align: justify;"><span style="font-size: 10pt; font-family: Georgia;"> </span></p>
<p class="MsoNormal" style="text-align: justify;"><strong><span style="font-size: 10pt; font-family: Georgia;">How it install it on Linux server ?</span></strong></p>
<p class="MsoNormal" style="text-align: justify;"><span style="font-size: 10pt; font-family: Georgia;"> </span></p>
<ul>
<li><span style="font-size: 10pt; font-family: Georgia;">Install dependency software (Libevent)</span></li>
</ul>
<pre><strong><span style="font-size: 10pt; font-family: Georgia;">#curl -O http://monkey.org/~provos/libevent-1.4.9-stable.tar.gz
#tar -xzvf libevent-1.4.9-stable.tar.gz
#cd libevent*
#./configure
#make
#make install</span></strong></pre>
<p><strong></strong></p>
<p class="MsoNormal" style="text-align: justify;"><span style="font-size: 10pt; font-family: Georgia;"> </span></p>
<ul>
<li><span style="font-size: 10pt; font-family: Georgia;">Now let’s download the newest Memcached source</span></li>
</ul>
<p class="MsoNormal" style="text-align: justify;"><span style="font-size: 10pt; font-family: Georgia;"> </span></p>
<pre><strong>#curl -O http://www.danga.com/memcached/dist/memcached-1.3.0.tar.gz
#tar zxf memcached-1.3.0.tar.gz
#cd memcached-1.3.0
#./configure
#make
#make install</strong></pre>
<ul>
<li><span style="font-size: 10pt; font-family: Georgia;">Then add /usr/local/lib to LD_LIBRARY_PATH in your .bash_profile</span></li>
</ul>
<p class="MsoNormal" style="text-align: justify;"><span style="font-size: 10pt; font-family: Georgia;"> </span></p>
<pre><strong>LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH</strong></pre>
<p class="MsoNormal" style="text-align: justify;"><span style="font-size: 10pt; font-family: Georgia;"> </span></p>
<p class="MsoNormal" style="text-align: justify;"><strong><span style="font-size: 10pt; font-family: Georgia;">How it Works</span></strong></p>
<p class="MsoNormal" style="text-align: justify;"><span style="font-size: 10pt; font-family: Georgia;"> </span></p>
<p class="MsoNormal" style="text-align: justify;"><span style="font-size: 10pt; font-family: Georgia;">First, you start up the memcached daemon on as many spare machines as you have. The daemon has no configuration file, just a few command line options, only 3 or 4 of which you’ll likely use:</span></p>
<p class="MsoNormal" style="text-align: justify;"><span style="font-size: 10pt; font-family: Georgia;">Run Memcached as a daemon (d = daemon, m = memory, u = user, l = IP to listen to, p = port)</span></p>
<p class="MsoNormal" style="text-align: justify;"><span style="font-size: 10pt; font-family: Georgia;"> </span></p>
<pre><strong><span style="font-size: 10pt; font-family: Georgia;">#memcached -d -m 1024 -u root -l 127.0.0.1 -p 11211 –u nobody</span></strong></pre>
<p class="MsoNormal" style="text-align: justify;"><span style="font-size: 10pt; font-family: Georgia;"> </span></p>
<p class="MsoNormal" style="text-align: justify;"><span style="font-size: 10pt; font-family: Georgia;">This starts memcached as a <strong>daemon (-d)</strong> on the<strong> IP addres</strong>s and <strong>port</strong> specified with<strong> -l </strong>and <strong>-p</strong>, respectively, running as the <strong>user nobody (-u),</strong> allocating<strong> 1024  for object storage (-m)</strong>. You should adjust the amount of storage to suit your needs; many memcached installs run with 4 GB. Once you are comfortable with your startup options, add the appropriate command to your startup scripts.</span></p>
<p class="MsoNormal" style="text-align: justify;"><span style="font-size: 10pt; font-family: Georgia;"> </span></p>
<p class="MsoNormal" style="text-align: justify;"><span style="font-size: 10pt; font-family: Georgia;">Create a <strong>/etc/init.d/memcached</strong> file and add above line to start memcached when the server boots</span></p>
<p class="MsoNormal" style="text-align: justify;"><span style="font-size: 10pt; font-family: Georgia;"> </span></p>
<p class="MsoNormal" style="text-align: justify;"><span style="font-size: 10pt; font-family: Georgia;">With memcached installed and running, it’s time to get PHP talking to the object cache. While multiple PHP API exists, the one in the PECL repository is recommended. If you are running a newer version of PHP, installation is as simple as:</span></p>
<pre><strong><span style="font-size: 10pt; font-family: Georgia;"># pecl install memcache</span></strong></pre>
<p class="MsoNormal" style="text-align: justify;"><span style="font-size: 10pt; font-family: Georgia;"> </span></p>
<p class="MsoNormal" style="text-align: justify;"><span style="font-size: 10pt; font-family: Georgia;">Or you can use following steps to install PECL memcache manually.</span></p>
<p class="MsoNormal" style="text-align: justify;"><span style="font-size: 10pt; font-family: Georgia;"> </span></p>
<pre><strong>#cd /usr/local/src
#curl -O http://pecl.php.net/get/memcache
#tar zxvf memcache*
#cd memcache-*
#phpize
#./configure
#make &amp;&amp; make install</strong></pre>
<p class="MsoNormal" style="text-align: justify;"><strong><span style="font-size: 10pt; font-family: Georgia;"> </span></strong></p>
<p class="MsoNormal" style="text-align: justify;"><span style="font-size: 10pt; font-family: Georgia;">Now we have to make sure PHP loads the newly built memcache.so library by adding the following line to php.ini:</span></p>
<p class="MsoNormal" style="text-align: justify;"><span style="font-size: 10pt; font-family: Georgia;"> </span></p>
<p class="MsoNormal" style="text-align: justify;"><strong><span style="font-size: 10pt;">extension=memcache.so</span></strong></p>
<p class="MsoNormal" style="text-align: justify;"><span style="font-size: 10pt; font-family: Georgia;"> </span></p>
<p><span style="font-size: 10pt; font-family: Georgia;">Now restart Apache:</span></p>
<pre><strong><span style="font-size: 10pt; font-family: Georgia;">Service httpd restart</span></strong></pre>
<p class="MsoNormal" style="text-align: justify;"><span style="font-size: 10pt; font-family: Georgia;"> </span></p>
<p class="MsoNormal" style="text-align: justify;"><span style="font-size: 10pt; font-family: Georgia;"><span> </span>Once it sucussfully install you can create<span> </span>phpinfo() on your webserver should now confirm that memcache is installed.</span></p>
<p class="MsoNormal" style="text-align: center;"><span style="font-size: 10pt; font-family: Georgia;"><a href="http://linuxwindowsmaster.com/how-to-install-memcache/"><img class="aligncenter size-full wp-image-225" title="memcache" src="http://linuxwindowsmaster.com/wp-content/uploads/2009/04/memcache.jpg" alt="memcache How to install memcache on linux server?" width="733" height="393" /></a><br />
</span></p>
<p>Regards<br />
AlexP</p>
<p class="MsoNormal" style="text-align: justify;"><span style="font-size: 10pt; font-family: Georgia;"> </span></p>
]]></content:encoded>
			<wfw:commentRss>http://linuxwindowsmaster.com/how-to-install-memcache-on-linux-server/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

