Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Package (un)installation on a Debian system is horribly slow, partly because it works with a whole bunch of (small) files. Short of getting faster storage, how do I speed it up? I'm thinking maybe loading some highly-accessed directory onto RAM as one solution, but how do I do that? Is there a 'better' solution?

share|improve this question
    
What filesystem, and how many packages do you have? For large directories, ext3 or above with the dir_index option, or Reiser, is a dramatic improvement compared to ext2 or ext3 without dir_index. –  Gilles Feb 24 '11 at 21:31
    
@Gilles I use ext4 and have ~1400 packages installed. –  Tshepang Feb 24 '11 at 21:39

1 Answer 1

For this solution you are going to need a version of dpkg of at least 1.15.8.6.

Since that version of dpkg, there is a new force-unsafe-io option that will disable dpkg from calling sync() and the like between every package. You can add this option to the config in /etc/dpkg so that it is always in effect.

If you have an older version of dpkg you can alternatively use eatmydata.

And remember both of these solutions are unsafe and probably will lead to data loss if there is a power failure while or shortly after dpkg is running.

share|improve this answer
    
So, I just add force-unsafe-io to /etc/dpkg/dpkg.cfg, and that's it? –  Tshepang Feb 11 '11 at 16:48
    
I don't have a working linux box currently (PSU failure) but echo "force-unsafe-io" > /etc/dpkg/dpkg.cfg.d/force-unsafe-io should work. Or you can add it to the main dpkg config file which I think is /etc/dpkg/dpkg.cfg. –  Arrowmaster Feb 11 '11 at 16:51
    
I timed it with and without this option, and there was no noticeable change in performance. –  Tshepang Feb 28 '11 at 18:18
    
Did you try it with eatmydata? Additionally when I started using the force-unsafe-io option inside my pbuilder chroots, I remember a very noticeable difference. –  Arrowmaster Feb 28 '11 at 23:46
    

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.