Debian Bug report logs - #588254
please allow to disable extremely slow fsync/sync at runtime

version graph

Package: dpkg; Maintainer for dpkg is Dpkg Developers <debian-dpkg@lists.debian.org>; Source for dpkg is src:dpkg.

Reported by: Modestas Vainius <modestas@vainius.eu>

Date: Tue, 6 Jul 2010 14:36:02 UTC

Severity: normal

Merged with 584254

Found in versions dpkg/1.15.6, dpkg/1.15.7.2

Fixed in version dpkg/1.15.8.6

Done: Guillem Jover <guillem@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#588254; Package dpkg. (Tue, 06 Jul 2010 14:36:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Modestas Vainius <modestas@vainius.eu>:
New Bug report received and forwarded. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Tue, 06 Jul 2010 14:36:04 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Modestas Vainius <modestas@vainius.eu>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: please allow to disable extremely slow fsync/sync at runtime
Date: Tue, 06 Jul 2010 17:31:46 +0300
Package: dpkg
Version: 1.15.7.2
Severity: normal

Hello,

first of all, I'm fully aware of [1] and [2]. However, solution implemented in
#578635 is not good enough and slows down dpkg considerably on ext4 and even
twice as much on btrfs [3]. So it is pretty clear that dpkg is not ready for
the age of modern file systems. I personally find performance after #578635
almost acceptable on my main / where I definitely don't want it to produce
zero-length files but dpkg has other use cases where such a slow down is not
acceptable for the benefit it brings.

For example, sometimes zero-length files after unclean shutdown are not critical
but barely minor problem. One of them is chroots, esp. buildd ones. sbuild and
pbuilder install the same packages over and over again in the (copies of) the
chroot and slow dpkg performance takes much developer time even on new fast
machines. However, in case of power failure, it is not important what happens
to that (copy of) the chroot and how many zero-length files dpkg is going to
leave it with. The (copy of) the chroot will either be `rm -rf` or fixed
manually anyway.  So huge dpkg slowdown is for no benefit at all in this case,
it only wastes developer time and considerably prolongs package build time.

