1

I don't know this is a bug or just a limitation of hard disk -- when trying to delete a lot of files (e.g. empty trash directory when it contains lot of files), everything becomes very slow!

From what I saw, everything can be defined as operations to hard disk:

  • Saving a VIM buffer to disk
  • opening a web page in browser
  • navigating in directories

Is there any solution for this? How can I prevent this problem?

My machine has 16 GB or RAM, and Intel Core i7 processor.


Relevant output:

$ cat /sys/block/[hs]d?/queue/scheduler
noop [deadline] cfq 
noop [deadline] cfq 
$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2       418G  147G  251G  37% /
none            4,0K     0  4,0K   0% /sys/fs/cgroup
udev            7,8G  4,0K  7,8G   1% /dev
tmpfs           1,6G  1,1M  1,6G   1% /run
none            5,0M     0  5,0M   0% /run/lock
none            7,8G   42M  7,8G   1% /run/shm
none            100M   64K  100M   1% /run/user
/dev/sda1       487M  3,4M  483M   1% /boot/efi

My hard disk has the following specs:

  • Type HDD
  • 750GB
  • HDD Rotation speed 7200RPM
  • HDD Interface SATA II
10
  • Which file system(s) and which mount flags do you use? Sep 23, 2014 at 7:47
  • @DavidFoerster What do you mean? :-) I just pressed Empty button in Trash directory, using Nautiulus. But this happens when I do rm -rf lot-of-files. Sep 23, 2014 at 7:51
  • I forgot one: which CPU and I/O scheduler(s) do you use? All of those factors have a large impact on how fast file deletion will be on your system. In addition the schedulers influences how much other applications will be affected by I/O intense operations. Do you know how to answer these questions or do you need help with that? Sep 23, 2014 at 7:55
  • How can I find what I/O scheduler(s) I use? Sep 23, 2014 at 7:58
  • Like this: cat /sys/block/[hs]d?/queue/scheduler. The mount flags can be observed in the output of mount. Sep 23, 2014 at 8:02

1 Answer 1

1

It may help to switch to the CFQ scheduler, because it is more optimised towards rotational media:

echo -n cfq | sudo tee /sys/block/[hs]d?/queue/scheduler > /dev/null

You can benchmark file system performance with IOzone (package name iozone3).

More on the CFQ scheduler

3
  • Can you explain a little what is a CFQ scheduler? How can I test if everything worked fine? Sep 24, 2014 at 13:33
  • I leave the explaining to other people and added some links to articles about CFQ. Sep 24, 2014 at 21:07
  • Can you take a look at this question too? It seems to be related to HDD operations. Oct 26, 2014 at 8:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .