<?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 * Screw &#187; rpms</title>
	<atom:link href="http://www.linuxscrew.com/category/rpms/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.linuxscrew.com</link>
	<description></description>
	<lastBuildDate>Wed, 01 Sep 2010 12:57:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2499</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Make squid to mark cache hits and misses (rpm package for Fedora 5)</title>
		<link>http://www.linuxscrew.com/2007/09/24/make-squid-to-mark-cache-hits-and-misses-rpm-package-for-fedora-5/</link>
		<comments>http://www.linuxscrew.com/2007/09/24/make-squid-to-mark-cache-hits-and-misses-rpm-package-for-fedora-5/#comments</comments>
		<pubDate>Mon, 24 Sep 2007 15:57:18 +0000</pubDate>
		<dc:creator>artiomix</dc:creator>
				<category><![CDATA[fedora]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[rpms]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/2007/09/24/make-squid-to-mark-cache-hits-and-misses-rpm-package-for-fedora-5/</guid>
		<description><![CDATA[Squid is a proxy server and web cache daemon. It has a wide variety of uses, from speeding up a web server by caching repeated requests, to caching web, DNS and other computer network lookups for a group of people sharing network resources, to aiding security by filtering traffic. Although primarily used for HTTP and [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p><img title="squid logo" src="http://www.linuxscrew.com/wp-content/uploads/2007/09/squid.png" alt="squid logo" align="right" /><strong>Squid</strong> is a <a title="Proxy server" href="http://en.wikipedia.org/wiki/Proxy_server">proxy server</a> and <a title="Web cache" href="http://www.ubuntuka.com/squid-cache-youtube-ubuntu-linux/">web cache</a> daemon. It has a wide variety of uses, from speeding up a <a title="Web server" href="http://en.wikipedia.org/wiki/Web_server">web server</a> by caching repeated requests, to caching web, <a title="Domain Name System" href="http://en.wikipedia.org/wiki/Domain_Name_System">DNS</a> and other computer network lookups for a group of people sharing network resources, to aiding security by filtering traffic. Although primarily used for <a title="HTTP" href="http://en.wikipedia.org/wiki/HTTP">HTTP</a> and <a title="File Transfer Protocol" href="http://en.wikipedia.org/wiki/File_Transfer_Protocol">FTP</a>, Squid includes limited support for several other <a title="Protocol (computing)" href="http://en.wikipedia.org/wiki/Protocol_%28computing%29">protocols</a> including <a title="Transport Layer Security" href="http://en.wikipedia.org/wiki/Transport_Layer_Security">TLS</a>, <a title="Secure Sockets Layer" href="http://en.wikipedia.org/wiki/Secure_Sockets_Layer">SSL</a>, <a title="Internet Gopher" href="http://en.wikipedia.org/wiki/Internet_Gopher">Internet Gopher</a> and <a title="HTTPS" href="http://en.wikipedia.org/wiki/HTTPS">HTTPS</a>.</p></blockquote>
<p>When the cache client (like web browser) wishes to access a data presumably in the backing store, it first checks the cache. If an entry can be found with a tag matching that of the desired datum, the datum in the entry is used instead. This situation is known as a <strong>cache hit</strong>. The alternative situation, when the cache is consulted and found not to contain a datum with the desired tag, is known as a <strong>cache miss</strong>. More information about cache misses and cache hits is available <a href="http://en.wikipedia.org/wiki/Cache" target="_blank">here</a>.</p>
<p>The common reason to mark cache misses and hits is to control <a href="http://www.bctes.com/bandwidth_management.html">bandwidth</a> of these kinds of traffic. For example: there is a server running squid that caches requests sent by subscribers and it&#8217;s necessary to shape bandwidth of traffic retreived directly from original servers (misses) and traffic that comes with local cache (hits). Standard squid versions don&#8217;t allow this.</p>
<p>But here is patched Squid version (<strong>rpm</strong> package for <strong>Fedora Core 5</strong>) that marks misses and hits with different <a href="http://en.wikipedia.org/wiki/Type_of_Service" target="_blank"><strong>TOS</strong></a> flags: <a href="http://www.linuxscrew.com/wp-content/uploads/2007/08/squid-2.5.STABLE-2.FC5.patched.i386.rpm" target="_blank">squid-2.5.STABLE-2.FC5.patched.i386.rpm</a></p>
<p>In case you run this version of squid it&#8217;s possible to mark <strong>hits</strong> by simple iptables command:</p>
<p><code>iptables -t mangle -A POSTROUTING -o eth1 -p tcp --sport 8080 -m tos --tos 0x0 -j MARK --set-mark 0x1</code><br />
where eth1 is LAN network interface hardware name, 8080 is tcp port squid is listening at. Therefore all other traffic with source port 8080, output interface eth1 but with TOS flag different from 0&#215;0 can be classified as <strong>misses</strong>.</p>
<p>Further information on how to follow marked packets to traffic shaping disciplines like <a href="http://luxik.cdi.cz/~devik/qos/htb/" target="_blank"><strong>HTB</strong></a> or <a href="http://www.icir.org/floyd/cbq.html" target="_blank"><strong>CBQ</strong></a> is available at lartc.org.</p>
<p>P.S. It&#8217;s really working for me. Tested.</p>
<p><strong>Information Improvisation</strong>: <a href="http://www.bctes.com" target="_blank">Traffic Engineering Server</a> is Bandwidth Management and QoS Solution that is especially suitable for Broadband <a href="http://en.wikipedia.org/wiki/ISP" target="_blank">ISPs</a> and <a href="http://en.wikipedia.org/wiki/Small_and_medium_enterprise" target="_blank">SMEs</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2007/09/24/make-squid-to-mark-cache-hits-and-misses-rpm-package-for-fedora-5/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
