<?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>Guillermo Rauch&#039;s Devthought &#187; nfs</title>
	<atom:link href="http://www.devthought.com/tag/nfs/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.devthought.com</link>
	<description></description>
	<lastBuildDate>Mon, 30 Jan 2012 16:38:59 +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>Symfony scaling: moving your uploads to a NFS share</title>
		<link>http://www.devthought.com/2009/04/01/symfony-scaling-moving-your-uploads-to-a-nfs-share/</link>
		<comments>http://www.devthought.com/2009/04/01/symfony-scaling-moving-your-uploads-to-a-nfs-share/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 21:04:07 +0000</pubDate>
		<dc:creator>Guillermo Rauch</dc:creator>
				<category><![CDATA[Server side]]></category>
		<category><![CDATA[nfs]]></category>
		<category><![CDATA[scaling]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://devthought.com/?p=655</guid>
		<description><![CDATA[A few weeks back a client relaunched a Facebook App that commended me to rewrite. The growth since then has been tremendous, with over 2000 registered users everyday, who upload pictures, make friends and comment on other users&#8217; profiles. My &#8230; <a href="http://www.devthought.com/2009/04/01/symfony-scaling-moving-your-uploads-to-a-nfs-share/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A few weeks back a client relaunched a Facebook App that commended me to rewrite. The growth since then has been tremendous, with over 2000 registered users everyday, who upload pictures, make friends and comment on other users&#8217; profiles. My application has been able to handle that growth perfectly in terms of responsiveness, but I was told that if the growing rate persisted, within only a few days the content would exceed the hard drive capacity.</p>
<p>The natural solution for these scenarios is a <a href="http://en.wikipedia.org/wiki/Network_File_System">NFS</a> mount, so that the content can be distributed across a network, which gives your application virtually limitless storage capacity. <a href="http://joyent.com">Joyent</a> provides this service reliably.</p>
<p>The biggest challenge was to minimize the downtime, so these were the steps we took:</p>
<ol>
<li>Move all current files to the NFS mount to clear up disk space</li>
<li>
<p>Override the <strong>sf_upload_dir</strong> configuration directive. In settings.yml</p>
<pre class='highlight ' lang="xml">
all:
       upload_dir:      /nfsmount/site/uploads
</pre>
</li>
<li>
<p>Adjust the Apache VHost configuration with an alias that points outside the DocumentRoot (hence the need for a special <code class="inline">&lt;Directory&gt;</code>)</p>
<pre class='highlight ' lang="php">
Alias /uploads /nfsmount/site/uploads
<directory "/nfsmount/site/uploads">
       Order allow,deny
       Allow from all
</directory>
</pre>
</li>
<li>Clear symfony cache and reload Apache. If your application is well-written, the change should be transparent to all the modules that deal with file uploads.</p>
<li>Use <code class="inline">cp -uvR</code> to make sure no images were left out from the initial copy.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.devthought.com/2009/04/01/symfony-scaling-moving-your-uploads-to-a-nfs-share/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

