<?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>MrBrown blob &#187; FreeBSD</title>
	<atom:link href="http://charles.lescampeurs.org/tag/freebsd/feed" rel="self" type="application/rss+xml" />
	<link>http://charles.lescampeurs.org</link>
	<description>random bits.</description>
	<lastBuildDate>Sat, 10 Apr 2010 09:02:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>permanently load enable HTTP Accept Filter FreeBSD kernel module (accf_http)</title>
		<link>http://charles.lescampeurs.org/2009/03/12/permanently-load-enable-http-accept-filter-freebsd-kernel-module-accf_http</link>
		<comments>http://charles.lescampeurs.org/2009/03/12/permanently-load-enable-http-accept-filter-freebsd-kernel-module-accf_http#comments</comments>
		<pubDate>Thu, 12 Mar 2009 04:04:36 +0000</pubDate>
		<dc:creator>CharlyBr</dc:creator>
				<category><![CDATA[Optimization]]></category>
		<category><![CDATA[FreeBSD]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=171</guid>
		<description><![CDATA[While reading articles about optimization, I read about the accf_http module. The man page of the module is here, where you can read: The utility of accf_http is such that a server will not have to context switch several times before performing the initial parsing of the request. To load this module, use the following [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fcharles.lescampeurs.org%2F2009%2F03%2F12%2Fpermanently-load-enable-http-accept-filter-freebsd-kernel-module-accf_http"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fcharles.lescampeurs.org%2F2009%2F03%2F12%2Fpermanently-load-enable-http-accept-filter-freebsd-kernel-module-accf_http&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>While reading articles about optimization, I read about the <em>accf_http</em> module.</p>
<p>The man page of the module is <a title="accf_http man page" href="http://www.freebsd.org/cgi/man.cgi?query=accf_http" target="_blank">here</a>, where you can read:</p>
<blockquote><p><em>The utility of <strong>accf_http</strong> is such that a server will not have to context switch several times before performing the initial parsing of the request.</em></p></blockquote>
<p>To load this module, use the following command:</p>
<pre># kldload accf_http</pre>
<p>To load it at boot time, add the following line in <em>/boot/loader.conf</em>:</p>
<pre>accf_http_load="YES"</pre>
<p>To check if the module is loaded, use the command <em>kldstat</em>:</p>
<pre># kldstat
Id Refs Address    Size     Name
 1    4 0xc0400000 906518   kernel
 2    1 0xc0d07000 6a32c    acpi.ko
 3    1 0xc5e65000 2000     accf_http.ko</pre>
]]></content:encoded>
			<wfw:commentRss>http://charles.lescampeurs.org/2009/03/12/permanently-load-enable-http-accept-filter-freebsd-kernel-module-accf_http/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Use multiple memcached daemons on FreeBSD</title>
		<link>http://charles.lescampeurs.org/2008/10/02/use-multiple-memcached-daemons-on-freebsd</link>
		<comments>http://charles.lescampeurs.org/2008/10/02/use-multiple-memcached-daemons-on-freebsd#comments</comments>
		<pubDate>Thu, 02 Oct 2008 10:23:59 +0000</pubDate>
		<dc:creator>CharlyBr</dc:creator>
				<category><![CDATA[Distro]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[memcached]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=85</guid>
		<description><![CDATA[As you may know, when using memcached on 32-bit servers, processes can only address 4GB of virtual memory making the memcached daemon handle only 2 or 3 Gb of memory. If you want to address more memory, you need to launch multiple memcached daemons. I wrote an rc script , mmemcached, for FreeBSD to manage [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fcharles.lescampeurs.org%2F2008%2F10%2F02%2Fuse-multiple-memcached-daemons-on-freebsd"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fcharles.lescampeurs.org%2F2008%2F10%2F02%2Fuse-multiple-memcached-daemons-on-freebsd&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://charles.lescampeurs.org/wp-content/uploads/2008/10/picture-7.png"><img class="alignleft size-full wp-image-86" title="memcached" src="http://charles.lescampeurs.org/wp-content/uploads/2008/10/picture-7.png" alt="" width="160" height="160" /></a>As you may know, when using <a title="memcached homepage" href="http://www.danga.com/memcached/" target="_blank">memcached</a> on 32-bit servers, processes can only address 4GB of virtual memory making the memcached daemon handle only 2 or 3 Gb of memory.</p>
<p>If you want to address more memory, you need to launch multiple memcached daemons.</p>
<p>I wrote an rc script , <a title="mmemcached FreeBSD rc script" href="http://github.com/CharlyBr/freebsd-snippets/tree/master/mmemcached" target="_blank">mmemcached</a>, for FreeBSD to manage this.</p>
<p>To use it, you need to add this in /etc/rc.conf:</p>
<pre>mmemcached_enable="YES"
mmemcached_servers="1 2"
mmemcached_user="nobody"
mmemcached_args="-c 8192 -t 2 -m 2048 -d"</pre>
<p>Copy the mmemcached script in /usr/local/etc/rc.d for example and launch it with the start argument. With the above configuration it will launch two memcached daemons listening on ports 11211 and 11212 (mmemcached_servers parameter) with 2Gb of memory.</p>
<h2>Configuration</h2>
<p>Details of the rc.conf configuration:</p>
<ul>
<li>mmemcached_enabled: let this script &#8220;startable&#8221;,</li>
<li>mmemcached_servers: List of the daemons you want to start. Each number is used to generate the port number of the daemon. For example, 2 will launch a daemon listening on port 11212,</li>
<li>mmemcached_user: user that will start the daemon,</li>
<li>mmemcached_args: flags to pass to the daemon.</li>
</ul>
<h2>Download</h2>
<p><a title="mmemcached FreeBSD" href="http://github.com/CharlyBr/freebsd-snippets/tarball/master" target="_blank">Download the script</a> on <a title="FreeBSD snippets" href="http://github.com/CharlyBr/freebsd-snippets/tree/master" target="_blank">github</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://charles.lescampeurs.org/2008/10/02/use-multiple-memcached-daemons-on-freebsd/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Rotate Nginx log files under FreeBSD</title>
		<link>http://charles.lescampeurs.org/2008/07/17/rotate-nginx-log-files-under-freebsd</link>
		<comments>http://charles.lescampeurs.org/2008/07/17/rotate-nginx-log-files-under-freebsd#comments</comments>
		<pubDate>Thu, 17 Jul 2008 05:15:12 +0000</pubDate>
		<dc:creator>CharlyBr</dc:creator>
				<category><![CDATA[Logs]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[newsyslog]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=27</guid>
		<description><![CDATA[To rotate your nginx log files, you can use the log file handler provided by FreeBSD: newsyslog. Configuring /etc/newsyslog.conf /var/log/nginx-access.log               644  7     1024 *     JC /var/run/nginx.pid /var/log/nginx-error.log                644  7     1024 *     JC /var/run/nginx.pid Before log rotation: -rw-r--r--  1 root  wheel    104278002 Jul 16 11:35 nginx-access.log -rw-r--r--  1 root  wheel      1509531 Jul 16 11:17 nginx-error.log After [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fcharles.lescampeurs.org%2F2008%2F07%2F17%2Frotate-nginx-log-files-under-freebsd"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fcharles.lescampeurs.org%2F2008%2F07%2F17%2Frotate-nginx-log-files-under-freebsd&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>To rotate your nginx log files, you can use the log file handler provided by FreeBSD: newsyslog.</p>
<h2>Configuring /etc/newsyslog.conf</h2>
<pre>/var/log/nginx-access.log               644  7     1024 *     JC /var/run/nginx.pid
/var/log/nginx-error.log                644  7     1024 *     JC /var/run/nginx.pid</pre>
<p>Before log rotation:</p>
<pre>-rw-r--r--  1 root  wheel    104278002 Jul 16 11:35 nginx-access.log
-rw-r--r--  1 root  wheel      1509531 Jul 16 11:17 nginx-error.log</pre>
<p>After log rotation:</p>
<pre>-rw-r--r--  1 root  wheel        967 Jul 16 12:42 nginx-access.log
-rw-r--r--  1 root  wheel    5310443 Jul 16 12:41 nginx-access.log.0.bz2
-rw-r--r--  1 root  wheel         77 Jul 16 12:41 nginx-error.log
-rw-r--r--  1 root  wheel      37552 Jul 16 12:41 nginx-error.log.0.bz2</pre>
<h2>Links</h2>
<ul>
<li><a title="FreeBSD newsyslog man page" href="http://www.freebsd.org/cgi/man.cgi?query=newsyslog&amp;sektion=8&amp;apropos=0&amp;manpath=FreeBSD+7.0-RELEASE" target="_blank">newsyslog man page</a></li>
<li><a title="FreeBSD newsyslog.conf man page" href="http://www.freebsd.org/cgi/man.cgi?query=newsyslog.conf&amp;sektion=5&amp;apropos=0&amp;manpath=FreeBSD+7.0-RELEASE" target="_blank">newsyslog.conf man page</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://charles.lescampeurs.org/2008/07/17/rotate-nginx-log-files-under-freebsd/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
