<?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>blog.alexanderkoch.net</title>
	<atom:link href="http://blog.alexanderkoch.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.alexanderkoch.net</link>
	<description>Nerdy news from /home/alex</description>
	<lastBuildDate>Fri, 27 Apr 2012 13:26:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>trac on apache2 with mod_fcgid: can&#8217;t apply process slot</title>
		<link>http://blog.alexanderkoch.net/2012/trac-on-apache2-with-mod_fcgid-cant-apply-process-slot/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=trac-on-apache2-with-mod_fcgid-cant-apply-process-slot</link>
		<comments>http://blog.alexanderkoch.net/2012/trac-on-apache2-with-mod_fcgid-cant-apply-process-slot/#comments</comments>
		<pubDate>Mon, 23 Apr 2012 20:18:15 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[fcgid]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[trac]]></category>

		<guid isPermaLink="false">http://blog.alexanderkoch.net/?p=1028</guid>
		<description><![CDATA[Recently had some serious trouble running Trac on Apache2 with mod_fcgid. An included Doxygen-page spent hours loading and the Apache error log contained lines like this: [Sat Apr 21 21:38:26 2012] [warn] [client 88.65.186.160] mod_fcgid: can't apply process slot for /home/webX/trac/htdocs/favicon.ico [Sat Apr 21 21:42:01 2012] [warn] [client 66.249.66.247] mod_fcgid: read data timeout in 40 [...]]]></description>
			<content:encoded><![CDATA[<p>Recently had some serious trouble running <a href="http://trac.edgewall.org" title="Trac" target="_blank">Trac</a> on Apache2 with <code>mod_fcgid</code>. An included <a href="http://trac-hacks.org/wiki/DoxygenPlugin" title="Trac Hacks: Doxygen Plugin" target="_blank">Doxygen-page</a> spent hours loading and the Apache error log contained lines like this:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[Sat Apr 21 21:38:26 2012] [warn] [client 88.65.186.160] mod_fcgid: can't apply process slot for /home/webX/trac/htdocs/favicon.ico
[Sat Apr 21 21:42:01 2012] [warn] [client 66.249.66.247] mod_fcgid: read data timeout in 40 seconds
[Sat Apr 21 21:42:01 2012] [error] [client 66.249.66.247] Premature end of script headers: trac.fcgi</pre></div></div>

<p>The cause I finally discovered was that I had mixed up several ways of running Trac (<code>mod_python</code>, <code>mod_fastcgi</code>, <code>mod_fcgid</code>) while testing performance, so the lines in my Trac vhost looked like this (including the disabled lines):</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;">&lt;<span style="color: #000000; font-weight:bold;">VirtualHost</span> x.y.z.w:<span style="color: #ff0000;">80</span>&gt;
	<span style="color: #00007f;">ServerName</span> domain.org
	<span style="color: #00007f;">ServerAlias</span> www.domain.org
&nbsp;
	<span style="color: #00007f;">DocumentRoot</span> /home/webX/trac/htdocs
	<span style="color: #00007f;">Alias</span> /chrom/common /usr/share/pyshared/trac/htdocs
	<span style="color: #00007f;">Alias</span> /chrome/site /home/webX/trac/htdocs
	<span style="color: #00007f;">Alias</span> /favicon.ico /home/webX/trac/htdocs/favicon.ico
&nbsp;
	&lt;<span style="color: #000000; font-weight:bold;">Directory</span> <span style="color: #7f007f;">&quot;/usr/share/pyshared/trac/htdocs&quot;</span>&gt;
		<span style="color: #00007f;">Order</span> <span style="color: #00007f;">allow</span>,<span style="color: #00007f;">deny</span>
		<span style="color: #00007f;">Allow</span> from <span style="color: #0000ff;">all</span>
	&lt;/<span style="color: #000000; font-weight:bold;">Directory</span>&gt;
	&lt;<span style="color: #000000; font-weight:bold;">Directory</span> /home/webX/trac/htdocs&gt;
		<span style="color: #00007f;">Order</span> <span style="color: #00007f;">allow</span>,<span style="color: #00007f;">deny</span>
		<span style="color: #00007f;">Allow</span> from <span style="color: #0000ff;">all</span>
	&lt;/<span style="color: #000000; font-weight:bold;">Directory</span>&gt;
&nbsp;
	<span style="color: #00007f;">ScriptAlias</span> / /home/webX/trac/fcgi/trac.fcgi/
<span style="color: #adadad; font-style: italic;">#	&lt;Location /&gt;</span>
<span style="color: #adadad; font-style: italic;">#		SetHandler fcgid-script</span>
<span style="color: #adadad; font-style: italic;">#		Options ExecCGI</span>
<span style="color: #adadad; font-style: italic;">#		Allow from all</span>
<span style="color: #adadad; font-style: italic;">#	&lt;/Location&gt;</span>
&nbsp;
	&lt;<span style="color: #000000; font-weight:bold;">Location</span> <span style="color: #7f007f;">&quot;/login&quot;</span>&gt;
		<span style="color: #00007f;">AuthType</span> Basic
		<span style="color: #00007f;">AuthName</span> <span style="color: #7f007f;">&quot;Trac&quot;</span>
		<span style="color: #00007f;">AuthUserFile</span> <span style="color: #7f007f;">&quot;/home/webX/trac/passwd.htaccess&quot;</span>
		<span style="color: #00007f;">Require</span> valid-<span style="color: #00007f;">user</span>
	&lt;/<span style="color: #000000; font-weight:bold;">Location</span>&gt;
&nbsp;
	<span style="color: #00007f;">CustomLog</span> /var/log/apache2/domain.org.access.log combined
	<span style="color: #00007f;">ErrorLog</span> /var/log/apache2/domain.org.error.log
&lt;/<span style="color: #000000; font-weight:bold;">VirtualHost</span>&gt;</pre></div></div>

<p>Removed the superfluous <code>&lt;Location /&gt;</code> - Block and trouble was gone <img src='http://blog.alexanderkoch.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexanderkoch.net/2012/trac-on-apache2-with-mod_fcgid-cant-apply-process-slot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Confixx Setup nachbessern</title>
		<link>http://blog.alexanderkoch.net/2012/confixx-setup-nachbessern/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=confixx-setup-nachbessern</link>
		<comments>http://blog.alexanderkoch.net/2012/confixx-setup-nachbessern/#comments</comments>
		<pubDate>Mon, 02 Apr 2012 19:49:38 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[sicherheit]]></category>
		<category><![CDATA[confixx]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[setup]]></category>

		<guid isPermaLink="false">http://blog.alexanderkoch.net/?p=1021</guid>
		<description><![CDATA[An einem frisch per Virtualisierungs-Container installierten Confixx schraubt man üblicherweise an ein paar Stellen herum, um das Panel abzusichern. Bei einem kürzlich von mir durchgeführten Server-(Provider-)Wechsel war diesmal jedoch so viel Handarbeit nötig, dass ich diese hier mal kurz festhalten möchte. Ohne manche der mit [Fix] markierten Schritte hätten einige Dienste übrigens garnicht oder mit [...]]]></description>
			<content:encoded><![CDATA[<p>An einem frisch per Virtualisierungs-Container installierten Confixx schraubt man üblicherweise an ein paar Stellen herum, um das Panel abzusichern. Bei einem kürzlich von mir durchgeführten Server-(Provider-)Wechsel war diesmal jedoch so viel Handarbeit nötig, dass ich diese hier mal kurz festhalten möchte.</p>
<p>Ohne manche der mit <em>[Fix]</em> markierten Schritte hätten einige Dienste übrigens garnicht oder mit unschönen Nebeneffekten funktioniert, weshalb ich vom Installations-Image meines Providers auch ziemlich enttäuscht war - da hätte ich es besser selbst aufgesetzt <img src='http://blog.alexanderkoch.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   Als Distribution kam bei mir Debian 6.0.4 <em>Squeeze</em> zum Einsatz.</p>
<p><strong>Hinweis:</strong> Irren ist menschlich, alle hier vorgestellten Schritte erfolgen auf eigene Gefahr! Backups sind Gold wert!</p>
<h4><strong>Upgrade</strong></h4>
<p><strong></strong>Bei mir war ein Upgrade auf die aktuelle Version 3.3.9 erforderlich, wer einen Guide sucht kann <a title="Confixx Update" href="http://download1.parallels.com/Confixx/ConfixxPro3.3/3.3.9/parallels_confixx_3.3.9.htm#ss3.1" target="_blank">hier</a> fündig werden.</p>
<h4>[Security] MySQL-Accounts ändern</h4>
<p>Das Wichtigste zuerst: unbedingt alle mit Confixx in Verbindung stehenden Passwörter überprüfen. Bei meinem Setup war doch tatsächlich als Passwort für den MySQL-<code>root</code> 'T' (ja, der Buchstabe 'T') gesetzt! Und das bei einem standardmäßig über PHPMyAdmin von außen erreichbaren Dienst!</p>
<p>Ich habe einen separaten MySQL-Benutzer für Confixx erstellt und ihm entsprechende Rechte gegeben. Anzufassen sind folgende Configs:</p>
<ul>
<li><strong><code>&lt;confixx-install-dir&gt;/confixx_main.conf</code>:</strong> ab Zeile 547</li>
<li><strong><code>/var/www/confixx/settings.inc.php</code>:</strong> Werte aus der confixx_main.conf übertragen</li>
<li><strong><code>/etc/spamassassin/local.cf</code></strong> (wird aber sowieso neu generiert)</li>
</ul>
<h4>[Fix] Mail-Aliase behalten</h4>
<p>Diverse Pakete legen eigene Benutzer an und tragen diese in die <code>/etc/aliases</code> ein, z.B. logcheck. Dumm nur, dass Confixx die <code>/etc/aliases</code> periodisch (bzw. bei jeder Änderung an Postfächern) neu schreibt, und zwar "dumm" nach einem eigenen Template, was die neuen Benutzer nicht reflektiert.</p>
<p>Hier ist also dauerhaft Handarbeit angesagt: neue System-Aliase oder eigens angelegte müssen in die <strong><code>&lt;confixx-install-dir&gt;/safe/aliases_header</code></strong> aufgenommen werden, um nicht verloren zu gehen.</p>
<h4>[Fix] Spamassassin</h4>
<p>Ohne Nachbessern war bei mir Spamassassin nicht funktionstüchtig. Ich habe einen separaten Benutzer für den spamd angelegt:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ groupadd <span style="color: #660033;">-g</span> <span style="color: #000000;">5001</span> spamd
$ useradd <span style="color: #660033;">-u</span> <span style="color: #000000;">5001</span> <span style="color: #660033;">-g</span> spamd <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>nologin <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>spamassassin spamd
$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>spamassassin
$ <span style="color: #c20cb9; font-weight: bold;">chown</span> spamd:spamd <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>spamassassin</pre></div></div>

<p>Dann die Startoptionen für den Daemon korrigieren:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># /etc/default/spamassassin</span>
<span style="color: #7a0874; font-weight: bold;">&#40;</span>...<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">OPTIONS</span>=<span style="color: #ff0000;">&quot;--create-prefs --nouser-config --max-children 5 -H /var/lib/spamassassin -u spamd -q&quot;</span>
<span style="color: #7a0874; font-weight: bold;">&#40;</span>...<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<h4>[Fix] AWStats</h4>
<p>AWStats muss scheinbar das 10-Minuten-Update als root durchführen, daher unter <code>/etc/cron.d/awstats</code> beim oberen Eintrag den Benutzer auf root ändern. Das habe ich allerdings nicht näher untersucht, also besser selbst nochmal checken.</p>
<h4>[Fix] Apache "other vhosts" log</h4>
<p>Da Confixx für jeden Vhost nur ein Custom-Log über eine Pipe setzt (<code>/etc/apache2/confixx_vhost.conf</code>), bewirkt die Direktive in <code>/etc/apache2/conf.d/other-vhosts-access-log</code>, dass jeder (!!) Zugriff auf irgendeinen Vhost unter <code>/var/log/apache2/other_vhosts_access.log</code> vermerkt wird. Das lässt das File je nach Auslastung des Servers extrem schnell wachsen, man sollte die Option also der Performance und des Plattenplatzes zuliebe besser auskommentieren.</p>
<h4>[Fix] Postfix SASL authentication</h4>
<p>Abgesehen von einer komplett überarbeiteten <code>main.cf</code> musste ich für Postfix noch die SASL-Authentifizierung fixen, was praktischerweise in der <strong><code>/etc/default/saslauthd</code></strong> schon vorgesehen ist:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Example for postfix users: &quot;-c -m /var/spool/postfix/var/run/saslauthd&quot;</span></pre></div></div>

<p>Details siehe <code>/usr/share/doc/sasl2-bin/README.Debian.gz</code>.</p>
<p>&nbsp;</p>
<p>Das wars erstmal mit den wichtigsten Nachbesserungen. Confixx in eine eigene Subdomain zu sperren und das Vhost-Schema dauerhaft zu ändern war nochmal eine ganz eigene Angelegenheit - vielleicht dazu demnächst ein HowTo.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexanderkoch.net/2012/confixx-setup-nachbessern/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing TRIM with LUKS on LVM</title>
		<link>http://blog.alexanderkoch.net/2011/testing-trim-with-luks-on-lvm/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=testing-trim-with-luks-on-lvm</link>
		<comments>http://blog.alexanderkoch.net/2011/testing-trim-with-luks-on-lvm/#comments</comments>
		<pubDate>Thu, 17 Nov 2011 16:28:16 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[howto]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[luks]]></category>
		<category><![CDATA[lvm]]></category>
		<category><![CDATA[ssd]]></category>
		<category><![CDATA[trim]]></category>

		<guid isPermaLink="false">http://blog.alexanderkoch.net/?p=1011</guid>
		<description><![CDATA[One can find many guides on the net on how to test TRIM using dd and hdparm, which all describe the same procedure: create a random-filled file, sync it to disk determine the LBAs the file resides in using hdparm --fibmap [file] pick one sector, raw-read it with hdparm --read-sector [sector] [device] delete the random [...]]]></description>
			<content:encoded><![CDATA[<p>One can find many guides on the net on how to test TRIM using <strong><code>dd</code></strong> and <strong><code>hdparm</code></strong>, which all describe the same procedure:</p>
<ul>
<li>create a random-filled file, sync it to disk</li>
<li>determine the LBAs the file resides in using <code>hdparm --fibmap [file]</code></li>
<li>pick one sector, raw-read it with <code>hdparm --read-sector [sector] [device]</code></li>
<li>delete the random file, sync again</li>
<li>verify TRIM was issued by reading the same block again, should return only zeroes</li>
</ul>
<p>The problem with all these guides is that they don't say anything about the influence partitioning and other layers like LVM can have on the right LBA to use with <code>hdparm --read-sector</code>.<br />
You must add any offsets resulting from either other partitions or payload-offsets from LVM, LUKS and thelike to the address you got from <code>hdparm --fibmap</code>!</p>
<p>I'll explain the concrete steps using my setup:</p>

<div class="wp_syntax"><div class="code"><pre class="none" style="font-family:monospace;">[alex@thor ~]$ fdisk -l /dev/sdd
&nbsp;
Disk /dev/sdd: 128.0 GB, 128035676160 bytes
255 heads, 63 sectors/track, 15566 cylinders, total 250069680 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xddfc7af4
&nbsp;
   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1   *        2048     1050623      524288   83  Linux
/dev/sdd2         1050624   250069679   124509528   8e  Linux LVM</pre></div></div>

<p>The PV our target LV resides on starts at sector 1050624, which is our first offset.</p>

<div class="wp_syntax"><div class="code"><pre class="none" style="font-family:monospace;">[alex@thor ~]$ dmsetup table
root-plain: 0 56619008 crypt aes-xts-plain [keyslot] 0 254:0 4096 1 allow_discards
m4vg0-root: 0 55050240 linear 8:50 2048
(...)</pre></div></div>

<p>Here we can see that LVM has a payload offset of 2084 bytes and LUKS (dm-crypt) one of 4096 bytes (fits well for an SSD).</p>

<div class="wp_syntax"><div class="code"><pre class="none" style="font-family:monospace;">[alex@thor usr]$ hdparm --fibmap testfile
&nbsp;
testfile:
 filesystem blocksize 4096, begins at LBA 0; assuming 512 byte sectors.
 byte_offset  begin_LBA    end_LBA    sectors
           0     272600     272607          8</pre></div></div>

<p>So finally we calculate the "real" address of our chosen sector (the first one) by <strong>272600 + 1050624 + 2048 + 4096 = 1329368</strong>.</p>
<p>Happy TRIM-testing, and keep in mind the <a title="TRIM+LUKS" href="http://asalor.blogspot.com/2011/08/trim-dm-crypt-problems.html" target="_blank">implications</a> for crypto-recurity!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexanderkoch.net/2011/testing-trim-with-luks-on-lvm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thinkpad X220 Power Saving</title>
		<link>http://blog.alexanderkoch.net/2011/thinkpad-x220-power-saving/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=thinkpad-x220-power-saving</link>
		<comments>http://blog.alexanderkoch.net/2011/thinkpad-x220-power-saving/#comments</comments>
		<pubDate>Sun, 06 Nov 2011 08:46:31 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[powersacing]]></category>
		<category><![CDATA[thinkpad]]></category>

		<guid isPermaLink="false">http://blog.alexanderkoch.net/?p=995</guid>
		<description><![CDATA[Das Thinkpad X220 leidet wie alle Rechner mit SandyBridge-Grafik (Intel HD 3000) an den Auswirkungen der aktuellen Kernel Power Regressions (siehe hier und hier), was zu CPU-Temperaturen über 50°C (idle!) und permanent relativ hoch drehendem Lüfter führt. Mit folgenden Zeilen schaffe ich es im Idle auf 42°C und einen gelegentlich inaktiven Lüfter: # /etc/rc.local # [...]]]></description>
			<content:encoded><![CDATA[<p>Das Thinkpad X220 leidet wie alle Rechner mit SandyBridge-Grafik (Intel HD 3000) an den Auswirkungen der aktuellen Kernel Power Regressions (siehe <a title="heise.de" href="http://www.heise.de/open/artikel/Die-Woche-Ungenutztes-Stromsparpotenzial-1361381.html" target="_blank">hier</a> und <a title="heise.de" href="http://www.heise.de/open/artikel/Kernel-Log-Hoeherer-Stromverbrauch-durch-BIOS-Bugs-1268394.html" target="_blank">hier</a>), was zu CPU-Temperaturen über 50°C (idle!) und permanent relativ hoch drehendem Lüfter führt.</p>
<p>Mit folgenden Zeilen schaffe ich es im Idle auf 42°C und einen gelegentlich inaktiven Lüfter:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># /etc/rc.local</span>
<span style="color: #666666; font-style: italic;"># set governor</span>
cpufreq-set <span style="color: #660033;">-g</span> ondemand <span style="color: #660033;">-c</span> <span style="color: #000000;">0</span>
cpufreq-set <span style="color: #660033;">-g</span> ondemand <span style="color: #660033;">-c</span> <span style="color: #000000;">1</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># disable bluetooth</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> disable <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>acpi<span style="color: #000000; font-weight: bold;">/</span>ibm<span style="color: #000000; font-weight: bold;">/</span>bluetooth
&nbsp;
<span style="color: #666666; font-style: italic;"># set brightness level</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">6</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>class<span style="color: #000000; font-weight: bold;">/</span>backlight<span style="color: #000000; font-weight: bold;">/</span>acpi_video0<span style="color: #000000; font-weight: bold;">/</span>brightness
&nbsp;
<span style="color: #666666; font-style: italic;"># set vm laptop-mode</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">5</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>vm<span style="color: #000000; font-weight: bold;">/</span>laptop_mode
&nbsp;
<span style="color: #666666; font-style: italic;"># increase vm dirty writeback time</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">1500</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>vm<span style="color: #000000; font-weight: bold;">/</span>dirty_writeback_centisecs
&nbsp;
<span style="color: #666666; font-style: italic;"># set SATA link power management</span>
<span style="color: #000000; font-weight: bold;">for</span> D <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>class<span style="color: #000000; font-weight: bold;">/</span>scsi_host<span style="color: #000000; font-weight: bold;">/</span>host<span style="color: #000000; font-weight: bold;">*/</span>link_power_management_policy; <span style="color: #000000; font-weight: bold;">do</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> min_power <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$D</span>
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># disable kernel nmi watchdog</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>kernel<span style="color: #000000; font-weight: bold;">/</span>nmi_watchdog
&nbsp;
<span style="color: #666666; font-style: italic;"># set pci/i2c bus power management</span>
<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>sys<span style="color: #000000; font-weight: bold;">/</span>bus<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>pci,i2c<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>devices<span style="color: #000000; font-weight: bold;">/*/</span>power<span style="color: #000000; font-weight: bold;">/</span>control; <span style="color: #000000; font-weight: bold;">do</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> auto <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$I</span>
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># enable scheduler power saving</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>devices<span style="color: #000000; font-weight: bold;">/</span>system<span style="color: #000000; font-weight: bold;">/</span>cpu<span style="color: #000000; font-weight: bold;">/</span>sched_mc_power_savings</pre></div></div>

<p>In der Kernel-Line im Bootloader noch folgende Parameter:</p>
<p><code><strong>pcie_aspm=force i915.i915_enable_fbc=1 i915.i915_enable_rc6=1</strong></code></p>
<p><a href="http://blog.alexanderkoch.net/wp-content/uploads/2011/11/scrn.png" rel="shadowbox[sbpost-995];player=img;" title="screeny"><img src="http://blog.alexanderkoch.net/wp-content/uploads/2011/11/scrn-300x168.png" alt="Thinkpad X220 Lüfter Stillstand" title="screeny" width="300" height="168" class="aligncenter size-medium wp-image-1007" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexanderkoch.net/2011/thinkpad-x220-power-saving/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>hdd-spindown.sh</title>
		<link>http://blog.alexanderkoch.net/2011/hdd-spindown-sh/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=hdd-spindown-sh</link>
		<comments>http://blog.alexanderkoch.net/2011/hdd-spindown-sh/#comments</comments>
		<pubDate>Sat, 08 Oct 2011 20:40:03 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[disk]]></category>
		<category><![CDATA[sata]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[spindown]]></category>

		<guid isPermaLink="false">http://blog.alexanderkoch.net/?p=979</guid>
		<description><![CDATA[Mal wieder Zeit gefunden, einen schon leicht angestaubten Punkt auf meiner 2code-Liste abzuhaken: Ein Bash-Script, das Platten bei Inaktivität nach definierbarem Timeout per hdparm -y in Standby schickt. Für mich sehr nützlich bei SATA-Platten, die sich nicht per hdparm -S konfigurieren lassen. Gehostet wie immer auf github, oder direkt hier: 1 2 3 4 5 [...]]]></description>
			<content:encoded><![CDATA[<p>Mal wieder Zeit gefunden, einen schon leicht angestaubten Punkt auf meiner 2code-Liste abzuhaken:</p>
<p>Ein Bash-Script, das Platten bei Inaktivität nach definierbarem Timeout per <code>hdparm -y</code> in Standby schickt. Für mich sehr nützlich bei SATA-Platten, die sich nicht per <code>hdparm -S</code> konfigurieren lassen.</p>
<p>Gehostet wie immer auf <a href="https://github.com/lynix/scripts" title="lynix auf github.com" target="_blank">github</a>, oder direkt hier:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Automatic disk standby using kernel diskstats and hdparm</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Version 1.1, 2011 by Alexander Koch &lt;lynix47@gmail.com&gt;</span>
<span style="color: #666666; font-style: italic;">#</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;"># DEVICES syntax: DEVICE:TIMEOUT_SEC</span>
<span style="color: #007800;">DEVICES</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #ff0000;">&quot;sda:120&quot;</span> <span style="color: #ff0000;">&quot;sdb:120&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> device_worker<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
	<span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;/dev/$1&quot;</span> <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">1</span>
	logger <span style="color: #660033;">-t</span> hdd-spindown.sh <span style="color: #ff0000;">&quot;spawned monitor thread for $1&quot;</span>
	<span style="color: #007800;">COUNT_R</span>=<span style="color: #000000;">0</span>
	<span style="color: #007800;">COUNT_W</span>=<span style="color: #000000;">0</span>
	<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #c20cb9; font-weight: bold;">true</span>; <span style="color: #000000; font-weight: bold;">do</span>
		<span style="color: #007800;">NEW_R</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $1}'</span> <span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>block<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$1</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">stat</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
		<span style="color: #007800;">NEW_W</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $5}'</span> <span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>block<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$1</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">stat</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$COUNT_R</span> <span style="color: #660033;">-eq</span> <span style="color: #007800;">$NEW_R</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$COUNT_W</span> <span style="color: #660033;">-eq</span> <span style="color: #007800;">$NEW_W</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
			<span style="color: #000000; font-weight: bold;">if</span> hdparm <span style="color: #660033;">-C</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> active <span style="color: #000000; font-weight: bold;">&amp;&gt;/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null; <span style="color: #000000; font-weight: bold;">then</span>
				logger <span style="color: #660033;">-t</span> hdd-spindown.sh <span style="color: #ff0000;">&quot;suspending $1&quot;</span>
				hdparm <span style="color: #660033;">-qy</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$1</span>
				<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$?</span> <span style="color: #660033;">-gt</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
					logger <span style="color: #ff0000;">&quot;failed to suspend $1&quot;</span>
					<span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">1</span>
				<span style="color: #000000; font-weight: bold;">fi</span>
			<span style="color: #000000; font-weight: bold;">fi</span>
		<span style="color: #000000; font-weight: bold;">else</span>
			<span style="color: #007800;">COUNT_R</span>=<span style="color: #007800;">$NEW_R</span>
			<span style="color: #007800;">COUNT_W</span>=<span style="color: #007800;">$NEW_W</span>
		<span style="color: #000000; font-weight: bold;">fi</span>
		<span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #007800;">$2</span>
	<span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">for</span> D <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #800000;">${DEVICES[@]}</span>; <span style="color: #000000; font-weight: bold;">do</span>
	device_worker $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$D</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">':'</span> <span style="color: #660033;">-f</span> <span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$D</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">':'</span> <span style="color: #660033;">-f</span> <span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">&amp;</span>
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></pre></td></tr></table></div>

<p>Auf Performance-Optimierungen habe ich bewusst verzichtet und alles möglichst simpel gehalten.</p>
<p>Funktionsbedingt ist der einstellbare Wert für den Timeout (T) übrigens nicht hart; die reale Zeit an Inaktivität <em>t<sub>i</sub></em> genügt der Bedingung <em>T ≤ t<sub>i</sub> &lt; 2T</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexanderkoch.net/2011/hdd-spindown-sh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thinkpad X220: BIOS Update</title>
		<link>http://blog.alexanderkoch.net/2011/thinkpad-x220-bios-update/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=thinkpad-x220-bios-update</link>
		<comments>http://blog.alexanderkoch.net/2011/thinkpad-x220-bios-update/#comments</comments>
		<pubDate>Tue, 04 Oct 2011 21:16:13 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[hardware]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[bios]]></category>
		<category><![CDATA[grub4dos]]></category>
		<category><![CDATA[thinkpad]]></category>
		<category><![CDATA[x220]]></category>

		<guid isPermaLink="false">http://blog.alexanderkoch.net/?p=977</guid>
		<description><![CDATA[Mein kürzlich erstandenes Thinkpad X220 leidet unter den mit aktuellen Kerneln (~2.6.38 - 3.0.4) auftretenden Hitzeproblemen (Post folgt). Mit einem BIOS-Update soll sich laut Lenovo das Lüfterverhalten verbessern - Grund genug In diversen Wikis werden die unterschiedlichsten Methoden beschrieben, das von Lenovo bereitgestellte CD-Image ohne optisches Laufwerk und mit Linux-Bordmitteln gebootet zu bekommen. Mit der [...]]]></description>
			<content:encoded><![CDATA[<p>Mein kürzlich erstandenes Thinkpad X220 leidet unter den mit aktuellen Kerneln (~2.6.38 - 3.0.4) auftretenden Hitzeproblemen (Post folgt). Mit einem BIOS-Update soll sich laut Lenovo das Lüfterverhalten verbessern - Grund genug <img src='http://blog.alexanderkoch.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>In diversen Wikis werden die unterschiedlichsten Methoden <a title="Thinkwiki.org: BIOS Upgrade" href="http://www.thinkwiki.org/wiki/BIOS_Upgrade" target="_blank">beschrieben</a>, das von Lenovo bereitgestellte CD-Image ohne optisches Laufwerk und mit Linux-Bordmitteln gebootet zu bekommen. Mit der gängigsten Methode (syslinux) bekam ich jedoch nur einen kompletten Freeze (nebst verbundenem Schreck).</p>
<p>Funktioniert hat mit meinem X220 die Variante <a title="grub4dos-Methode" href="http://www.thinkwiki.org/wiki/BIOS_Upgrade#Using_grub4dos_.28also_for_Linux.29" target="_blank">Using grub4dos</a>. An den Temperaturen hat das soweit ich sagen kann aber nichts geändert.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexanderkoch.net/2011/thinkpad-x220-bios-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSD Encryption Benchmark</title>
		<link>http://blog.alexanderkoch.net/2011/ssd-encryption-benchmark/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ssd-encryption-benchmark</link>
		<comments>http://blog.alexanderkoch.net/2011/ssd-encryption-benchmark/#comments</comments>
		<pubDate>Mon, 26 Sep 2011 22:02:50 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[arch]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[ecryptfs]]></category>
		<category><![CDATA[encfs]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[luks]]></category>
		<category><![CDATA[ssd]]></category>

		<guid isPermaLink="false">http://blog.alexanderkoch.net/?p=963</guid>
		<description><![CDATA[Kürzlich konnte ich dem allgemeinen Hype um SSDs nicht mehr widerstehen und habe das lästige Brummen meiner Systemplatte durch die Stille einer Crucial M4 mit 128GB ersetzt. Die Wahl viel nicht auf eine aktuell recht günstig zu habende OCZ Vertex 2, da der SandForce Controller seine spezifizierten Transferraten nur durch hardwareseitige Kompression erreicht, und bei [...]]]></description>
			<content:encoded><![CDATA[<p>Kürzlich konnte ich dem allgemeinen Hype um SSDs nicht mehr widerstehen und habe das lästige Brummen meiner Systemplatte durch die Stille einer <strong><a title="Crucial Store" href="http://www.crucial.com/store/minipartspec.aspx?imodule=CT128M4SSD2" target="_blank">Crucial M4</a></strong> mit 128GB ersetzt.</p>
<p>Die Wahl viel nicht auf eine aktuell recht günstig zu habende <a title="OCZ Vertex 2" href="http://www.ocztechnology.com/ocz-vertex-2-sata-ii-2-5-ssd.html" target="_blank">OCZ Vertex 2</a>, da der SandForce Controller seine spezifizierten Transferraten nur durch hardwareseitige Kompression erreicht, und bei verschlüsselten oder bereits komprimierten Daten stark einbricht. Die Crucial-SSDs (M4 ebenso wie ihr Vorgänger C300) nutzen Marvel Controller und "tricksen" nicht durch Kompression.</p>
<h4>Verschlüsselung und TRIM-Support</h4>
<p>Bei Verwendung von SSDs ist der <a title="Wikipedia: TRIM" href="http://de.wikipedia.org/wiki/TRIM" target="_blank">TRIM</a>-Support entscheidend für Lebensdauer und Performance. Auf meinen HDDs verwende ich überall <a title="Wikipedia: Full Disk Encryption" href="http://de.wikipedia.org/wiki/Full_Disk_Encryption" target="_blank">FDE</a> mit <a title="Wikipedia: LUKS" href="http://de.wikipedia.org/wiki/Linux_Unified_Key_Setup" target="_blank">LUKS</a> (dm-crypt), was allerdings leider erst ab Kernel 3.1 TRIM unterstützen wird. Das neue Kernel-Release wird wohl erst <a title="LKML-Auszüge" href="http://www.internetnews.com/blog/skerner/linux-3.1-release-delayed-for-kernel.org-and-linus-vacation.html" target="_blank">im Oktober</a> erscheinen; außerdem fehlt noch Userspace-Support für TRIM in cryptsetup.</p>
<p>Da für mich die Verschlüsselung der Daten unverzichtbar war, ein Unlocking per Login aber ungünstig finde (cron-jobs...), habe ich nun eine Hybridlösung im Einsatz: die Rootpartition (~1,2GB) bleibt weiterhin LUKS-verschlüsselt, während ich für /home auf Verschlüsselung auf Dateiebene zurückgreife. Wegen der vielen Berichte über miese Performance von <a title="Wikipedia: EncFS" href="http://de.wikipedia.org/wiki/EncFS" target="_blank">EncFS</a> (irgendwie einleuchtend wegen der vielen user&lt;-&gt;kernel switches) habe ich mich für das in-kernel implementierte <a title="eCryptfs" href="http://ecryptfs.sourceforge.net/" target="_blank">eCryptfs</a> entschieden.</p>
<h4>eCryptfs für /home</h4>
<p>Wer LUKS gewöhnt ist, der hat mit eCryptfs am Anfang einige Umgewöhnung vor sich, denn eCryptfs arbeitet deutlich anders. Zum groben Setup habe ich mich an einem <a title="anrxc's HowTo" href="http://sysphere.org/~anrxc/j/articles/ecryptfs/index.html" target="_blank">HowTo</a> orientiert, allerdings lasse ich mein eCryptfs-Volume nicht beim Login über PAM mounten, sondern automatisch über <code>/etc/rc.local</code> (ist wegen blockverschlüsseltem root kein Problem).</p>
<p>Dazu habe ich die Passphrase in eine Datei unter /etc gepackt und nutze diese Zeile in der <code>fstab</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="fstab" style="font-family:monospace;"># /etc/fstab
&nbsp;
(...)
&nbsp;
/home.crypt /home ecryptfs rw,verbosity=0,ecryptfs_sig=XYZ,ecryptfs_passthrough=n,key=passphrase,passphrase_passwd_file=/etc/vol.key,ecryptfs_cipher=aes,ecryptfs_key_bytes=32,ecryptfs_fnek_sig=XYZ,ecryptfs_unlink_sigs  0 0</pre></div></div>

<h4>Benchmarks</h4>
<p>Nun zum titelgebenden Inhalt: Benchmarks <img src='http://blog.alexanderkoch.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Natürlich wollte ich wissen, wie viel Performance ich durch die SSD gewinne, bzw. welcher Anteil davon durch die Verschlüsselung wieder flöten geht.</p>
<p>Gemessen habe ich die Transferraten beim Lesen bzw. Schreiben einer 1GB-Datei per <code>dd</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>alex<span style="color: #000000; font-weight: bold;">@</span>thor bench<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #007800;">LC_ALL</span>=C <span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">if</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>zero <span style="color: #007800;">of</span>=<span style="color: #c20cb9; font-weight: bold;">tempfile</span> <span style="color: #007800;">bs</span>=1M <span style="color: #007800;">count</span>=<span style="color: #000000;">1024</span> <span style="color: #007800;">conv</span>=fdatasync,notrunc
<span style="color: #000000;">1024</span>+<span style="color: #000000;">0</span> records <span style="color: #000000; font-weight: bold;">in</span>
<span style="color: #000000;">1024</span>+<span style="color: #000000;">0</span> records out
<span style="color: #000000;">1073741824</span> bytes <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1.1</span> GB<span style="color: #7a0874; font-weight: bold;">&#41;</span> copied, <span style="color: #000000;">10.7813</span> s, <span style="color: #000000;">99.6</span> MB<span style="color: #000000; font-weight: bold;">/</span>s
<span style="color: #7a0874; font-weight: bold;">&#91;</span>alex<span style="color: #000000; font-weight: bold;">@</span>thor bench<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">su</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;echo 3 &gt; /proc/sys/vm/drop_caches&quot;</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>alex<span style="color: #000000; font-weight: bold;">@</span>thor bench<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #007800;">LC_ALL</span>=C <span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">if</span>=<span style="color: #c20cb9; font-weight: bold;">tempfile</span> <span style="color: #007800;">of</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #007800;">bs</span>=1M <span style="color: #007800;">count</span>=<span style="color: #000000;">1024</span>
<span style="color: #000000;">1024</span>+<span style="color: #000000;">0</span> records <span style="color: #000000; font-weight: bold;">in</span>
<span style="color: #000000;">1024</span>+<span style="color: #000000;">0</span> records out
<span style="color: #000000;">1073741824</span> bytes <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1.1</span> GB<span style="color: #7a0874; font-weight: bold;">&#41;</span> copied, <span style="color: #000000;">13.583</span> s, <span style="color: #000000;">79.1</span> MB<span style="color: #000000; font-weight: bold;">/</span>s</pre></div></div>

<p><a href="http://blog.alexanderkoch.net/wp-content/uploads/2011/09/ssdbench.png" rel="shadowbox[sbpost-963];player=img;" title="ssdbench"><img class="aligncenter size-full wp-image-964" title="ssdbench" src="http://blog.alexanderkoch.net/wp-content/uploads/2011/09/ssdbench.png" alt="SSD Benchmark" width="563" height="373" /></a></p>
<p>Als Dateisystem kam überall ein korrekt align'tes EXT4 zum Einsatz, mit aktivierter <code>discard</code>-Option wo möglich. Darunter lag über dem physischen Layer noch ein ebenfalls sorgfältig eingerichtetes LVM. Zum Vergleich habe ich auch noch mein Software-RAID1 (Blogpost folgt) auf zwei herkömmlichen HDDs (WD Caviar Green WD20EARS) getestet, wo ebenfalls EXT4 auf LUKS auf LVM zum Einsatz kommt.</p>
<p>Wie man sehen kann erreicht die SSD zwar nicht ganz ihre Datenblatt-Werte, aber da diese sowieso immer recht utopisch sind und ich die Platte nur an einem SATAII-Port hängen habe, bin ich mit den Transferraten für unverschlüsselte Dateisysteme zufrieden.</p>
<p>Alle Werte für verschlüsselte Dateisysteme zeigen einen Performanceverlust, der beim Lesen deutlich größer ist als beim Schreiben - darüber muss ich noch nachdenken <img src='http://blog.alexanderkoch.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
Hier geht es mir aber um den Vergleich LUKS-eCryptfs, der deutlich zu Gunsten von LUKS ausfällt.</p>
<h4>UPDATE: LUKS+TRIM, Mehr Benchmark</h4>
<p>Hier noch ein überaus interessanter <a href="http://asalor.blogspot.com/2011/08/trim-dm-crypt-problems.html" title="Milan Broz: TRIM &#038; dm-crypt ... problems?" target="_blank">Artikel</a> zu Folgen von TRIM auf dm-crypt Volumes aus kryptographischer Sicht.</p>
<p>Außerdem noch ein Screenshot des Disk-Benchmarks <code>palimpsest</code> (ehemals Teil des <code>gnome-disk-utilitiy</code>), der die Transferraten auf der unformatierten M4 (nach Firmware-Update) zeigt:</p>
<p><a href="http://blog.alexanderkoch.net/wp-content/uploads/2011/09/palimpsest.png" rel="shadowbox[sbpost-963];player=img;" title="palimpsest"><img src="http://blog.alexanderkoch.net/wp-content/uploads/2011/09/palimpsest-300x170.png" alt="SSD Benchmark: palimpsest" title="palimpsest" width="300" height="170" class="aligncenter size-medium wp-image-974" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexanderkoch.net/2011/ssd-encryption-benchmark/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BeQuiet &#8211; wörtlich</title>
		<link>http://blog.alexanderkoch.net/2011/bequiet-wortlich/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=bequiet-wortlich</link>
		<comments>http://blog.alexanderkoch.net/2011/bequiet-wortlich/#comments</comments>
		<pubDate>Mon, 05 Sep 2011 21:00:37 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[hardware]]></category>
		<category><![CDATA[bequiet]]></category>
		<category><![CDATA[lüfter]]></category>
		<category><![CDATA[netzteil]]></category>

		<guid isPermaLink="false">http://blog.alexanderkoch.net/?p=947</guid>
		<description><![CDATA[Nach nun fast drei Jahren hat der Lüfter meines Netzteils (BeQuiet Dark Power Pro 750W) im unteren Drehzahlbereich hochgradig nervige Betriebsgeräusche entwickelt. Entgegen einiger Forenbeiträge ließ er sich jedoch mit etwas Basteleinsatz (Kabel trennen und neu verbinden, Klemme irgendwo unterbringen) durch einen alten Papst-Lüfter ersetzen, der hier noch rumlag.   Ergebnis: himmlische Ruhe...]]></description>
			<content:encoded><![CDATA[<p>Nach nun fast drei Jahren hat der Lüfter meines Netzteils (BeQuiet Dark Power Pro 750W) im unteren Drehzahlbereich hochgradig nervige Betriebsgeräusche entwickelt.</p>
<p>Entgegen einiger Forenbeiträge ließ er sich jedoch mit etwas Basteleinsatz (Kabel trennen und neu verbinden, Klemme irgendwo unterbringen) durch einen alten Papst-Lüfter ersetzen, der hier noch rumlag.</p>
<p><a title="Netzteil mit neuem Lüfter" href="http://blog.alexanderkoch.net/wp-content/uploads/2011/09/20110803_112315.jpg" rel="shadowbox[sbpost-947];player=img;"><img class="alignnone size-thumbnail wp-image-948" title="20110803_112315" src="http://blog.alexanderkoch.net/wp-content/uploads/2011/09/20110803_112315-150x89.jpg" alt="Netzteil mit neuem Lüfter" width="150" height="89" /></a> <a title="Alter Lüfter" href="http://blog.alexanderkoch.net/wp-content/uploads/2011/09/20110803_112327.jpg" rel="shadowbox[sbpost-947];player=img;"><img class="alignnone size-thumbnail wp-image-949" title="20110803_112327" src="http://blog.alexanderkoch.net/wp-content/uploads/2011/09/20110803_112327-150x89.jpg" alt="Alter Lüfter" width="150" height="89" /></a></p>
<p>Ergebnis: himmlische Ruhe... <img src='http://blog.alexanderkoch.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexanderkoch.net/2011/bequiet-wortlich/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DBus durchsuchen</title>
		<link>http://blog.alexanderkoch.net/2011/dbus-durchsuchen/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dbus-durchsuchen</link>
		<comments>http://blog.alexanderkoch.net/2011/dbus-durchsuchen/#comments</comments>
		<pubDate>Fri, 15 Jul 2011 16:10:58 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[howto]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[dbus]]></category>
		<category><![CDATA[exaile]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[xbindkeys]]></category>

		<guid isPermaLink="false">http://blog.alexanderkoch.net/?p=941</guid>
		<description><![CDATA[Wer den DBus durchsuchen möchte, um schnell herauszufinden, welche Calls eine bestimmte Anwendung anbietet, dem könnte DBusExplorer sehr nützliche Dienste tun. Mir hat das gerade eine Brücke zwischen xbindkeys und Exaile geliefert, um per Multimediatasten den Player zu steuern: # ~/.xbindkeysrc &#160; &#34;dbus-send --type=method_call --dest=org.exaile.Exaile /org/exaile/Exaile org.exaile.Exaile.PlayPause&#34; XF86AudioPlay &#160; &#34;dbus-send --type=method_call --dest=org.exaile.Exaile /org/exaile/Exaile org.exaile.Exaile.Next&#34; XF86AudioNext [...]]]></description>
			<content:encoded><![CDATA[<p>Wer den <a href="http://de.wikipedia.org/wiki/D-Bus" title="Wikipedia: D-Bus" target="_blank">DBus</a> durchsuchen möchte, um schnell herauszufinden, welche Calls eine bestimmte Anwendung anbietet, dem könnte <a href="http://www.ndesk.org/DBusExplorer" title="DBusExplorer Homepage" target="_blank">DBusExplorer</a> sehr nützliche Dienste tun.</p>
<p>Mir hat das gerade eine Brücke zwischen <code>xbindkeys</code> und <a href="http://www.exaile.org" title="Exaile Homepage" target="_blank">Exaile</a> geliefert, um per Multimediatasten den Player zu steuern:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># ~/.xbindkeysrc</span>
&nbsp;
<span style="color: #ff0000;">&quot;dbus-send --type=method_call --dest=org.exaile.Exaile /org/exaile/Exaile org.exaile.Exaile.PlayPause&quot;</span>
  XF86AudioPlay
&nbsp;
<span style="color: #ff0000;">&quot;dbus-send --type=method_call --dest=org.exaile.Exaile /org/exaile/Exaile org.exaile.Exaile.Next&quot;</span>
  XF86AudioNext
&nbsp;
<span style="color: #ff0000;">&quot;dbus-send --type=method_call --dest=org.exaile.Exaile /org/exaile/Exaile org.exaile.Exaile.Prev&quot;</span>
  XF86AudioPrev</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.alexanderkoch.net/2011/dbus-durchsuchen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ALSA Power Saving unter Arch</title>
		<link>http://blog.alexanderkoch.net/2011/alsa-power-saving-unter-arch/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=alsa-power-saving-unter-arch</link>
		<comments>http://blog.alexanderkoch.net/2011/alsa-power-saving-unter-arch/#comments</comments>
		<pubDate>Mon, 23 May 2011 21:59:39 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[alsa]]></category>
		<category><![CDATA[arch]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[powersaving]]></category>

		<guid isPermaLink="false">http://blog.alexanderkoch.net/?p=930</guid>
		<description><![CDATA[Nach dem Wechsel der Soundkarte zurück auf die Semi-Onboard-Lösung hatte ich ein kleines Soundproblem: kurze Sounds (Mail-Benachrichtigungen, Chat-Töne, etc.) wurden gar nicht oder nur teilweise abgespielt - es fehlten oft die ersten Millisekunden. Das Problem verursachte das aktivierte Power Saving feature des verwendeten Moduls snd_hda_intel. Hier sind zwei Parameter relevant: power_save﻿: setzt den Timeout für [...]]]></description>
			<content:encoded><![CDATA[<p>Nach dem Wechsel der Soundkarte zurück auf die Semi-Onboard-Lösung hatte ich ein kleines Soundproblem: kurze Sounds (Mail-Benachrichtigungen, Chat-Töne, etc.) wurden gar nicht oder nur teilweise abgespielt - es fehlten oft die ersten Millisekunden.</p>
<p>Das Problem verursachte das aktivierte Power Saving feature des verwendeten Moduls <code>snd_hda_intel</code>. Hier sind zwei Parameter relevant:</p>
<ul>
<li><strong><code>power_save</code>﻿:</strong> setzt den Timeout für den Power Saving Modus<br />(in Sekunden, 0=deaktiviert)</li>
<li>﻿<strong><code>power_save_controller</code>:</strong> Schaltet im Power Save auch den Controller ab<br />(Y=aktiviert, N=deaktiviert)</li>
</ul>
<p>Der zweite Parameter wird unter Arch standardmäßig auf Y gesetzt, was einen tieferen Schlaf für den Soundchip, aber auch eine dementsprechend längere Aufwachphase bewirkt. Durch Deaktivieren dieses Features konnte ich mein Problem mit den Benachrichtigungen lösen.</p>
<p>Übrigens: in der <code>/etc/conf.d/alsa</code> wird leider nicht ganz deutlich, dass über <code>﻿POWERSAVE</code> direkt der Timeout-Wert gesetzt wird, d.h. es sind auch Werte &gt;1 zulässig:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Enables powersaving mode for AC97 and hda_intel audio chips.</span>
<span style="color: #666666; font-style: italic;"># Set to 1 to enable powersaving.</span>
<span style="color: #666666; font-style: italic;"># Set to 0 to disable powersaving (default).</span>
<span style="color: #007800;">POWERSAVE</span>=<span style="color: #000000;">10</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.alexanderkoch.net/2011/alsa-power-saving-unter-arch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