What is more, frequent sync()s (#578635), obviously, affect ext3 and other file
systems as well esp. when there is much other parallel disk I/O going on at the
same time.

Therefore, I would like to be able to effectively disable fsync()/sync() at
runtime via dpkg command line switch and alternatively, via entry in
/etc/dpkg/dpkg.conf (yes, this includes fsync() calls on database updates, as
they are the major source of slow down as well). Of course, it would be even
better if dpkg itself were fixed to be crash-tolerant and fast on the file
systems with delayed allocation, but it seems that it is not going to be easy
to implement.

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=578635
[2] https://bugzilla.kernel.org/show_bug.cgi?id=15910
[3] nosync.c:

void sync() { }
int fsync(int fildes) { return 0; }

$ gcc -shared -fPIC -O2 -g nosync.c -o libnosync.so

--------------------------------------------------------------------
On the BTRFS file system:

# unset LD_PRELOAD
# time apt-get -y build-dep kde4libs
The following NEW packages will be installed:
  adduser automoc bison bsdmainutils ca-certificates cdbs cmake cmake-data comerr-dev debhelper emacsen-common file flex fontconfig
  fontconfig-config gettext gettext-base groff-base hspell html2text intltool-debian krb5-multidev libacl1-dev libasound2 libasound2-dev
  libaspell-dev libaspell15 libasyncns0 libattica-dev libattica0 libattr1-dev libaudio2 libavahi-client3 libavahi-common-data
  libavahi-common-dev libavahi-common3 libbz2-dev libcap2 libclucene0ldbl libcroco3 libcups2 libcups2-dev libcurl3-gnutls libdbus-1-3
  libdbus-1-dev libdbus-glib-1-2 libdrm2 libeggdbus-1-0 libenchant-dev libenchant1c2a libexiv2-6 libexpat1 libfam-dev libfam0 libflac8
  libfontconfig1 libfreetype6 libgcrypt11 libgcrypt11-dev libgif-dev libgif4 libgl1-mesa-dev libgl1-mesa-glx libglib2.0-0 libglib2.0-dev
  libglu1-mesa libglu1-mesa-dev libgnutls-dev libgnutls26 libgpg-error-dev libgpg-error0 libgssapi-krb5-2 libgssrpc4 libhunspell-1.2-0
  libice-dev libice6 libidn11 libilmbase-dev libilmbase6 libiodbc2 libjasper-dev libjasper1 libjpeg62 libjpeg62-dev libk5crypto3
  libkadm5clnt-mit7 libkadm5srv-mit7 libkdb5-4 libkeyutils-dev libkeyutils1 libkrb5-3 libkrb5-dev libkrb5support0 liblcms1 libldap-2.4-2
  liblzma-dev libmagic1 libmng1 libncursesw5 libogg0 libopenexr-dev libopenexr6 libpcre3 libpcre3-dev libpcrecpp0 libphonon-dev libphonon4
  libpng12-0 libpng12-dev libpolkit-agent-1-0 libpolkit-gobject-1-0 libpolkit-qt-1-0 libpolkit-qt-1-dev libpopt0 libpthread-stubs0
  libpthread-stubs0-dev libpulse-mainloop-glib0 libpulse0 libqca2 libqca2-dev libqt4-assistant libqt4-dbus libqt4-designer libqt4-dev
  libqt4-help libqt4-multimedia libqt4-network libqt4-opengl libqt4-opengl-dev libqt4-qt3support libqt4-script libqt4-scripttools
  libqt4-sql libqt4-svg libqt4-test libqt4-webkit libqt4-xml libqt4-xmlpatterns libqtcore4 libqtgui4 libraptor1 librasqal2 librdf0
  libsasl2-2 libsm-dev libsm6 libsndfile1 libsoprano-dev libsoprano4 libsqlite3-0 libssl-dev libssl0.9.8 libstreamanalyzer-dev
  libstreamanalyzer0 libstreams-dev libstreams0 libtasn1-3 libtasn1-3-dev libtiff4 libunistring0 libutempter-dev libutempter0 libvorbis0a
  libvorbisenc2 libwrap0 libx11-6 libx11-data libx11-dev libxau-dev libxau6 libxcb1 libxcb1-dev libxcursor-dev libxcursor1 libxdamage1
  libxdmcp-dev libxdmcp6 libxext-dev libxext6 libxfixes-dev libxfixes3 libxi-dev libxi6 libxml2 libxml2-dev libxml2-utils libxrender-dev
  libxrender1 libxslt1-dev libxslt1.1 libxss-dev libxss1 libxt6 libxtst-dev libxtst6 libxxf86vm1 m4 man-db mesa-common-dev openssl
  pkg-config pkg-kde-tools po-debconf procps qt4-qmake shared-desktop-ontologies shared-mime-info soprano-daemon ttf-dejavu-core ucf
  x11-common x11proto-core-dev x11proto-fixes-dev x11proto-input-dev x11proto-kb-dev x11proto-record-dev x11proto-render-dev
  x11proto-scrnsaver-dev x11proto-xext-dev xsltproc xtrans-dev zlib1g-dev
0 upgraded, 222 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/92.5MB of archives.
After this operation, 273MB of additional disk space will be used.
...
real    12m35.082s
user    0m6.760s
sys     0m14.969s

# time dpkg -P <222 kde4libs build-depends>
...
real    11m21.294s
user    0m2.488s
sys     0m9.305s


# export LD_PRELOAD=libnosync.so
# time apt-get -y build-dep kde4libs
...
real    0m31.748s
user    0m6.496s
sys     0m6.576s

# time dpkg -P <222 kde4libs build-depends>
...
real    0m11.788s
user    0m2.160s
sys     0m2.732s

nosync version is ~24 / 60 times faster.
--------------------------------------------------------------------
On the ext4 file system:

# unset LD_PRELOAD
# time apt-get -y build-dep kde4libs
...
real    6m38.181s
user    0m7.328s
sys     0m6.816s

# time dpkg -P <222 kde4libs build-depends>
...
real    4m49.146s
user    0m2.504s
sys     0m2.020s

# export LD_PRELOAD=libnosync.so
# time apt-get -y build-dep kde4libs
...
real    0m34.390s
user    0m6.888s
sys     0m4.816s

# time dpkg -P <222 kde4libs build-depends>
...
real    0m10.010s
user    0m2.072s
sys     0m1.564s

nosync version is ~11 / 34 times faster.
--------------------------------------------------------------------

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (101, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.35-rc4 (SMP w/4 CPU cores)
Locale: LANG=lt_LT.UTF-8, LC_CTYPE=lt_LT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages dpkg depends on:
ii  coreutils         8.5-1                  GNU core utilities
ii  libbz2-1.0        1.0.5-4                high-quality block-sorting file co
ii  libc6             2.11.2-2               Embedded GNU C Library: Shared lib
ii  libselinux1       2.0.94-1               SELinux runtime shared libraries
ii  xz-utils          4.999.9beta+20100527-1 XZ-format compression utilities
ii  zlib1g            1:1.2.3.4.dfsg-3       compression library - runtime

dpkg recommends no packages.

Versions of packages dpkg suggests:
ii  apt                           0.7.25.3   Advanced front-end for dpkg

-- no debconf information




Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#588254; Package dpkg. (Tue, 06 Jul 2010 15:42:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan Nieder <jrnieder@gmail.com>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Tue, 06 Jul 2010 15:42:03 GMT) Full text and rfc822 format available.

Message #10 received at 588254@bugs.debian.org (full text, mbox):

From: Jonathan Nieder <jrnieder@gmail.com>
To: Modestas Vainius <modestas@vainius.eu>, 588254@bugs.debian.org
Subject: Re: please allow to disable extremely slow fsync/sync at runtime
Date: Tue, 6 Jul 2010 10:38:53 -0500
# Modestas Vainius wrote:
#
# > first of all, I'm fully aware of [1] and [2].
# > [1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=578635
# > [2] https://bugzilla.kernel.org/show_bug.cgi?id=15910
#
# Ah, but are you aware of 584254? :)

merge 584254 588254
quit




Merged 584254 588254. Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Tue, 06 Jul 2010 15:42:05 GMT) Full text and rfc822 format available.

Added tag(s) pending. Request was from Guillem Jover <guillem@debian.org> to control@bugs.debian.org. (Thu, 25 Nov 2010 06:54:10 GMT) Full text and rfc822 format available.

Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Wed, 05 Jan 2011 07:35:27 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Apr 23 17:13:36 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.