[Guillem Jover]
> Hi!

Hi. :)

> You asked in the past why the current implementation is the way it
> is. A quick summary would be that, [...]

Thank you for the explanation. :)

> You should either clear the kernel cache or reboot on each iteration
> to try to get a similar initial state. The former can be done with
> something like:
> 
>   sudo sh -c 'sync && echo 3 > /proc/sys/vm/drop_caches'

Good point.  I did some more testing with such flushing in place, and
tried a bit with different ordering too, and got this result
installing the kde-full package and dependences (around 1700
packages):


Fri Sep 19 10:39:48 CEST 2014 used: 576 dpkg_conf
Fri Sep 19 10:49:09 CEST 2014 used: 558 divert
Fri Sep 19 11:01:33 CEST 2014 used: 741 default

Fri Sep 19 11:14:08 CEST 2014 used: 556 dpkg_conf
Fri Sep 19 11:23:28 CEST 2014 used: 557 divert
Fri Sep 19 11:37:57 CEST 2014 used: 866 default

Fri Sep 19 12:11:27 CEST 2014 used: 930 default
Fri Sep 19 12:20:54 CEST 2014 used: 564 divert
Fri Sep 19 12:30:21 CEST 2014 used: 564 dpkg_conf

Fri Sep 19 15:24:50 CEST 2014 used: 805 default
Fri Sep 19 15:34:15 CEST 2014 used: 562 divert
Fri Sep 19 15:43:40 CEST 2014 used: 562 dpkg_conf

The machine had 100Mbit/s to the mirror, so most of the time is spent
unpacking.  The speedup seem to be significant, in the range two to
three minutes for this set of packages.

Also, this indicate that using eatmydata for dpkg is enough to get
most of the advantage, and that using it for apt-get do not gain much
extra speedup.  Adding a wrapper and configuring Dir::Bin::dpkg to
call it might be seen as less intrusive than the dpkg-divert method.

> You might also want to try with the attached dpkg patch which should
> disable all fsync() calls in the main dpkg program, to see how the
> rest of the system affects your performance, besides dpkg itself.

Will try to find time to do this later.:)

This is the script I use for testing now.

----------------------------------------------------------------------------------------
#!/bin/sh

set -e

suite=testing
chroot=chroot-testing
#mirror=http://http.debian.net/debian
mirror=http://ftp.uio.no/debian

unset TMP TMPDIR TEMP TEMPDIR

# Never wait for input
DEBIAN_FRONTEND=noninteractive
export DEBIAN_FRONTEND

info() { echo info: "$@" ; }
error() { echo error: "$@" ; }

make_chroot() {
    debootstrap $suite $chroot $mirror
    printf "#!/bin/sh\nexit 101\n" > $chroot/usr/sbin/policy-rc.d
    chmod a+rx $chroot/usr/sbin/policy-rc.d
    chroot $chroot apt-get install -y eatmydata
}

install_chroot_pkgs() {
    chroot $chroot apt-get install  -o APT::Acquire::Retries=3 -y kde-full
}

test_default() {
    make_chroot
    install_chroot_pkgs
}

test_divert() {
    make_chroot
        for bin in dpkg apt-get aptitude tasksel ; do
            file=/usr/bin/$bin
            # Test that the file exist and have not been diverted already.
            if [ -f $chroot/usr/bin/$bin ] ; then
                info "diverting /usr/bin/$bin using eatmydata"
                printf "#!/bin/sh\neatmydata $bin.distrib \"\$@\"\n" \
                    > $chroot/usr/bin/$bin.edu
                chmod 755 $chroot/usr/bin/$bin.edu
                chroot $chroot dpkg-divert --package debian-edu-config \
                    --rename --quiet --add /usr/bin/$bin
                ln -sf ./$bin.edu $chroot/usr/bin/$bin
            else
                error "unable to divert /usr/bin/$bin, as it is missing."
            fi
        done
  
    install_chroot_pkgs
}

# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=613428
test_dpkg_conf() {
    make_chroot
    cat > $chroot/usr/bin/dpkg-eatmydata <<'EOF'
#!/bin/sh
/usr/bin/eatmydata /usr/bin/dpkg "$@"
EOF
    chmod a+rx $chroot/usr/bin/dpkg-eatmydata

    cat > $chroot/etc/apt/apt.conf.d/dpkg-eatmydata <<EOF
Dir::Bin::dpkg "/usr/bin/dpkg-eatmydata";
EOF
    install_chroot_pkgs
}

info "Logging to run-$suite.log"
exec < /dev/null > run-$suite.log 2>&1

for f in \
   default \
   divert \
   dpkg_conf
do
    rm -rf "$chroot"
    echo
    echo "Testing $f"
    echo
    sync && echo 3 > /proc/sys/vm/drop_caches
    start=$(date +%s)
    test_$f
    end=$(date +%s)
    (LC_ALL=C date; echo "used: $(($end - $start)) $f" ) >> test.log
done
echo
tail test.log
----------------------------------------------------------------------------------------

-- 
Happy hacking
Petter Reinholdtsen


-- 
To UNSUBSCRIBE, email to debian-dpkg-bugs-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to