<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
     xmlns:atom="http://www.w3.org/2005/Atom"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:wfw="http://wellformedweb.org/CommentAPI/"
     >
  <channel>
    <title>Where am I?</title>
    <link>http://blakeley.com/blogofile</link>
    <description>Performance, scalability, databases, and whatever comes up.</description>
    <pubDate>Fri, 07 Jul 2023 19:44:55 GMT</pubDate>
    <generator>Blogofile</generator>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>rsyslog and MarkLogic</title>
      <link>http://blakeley.com/blogofile/2012/05/17/rsyslog-and-marklogic</link>
      <pubDate>Thu, 17 May 2012 18:00:01 UTC</pubDate>
      <category><![CDATA[MarkLogic]]></category>
      <category><![CDATA[Linux]]></category>
      <guid isPermaLink="true">http://blakeley.com/blogofile/2012/05/17/rsyslog-and-marklogic</guid>
      <description>rsyslog and MarkLogic</description>
      <content:encoded><![CDATA[<p>You probably know that MarkLogic Server logs important events
to the <code>ErrorLog.txt</code> file. By default it logs events at <code>INFO</code> or higher,
but many development and staging environments change the <code>file-log-level</code>
to <code>DEBUG</code>. These log levels are also available to the <code>xdmp:log</code> function,
and some of your XQuery code might use that for <code>printf</code>-style debugging.</p>
<p>You might even know that MarkLogic also sends important events
to the operating system. On linux this means <code>syslog</code>, and important events
are those at <code>NOTICE</code> and higher by default.</p>
<p>But are you monitoring these events?</p>
<p>How can you set up your MarkLogic deployment so that it will automatically
alert you to errors, warnings, or other important events?</p>
<p>Most linux deployments now use <code>rsyslog</code> as their system logging facility.
The <a href="http://www.rsyslog.com/doc/manual.html">full documentation</a> is available,
but this brief tutorial will show you how to set up email alerts for MarkLogic
using <code>rsyslog</code> version 4.2.6.</p>
<p>All configuration happens in <code>/etc/rsyslog.conf</code>.
Here is a sample of what we need for email alerts.
First, at the top of the file you should see several <code>ModLoad</code> declarations.
Check for <code>ommail</code> and add it if needed.</p>
<pre><code>$ModLoad ommail.so  # email support
</code></pre>
<p>Next, add a stanza for MarkLogic somewhere after the <code>ModLoad</code> declaration.</p>
<pre><code># MarkLogic
$template MarkLogicSubject,"Problem with MarkLogic on %hostname%"
$template MarkLogicBody,"rsyslog message from MarkLogic:\r\n[%timestamp%] %app-name% %pri-text%:%msg%"
$ActionMailSMTPServer 127.0.0.1
$ActionMailFrom your-address@your-domain
$ActionMailTo your-address@your-domain
$ActionMailSubject MarkLogicSubject
#$ActionExecOnlyOnceEveryInterval 3600
daemon.notice   :ommail:;MarkLogicBody
</code></pre>
<p>Be sure to replace both instances of <code>your-address@your-domain</code>
with an appropriate value. The ActionMailSMTPServer must be smart enough
to deliver email to that address. I used a default <code>sendmail</code> configuration
on the local host, but you might choose to connect to a different host.</p>
<p>Note that I have commented out the <code>ActionExecOnlyOnceEveryInterval</code> option.
The author of <code>rsyslog</code>, <a href="http://www.gerhards.net/rainer">Rainer Gerhards</a>,
recommends setting this value to a reasonably high number of seconds
so that your email inbox is not flooded with messages.
However, the <code>rsyslog</code> documentation states that excess messages
are discarded, and I did not want to lose any important messages.
What I would really like to do is buffer messages for N seconds at a time,
and merge them together in one email.
But while <code>rsyslog</code> has many features, and does offer buffering,
it does not seem to know how to combine consecutive messages
into a single email.</p>
<p>Getting back to what <code>rsyslog</code> <em>can</em> do,
you can customize the subject and body of the mail message.
With the configuration above, a restart of the server
might send you an email like this one:</p>
<pre><code>Subject: Problem with MarkLogic on myhostname.mydomain

rsyslog message from MarkLogic:
[May 17 23:58:36] MarkLogic daemon.notice&lt;29&gt;: Starting MarkLogic Server 5.0-3 i686 in /opt/MarkLogic with data in /var/opt/MarkLogic
</code></pre>
<p>When making any <code>rsyslog</code> changes, be sure to restart the service:</p>
<pre><code>sudo service rsyslog restart
</code></pre>
<p>At the same time, check your system log for any errors or typos.
This is usually <code>/var/log/messages</code> or <code>/var/log/syslog</code>.
The full documentation for <a href="http://www.rsyslog.com/doc/property_replacer.html">template substitution properties
</a> is online.
You can also read about a wealth of other options available in <code>rsyslog</code>.</p>]]></content:encoded>
    </item>
    <item>
      <title>AWS and High-CPU Instances</title>
      <link>http://blakeley.com/blogofile/archives/558</link>
      <pubDate>Mon, 04 Jul 2011 09:52:16 UTC</pubDate>
      <category><![CDATA[Performance]]></category>
      <category><![CDATA[AWS]]></category>
      <category><![CDATA[Linux]]></category>
      <guid>http://blakeley.com/blogofile/archives/558</guid>
      <description>AWS and High-CPU Instances</description>
      <content:encoded><![CDATA[
When AWS EC2 tells you that "requested instance type (cc1.4xlarge) is not supported in your requested Availability Zone (us-east-1b)", what they really mean is that you are using the wrong AMI. Switch to an HVM AMI. This enables support within Xen for Hardware Virtual Machine (HVM), using AMD SVM or Intel VT-x instructions.<br/><br/>
]]></content:encoded>
    </item>
    <item>
      <title>IPv6 Day</title>
      <link>http://blakeley.com/blogofile/archives/551</link>
      <pubDate>Tue, 07 Jun 2011 12:33:50 UTC</pubDate>
      <category><![CDATA[home]]></category>
      <category><![CDATA[Linux]]></category>
      <guid>http://blakeley.com/blogofile/archives/551</guid>
      <description>IPv6 Day</description>
      <content:encoded><![CDATA[
<p>
<a href="http://en.wikipedia.org/wiki/World_IPv6_Day">Tomorrow's event</a>
prodded me into setting up IPv6 at home, where I use
<a href="http://openwrt.org/">openwrt</a>. The
<a href="https://wiki.xkyle.com/Comcast_IPv6_on_Openwrt">tutorial</a>
I found was helpful: I just had to change the interface names. On my
system eth0.1 was eth1, and 6rdtun was called 6to4.
<a href="http://test-ipv6.comcast.net/">Comcast's test page</a>
says I'm up and working. I can see the
<a href="http://ismyipv6working.com/">unicorn</a> too.
</p>
<p>
Visit to <a href="http:// ipv6-test.net/">ipv6-test.net</a> for more tests.
</p>
]]></content:encoded>
    </item>
    <item>
      <title>LWN article on impact of hugepages</title>
      <link>http://blakeley.com/blogofile/archives/547</link>
      <pubDate>Tue, 22 Feb 2011 07:15:41 UTC</pubDate>
      <category><![CDATA[Performance]]></category>
      <category><![CDATA[Linux]]></category>
      <guid>http://blakeley.com/blogofile/archives/547</guid>
      <description>LWN article on impact of hugepages</description>
      <content:encoded><![CDATA[
<p>
Part 5 in a series by Mel Gorman describes how to <a href="http://lwn.net/Articles/379748/">measure the potential benefit from hugepages</a>. The results match up reasonably well with CPU-intensive synthetic benchmarks on linux, which tend to show 10-15% improvement over ordinary pages.
</p>
<p>
The larger impact may be to application environments under heavy memory pressure. The OS can swap everything else out, but hugepage allocations are pinned. This is a double-edged sword. Preventing swapping may benefit some environments (cf vm.swappiness). But imagine a situation where you have 8-GB RAM and designate 4-GB for huge pages, but only use 2-GB. Now the OS has only 4-GB to manage, and the free 2-GB in huge pages are effectively wasted. If the system comes under memory pressure, that could lead to swapping or activate the OOM killer.
</p>
]]></content:encoded>
    </item>
    <item>
      <title>IPv6</title>
      <link>http://blakeley.com/blogofile/archives/544</link>
      <pubDate>Mon, 24 Jan 2011 15:21:07 UTC</pubDate>
      <category><![CDATA[home]]></category>
      <category><![CDATA[Linux]]></category>
      <guid>http://blakeley.com/blogofile/archives/544</guid>
      <description>IPv6</description>
      <content:encoded><![CDATA[
<p>
It wasn't rocket surgery, but blakeley.com now has an
<a href="http://book.xen.prgmr.com/mediawiki/index.php/Setting_up_IPv6">IPv6 stack</a>
and an AAAA record.
If <a href="http://ipv6-test.com/validate.php">http://ipv6-test.com/validate.php</a>
can be believed, it even works. I had more trouble finding a
server-side test tool than I had with the configuration.
</p>
<p>
<a href="http://ipv6-test.com/validate.php?url=referer"><img src="http://ipv6-test.com/button-ipv6-big.png" border="0"/></a>
</p>
]]></content:encoded>
    </item>
    <item>
      <title>DSH - distributed shell for cluster administration</title>
      <link>http://blakeley.com/blogofile/archives/539</link>
      <pubDate>Tue, 07 Dec 2010 16:10:32 UTC</pubDate>
      <category><![CDATA[Linux]]></category>
      <guid>http://blakeley.com/blogofile/archives/539</guid>
      <description>DSH - distributed shell for cluster administration</description>
      <content:encoded><![CDATA[
<p>
I noticed this in the github pull requests for homebrew, and thought
it looked interesting. We've all written a script that sends a
command-line out to N hosts, right?
<a
 href="http://www.netfort.gr.jp/~dancer/software/dsh.html.en">Dancer's Shell</a>
looks like a nice way to automate that. It lets you place
hosts in groups, and send commands to a group of hosts. The next time
I need to work with a cluster, I'm planning to delve into this and see
if it helps.
</p>
]]></content:encoded>
    </item>
    <item>
      <title>Is HP fixing their linux cpufreq problems?</title>
      <link>http://blakeley.com/blogofile/archives/265</link>
      <pubDate>Thu, 30 Nov 2006 15:30:33 UTC</pubDate>
      <category><![CDATA[Linux]]></category>
      <guid>http://blakeley.com/blogofile/archives/265</guid>
      <description>Is HP fixing their linux cpufreq problems?</description>
      <content:encoded><![CDATA[
It looks like HP has released a bios update for the <a href="http://forums1.itrc.hp.com/service/forums/bizsupport/questionanswer.do?threadId=1075649">nx7400</a>, which fixes the cpufreq problems with linux. Hopefully that means that an update for the nc6400 is coming soon.<br/><br/>
]]></content:encoded>
    </item>
    <item>
      <title>HP nc6400: 64-bit thrills and chills</title>
      <link>http://blakeley.com/blogofile/archives/260</link>
      <pubDate>Fri, 13 Oct 2006 16:04:24 UTC</pubDate>
      <category><![CDATA[MarkLogic]]></category>
      <category><![CDATA[Linux]]></category>
      <guid>http://blakeley.com/blogofile/archives/260</guid>
      <description>HP nc6400: 64-bit thrills and chills</description>
      <content:encoded><![CDATA[
Out goes a three-year old Dell D600 laptop - in comes a new HP nc6400. So far this has been both good and bad.
<br/><br/>
The D600 was very, very old for a laptop: in three years we replaced the motherboard twice, the hard drive twice, and the keyboard once. On the bright side, practically everything about the laptop actually worked under <a href="http://kubuntu.org/">kubuntu</a> dapper and edgy. Even the closed-source Broadcom wifi worked reasonably well, thanks to <a href="http://ndiswrapper.sf.net/">ndiswrapper</a> (the open-source bcm44xx driver was never reliable for me). Hibernate and suspend-to-RAM both worked pretty well.
<br/><br/>
The new nc6400 looks very nice: from a distance you could mistake it for a Thinkpad. The screen is a downgrade (1280x800 instead of the D600's 1440x1050), but the laptop is noticeably lighter. The real reason to upgrade, though, was the CPU: it has a 2.0-GHz T7200 - one of Intel's new EM64T-capable "merom" or "Core 2 Duo" chips. EM64T is Intel's take on AMD's "AMD64" extensions: either branding extends the x86 instruction set to allow for 64-bit native mode.
<br/><br/>
If you've used MarkLogic Server, you know how much we like AMD Opteron CPUs. Yes, they're very fast - but the real reason is the 64-bit support. Now that Intel is shipping more EM64T chips, there's no excuse for 32-bit address spaces, anymore.
<br/><br/>
Except that... Windows hasn't caught up yet. And honestly, neither has linux. It's easy to run a 64-bit linux server, and only moderately harder to find all the 64-bit Windows drivers for your server hardware. But desktops are harder: Windows x64 might not support your sound card, for example.
<br/><br/>
Laptops? Only for the brave. The laptop makers seem to know this, and none of them are hyping their 64-bit support. My nc6400 came with Windows XP 32-bit pre-installed.
<br/><br/>
There's a good argument behind this. The laptop "only" has 2-GB of RAM, so you could argue that it would work fine in 32-bit mode. For MS Office or Firefox, that's absolutely true. But with MarkLogic Server, memory fragmentation turns out to be at least as important as memory size. In a 32-bit environment, it's pretty easy to chop up the 2-GB or 3-GB address space so badly that the software (or even the OS) has to be restarted. I've never seen this happen in 64-bit mode, simply because the address space is so huge.
<br/><br/>
So I unpacked the nc6400, booted from a recent kubuntu "edgy" CD for amd64, and got to work. I shrank the XP partition to 20-GB, on an 80-GB disk, and installed linux on the rest. Note to the unwary: ntfsresize rightly insists on a clean unmount of your NTFS partition, before it will do any resizing. Apparently XP doesn't cleanly unmount when it <em>restarts</em>: you must <em>shut down</em> XP, instead.
<br/><br/>
The install went pretty smoothly. The nc6400 has an Intel  3945 wifi card, so I don't need ndiswrapper anymore. I had some trouble with the widescreen resolution (1280x800), but that's to be expected right now.
<br/><br/>
So what's the bad news? Well, it looks like HP really messed up the bios (F.05) when they added support for the Core 2 Duo CPUs. I noticed this fairly quickly with my new linux install: the CPU temperatures, as reported by /proc/acpi/thermal_zone, were hitting 95-C. The fans seemed to run at three speeds: the medium-speed fan would run until the temp hit 95-C, then a higher-speed fan would take it down to 85-C, and then the temperature would start to climb again. This made the laptop uncomfortably hot, and very loud.
<br/><br/>
After more investigation, it appeared that the cpufreq module wouldn't load, so the CPU was running both cores at full speed. Naturally, this generates a lot of heat. <a href="http://bugzilla.kernel.org/show_bug.cgi?id=7157">Reports</a> indicate that  the last bios rev (F.03) work fine with cpufreq, but that older bios won't work with my T7200 CPU. So I'm stuck, until and unless HP fixes the problem in a future bios update.
<br/><br/>
Judging by other reports on the net, HP's round of merom-related BIOS releases removed the ACPI-based CPU frequency scaling tables from <strong>every</strong>  laptop product that supports merom CPUs. The same change doesn't seem to affect Windows XP: apparently XP ships with its own CPU frequency scaling tables, instead of expecting the bios to supply them. Conspiracy theorists might ask if this was done on purpose, but I think it's just a bug. Time (and HP's next BIOS release) will tell: after all, my old D600 didn't hibernate properly with linux until Dell had released about 10 BIOS updates.
<br/><br/>
As a workaround, I used the BIOS setup screen to disable the CPU's second core. So I still don't have frequency scaling, and my laptop is only using half of its capacity, but at least it isn't overheating. The CPU temperature is fairly stable at 55-C. The battery life probably suffers, though: I'm only seeing about 90-min from the internal battery.<br/><br/>
]]></content:encoded>
    </item>
  </channel>
</rss>
