Gentoo Archives: gentoo-user

From: Michael Hampicke <mgehampicke@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Fast file system for cache directory with lot's of files
Date: Mon, 13 Aug 2012 18:21:17
Message-Id: 502944F0.3070303@gmail.com
In Reply to: Re: [gentoo-user] Fast file system for cache directory with lot's of files by Florian Philipp
1 Am 13.08.2012 19:14, schrieb Florian Philipp:
2 > Am 13.08.2012 16:52, schrieb Michael Mol:
3 >> On Mon, Aug 13, 2012 at 10:42 AM, Michael Hampicke
4 >> <mgehampicke@×××××.com <mailto:mgehampicke@×××××.com>> wrote:
5 >>
6 >> Have you indexed your ext4 partition?
7 >>
8 >> # tune2fs -O dir_index /dev/your_partition
9 >> # e2fsck -D /dev/your_partition
10 >>
11 >> Hi, the dir_index is active. I guess that's why delete operations
12 >> take as long as they take (index has to be updated every time)
13 >>
14 >>
15 >> 1) Scan for files to remove
16 >> 2) disable index
17 >> 3) Remove files
18 >> 4) enable index
19 >>
20 >> ?
21 >>
22 >> --
23 >> :wq
24 >
25 > Other things to think about:
26 >
27 > 1. Play around with data=journal/writeback/ordered. IIRC, data=journal
28 > actually used to improve performance depending on the workload as it
29 > delays random IO in favor of sequential IO (when updating the journal).
30 >
31 > 2. Increase the journal size.
32 >
33 > 3. Take a look at `man 1 chattr`. Especially the 'T' attribute. Of
34 > course this only helps after re-allocating everything.
35 >
36 > 4. Try parallelizing. Ext4 requires relatively few locks nowadays (since
37 > 2.6.39 IIRC). For example:
38 > find $TOP_DIR -mindepth 1 -maxdepth 1 -print0 | \
39 > xargs -0 -n 1 -r -P 4 -I '{}' find '{}' -type f
40 >
41 > 5. Use a separate device for the journal.
42 >
43 > 6. Temporarily deactivate the journal with tune2fs similar to MM's idea.
44 >
45 > Regards,
46 > Florian Philipp
47 >
48
49 Trying out different journals-/options was already on my list, but the
50 manpage on chattr regarding the T attribute is an interesting read.
51 Definitely worth trying.
52
53 Parallelizing multiple finds was something I already did, but the only
54 thing that increased was the IO wait :) But now having read all the
55 suggestions in this thread, I might try it again.
56
57 Separate device for the journal is a good idea, but not possible atm
58 (machine is abroad in a data center)

Replies

Subject Author
Re: [gentoo-user] Fast file system for cache directory with lot's of files Florian Philipp <lists@×××××××××××.net>