<?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; firefox</title>
	<atom:link href="http://www.frederico-araujo.com/tag/firefox/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>Stop http Pipeline from overloading your server, using connlimit iptables</title>
		<link>http://www.frederico-araujo.com/2009/01/25/stop-http-pipeline-from-overloading-your-server-with-iptables/</link>
		<comments>http://www.frederico-araujo.com/2009/01/25/stop-http-pipeline-from-overloading-your-server-with-iptables/#comments</comments>
		<pubDate>Sun, 25 Jan 2009 08:31:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.frederico-araujo.com/?p=79</guid>
		<description><![CDATA[Have you edited or tweaked your pipeline settings in Firefox?
You can do it by typing about:config in your firefox url tab.
Most blogs and tutorial will tell you to set high values to improve the speed, such as this one: www.mydigitallife.info/2007/10/16/speed-up-your-firefox-by-adjusting-your-http-pipelining/
Many people will go crazy and make values even higher such as:
network.http.pipelining.maxrequests 32
network.http.max-persistent-connections-per-proxy 128
network.http.max-persistent-connections-per-server 128
network.http.max-connections-per-server 256
These [...]]]></description>
			<content:encoded><![CDATA[<p>Have you edited or tweaked your pipeline settings in Firefox?</p>
<p>You can do it by typing about:config in your firefox url tab.</p>
<p>Most blogs and tutorial will tell you to set high values to improve the speed, such as this one: <a href="http://www.mydigitallife.info/2007/10/16/speed-up-your-firefox-by-adjusting-your-http-pipelining/">www.mydigitallife.info/2007/10/16/speed-up-your-firefox-by-adjusting-your-http-pipelining/</a></p>
<p>Many people will go crazy and make values even higher such as:</p>
<p>network.http.pipelining.maxrequests 32<br />
network.http.max-persistent-connections-per-proxy 128<br />
network.http.max-persistent-connections-per-server 128<br />
network.http.max-connections-per-server 256</p>
<p>These settings are very high and will create at least 32 connections to your server.</p>
<p>if you have many images and SSI includes, it could overload your apache webserver.<br />
If you use apache2.2 with worker_mpm it will create 1 thread for each connection, thus you will have 32 new threads forked within just a few seconds.</p>
<p>Of course if you have a quad-core server with lots of ram you should not bother to read this.<br />
But for most cheap vps and single core servers, it can really help.</p>
<p>so how you do it? simple, just use iptables conn_limit module</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">iptables <span style="color: #660033;">-I</span> INPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">--syn</span> <span style="color: #660033;">--dport</span> <span style="color: #000000;">80</span> <span style="color: #660033;">-m</span> connlimit <span style="color: #660033;">--connlimit-above</span>  <span style="color: #000000;">8</span> <span style="color: #660033;">-j</span> REJECT</pre></div></div>

<p>you may need to adjust the order or to insert or append like</p>
<p># to apped to the end of the INPUT chain:<br />
iptables -A input &#8230;<br />
or<br />
# to insert at position 10 of the input chain:<br />
iptables -I input 10 &#8230;</p>
<p>I have tested this schema and work very well with firefox pipeline freaks.</p>
<p>the server will only then take up to 8 simultaneously connections per IP</p>
<p>to test the established connections you can try with netstat from the server:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">netstat</span> <span style="color: #660033;">-na</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-i</span> esta <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-v</span> 127.0.0.1 <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sort</span> <span style="color: #660033;">-n</span> -t. <span style="color: #660033;">-k2</span></pre></div></div>

<p>Any comments, suggestions are welcome &#8230;</p>
<p>Update:</p>
<p>This can be not so good to legit users behind a proxy or firewall, because the the IP will be unique to all users behind the proxy/firewall.</p>
<p>in this case, you would increase the limit value.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.frederico-araujo.com/2009/01/25/stop-http-pipeline-from-overloading-your-server-with-iptables/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<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>
