<?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>Ruby, Rails, OSX and Linux fun &#187; ramdisk</title>
	<atom:link href="http://www.frederico-araujo.com/tag/ramdisk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.frederico-araujo.com</link>
	<description>Ruby, Rails, OSX and linux sysadmin</description>
	<lastBuildDate>Thu, 02 Sep 2010 08:13:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Blazing Fast Firefox using OSX RamDisk</title>
		<link>http://www.frederico-araujo.com/2008/12/18/blazing-fast-firefox-using-osx-ramdisk/</link>
		<comments>http://www.frederico-araujo.com/2008/12/18/blazing-fast-firefox-using-osx-ramdisk/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 09:32:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[osx]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[ramdisk]]></category>
		<category><![CDATA[tmpfs]]></category>

		<guid isPermaLink="false">http://www.frederico-araujo.com/?p=55</guid>
		<description><![CDATA[Firefox does a lot of IO to the disk even thou you have lots of spare Ram, due to Sqlite, Bookmarks, History and Cache.
To make Firefox faster is to store the whole profile folder into a Ram Disk.
RamDisk in Linux are called TmpFS. You can also use shared memory folder /dev/shm if you have it [...]]]></description>
			<content:encoded><![CDATA[<p>Firefox does a lot of IO to the disk even thou you have lots of spare Ram, due to Sqlite, Bookmarks, History and Cache.</p>
<p>To make Firefox faster is to store the whole profile folder into a Ram Disk.<br />
RamDisk in Linux are called TmpFS. You can also use shared memory folder /dev/shm if you have it in your fstab.</p>
<p>This <a href="http://forums.gentoo.org/viewtopic.php?p=5319242"> post </a> in the gentoo forums explains how to do it in Gentoo linux.</p>
<p>I made a similar script to make it work in OSX Leopard.</p>
<p>The Script have 2 parts, Start.sh and Stop.sh<br />
Here are the Scripts:</p>
<p>Start.sh</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #666666; font-style: italic;"># Run this script to enable the Ramdisk for Firefox profiles</span>
<span style="color: #007800;">VolumeName</span>=<span style="color: #ff0000;">&quot;Mozilla&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Size in MB, make sure is not too low or not too high</span>
<span style="color: #007800;">SizeInMB</span>=<span style="color: #000000;">220</span>
&nbsp;
<span style="color: #007800;">NumSectors</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #000000;">1024</span><span style="color: #000000; font-weight: bold;">*</span>SizeInMB<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #007800;">DeviceName</span>=<span style="color: #000000; font-weight: bold;">`</span>hdid <span style="color: #660033;">-nomount</span> ram:<span style="color: #000000; font-weight: bold;">//</span><span style="color: #007800;">$NumSectors</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$DeviceName</span>
&nbsp;
diskutil eraseVolume HFS+ RAMDisk <span style="color: #007800;">$DeviceName</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># move the current profiles folder</span>
<span style="color: #c20cb9; font-weight: bold;">mv</span> Profiles Profiles_ <span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #000000; font-weight: bold;">&amp;</span>amp;
&nbsp;
<span style="color: #666666; font-style: italic;"># make a symlink to the ramdisk</span>
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>Volumes<span style="color: #000000; font-weight: bold;">/</span>RAMDisk .<span style="color: #000000; font-weight: bold;">/</span>Profiles <span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #000000; font-weight: bold;">&amp;</span>amp;
&nbsp;
<span style="color: #666666; font-style: italic;"># then copy it to the ramdisk</span>
<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-r</span> Profiles_<span style="color: #000000; font-weight: bold;">/*</span> Profiles</pre></div></div>

<p>Stop.sh</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Cache<span style="color: #000000; font-weight: bold;">/</span>Firefox<span style="color: #000000; font-weight: bold;">/</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># clean the cache</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span>  Profiles<span style="color: #000000; font-weight: bold;">/*/</span>Cache<span style="color: #000000; font-weight: bold;">/*</span> <span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #000000; font-weight: bold;">&amp;</span>amp;
&nbsp;
<span style="color: #666666; font-style: italic;"># will save your modifications back to the DISK</span>
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rsync <span style="color: #660033;">-av</span> <span style="color: #660033;">--delete</span> .<span style="color: #000000; font-weight: bold;">/</span>Profiles<span style="color: #000000; font-weight: bold;">/</span> .<span style="color: #000000; font-weight: bold;">/</span>Profiles_<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #000000; font-weight: bold;">&amp;</span>amp;
&nbsp;
<span style="color: #666666; font-style: italic;"># sometimes during unmount it will say disk is in use.</span>
<span style="color: #666666; font-style: italic;"># make sure you close firefox before.</span>
<span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #000000; font-weight: bold;">/</span>Volumes<span style="color: #000000; font-weight: bold;">/</span>RAMDisk <span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #000000; font-weight: bold;">&amp;</span>amp;
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> Profiles <span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #000000; font-weight: bold;">&amp;</span>amp;
<span style="color: #c20cb9; font-weight: bold;">mv</span> Profiles_ Profiles</pre></div></div>

<p>You can also use &#8216;tar&#8217; instead of &#8216;rsync&#8217;. I just love rsync more.</p>
<p>* Warning: The ramdisk contents will be erased after you umount the ramdisk.</p>
<p>Have fun.</p>
<p><strong><a href="http://www.gentoo.org">Gentoo Linux ROCKS</a></strong></p>
<p>Update:</p>
<p>To speed up firefox even more  run these commands:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Caches<span style="color: #000000; font-weight: bold;">/</span>Firefox<span style="color: #000000; font-weight: bold;">/</span>Profiles
&nbsp;
<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">*/*</span>.sqlite; <span style="color: #000000; font-weight: bold;">do</span> sqlite3 <span style="color: #007800;">$i</span> VACUUM;<span style="color: #000000; font-weight: bold;">done</span>;
&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Application\ Support<span style="color: #000000; font-weight: bold;">/</span>Firefox<span style="color: #000000; font-weight: bold;">/</span>Profiles
&nbsp;
<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">*/*</span>.sqlite; <span style="color: #000000; font-weight: bold;">do</span> sqlite3 <span style="color: #007800;">$i</span> VACUUM;<span style="color: #000000; font-weight: bold;">done</span>;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.frederico-araujo.com/2008/12/18/blazing-fast-firefox-using-osx-ramdisk/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
