[collectd] dpkg stalling on a loaded collectd aggregator

Trent W. Buck twb-mailman-collectd at cyber.com.au
Mon Jul 4 03:51:17 CEST 2011


> I think I am running into the same problem as described here.
> http://administratosphere.wordpress.com/2011/05/13/linux-kernel-sync-bug/

I see you already mentioned force-unsafe-io; here's my notes on the
issue (encountered with a dozen LXC VMs which, sharing a kernel, all
get synced together).


This is because dpkg agressively flushes itself to disk.  This is
especially prevalent in the Ubuntu 10.04 version, which calls sync
instead of fsync because "fsync is too slow" or some such bullshit.

The problem first arose ca. 1.15.5.6ubuntu2.  Current versions have
--force-unsafe-io to get the old behaviour, which you can put in
dpkg.cfg (sans leading hyphens); they should also behave substantially
better even without this.

As force-unsafe-io is absent from 10.04, one must grab eatmydata (from a
later release) and replace dpkg with a wrapper that uses it:

    aptitude install eatmydata -yq
    dpkg-divert --rename /usr/bin/dpkg
    cat >/usr/bin/dpkg <<EOT && chmod +x /usr/bin/dpkg
    #!/bin/sh
    exec eatmydata /usr/bin/dpkg.distrib "\$@"
    EOT



More information about the collectd mailing list