Re: btrfs and 1 billion small files

2012-05-08 Thread Chris Samuel
On 07/05/12 20:06, Boyd Waters wrote: Use a directory hierarchy. Even if the filesystem handles a flat structure effectively, userspace programs will choke on tens of thousands of files in a single directory. For example 'ls' will try to lexically sort its output (very slowly) unless given

Re: btrfs and 1 billion small files

2012-05-08 Thread Chris Mason
On Mon, May 07, 2012 at 11:28:13AM +0200, Alessio Focardi wrote: Hi, I need some help in designing a storage structure for 1 billion of small files (512 Bytes), and I was wondering how btrfs will fit in this scenario. Keep in mind that I never worked with btrfs - I just read some

Re: btrfs and 1 billion small files

2012-05-08 Thread Martin
On 07/05/12 12:05, viv...@gmail.com wrote: Il 07/05/2012 11:28, Alessio Focardi ha scritto: Hi, I need some help in designing a storage structure for 1 billion of small files (512 Bytes), and I was wondering how btrfs will fit in this scenario. Keep in mind that I never worked with btrfs - I

Re: btrfs and 1 billion small files

2012-05-08 Thread Martin
On 08/05/12 13:31, Chris Mason wrote: [...] A few people have already mentioned how btrfs will pack these small files into metadata blocks. If you're running btrfs on a single disk, [...] But the cost is increased CPU usage. Btrfs hits memmove and memcpy pretty hard when you're using

Re: btrfs and 1 billion small files

2012-05-08 Thread Chris Mason
On Tue, May 08, 2012 at 05:51:05PM +0100, Martin wrote: On 08/05/12 13:31, Chris Mason wrote: [...] A few people have already mentioned how btrfs will pack these small files into metadata blocks. If you're running btrfs on a single disk, [...] But the cost is increased CPU usage.

btrfs and 1 billion small files

2012-05-07 Thread Alessio Focardi
Hi, I need some help in designing a storage structure for 1 billion of small files (512 Bytes), and I was wondering how btrfs will fit in this scenario. Keep in mind that I never worked with btrfs - I just read some documentation and browsed this mailing list - so forgive me if my questions

Re: btrfs and 1 billion small files

2012-05-07 Thread Hubert Kario
On Monday 07 of May 2012 11:28:13 Alessio Focardi wrote: Hi, I need some help in designing a storage structure for 1 billion of small files (512 Bytes), and I was wondering how btrfs will fit in this scenario. Keep in mind that I never worked with btrfs - I just read some documentation and

Re: btrfs and 1 billion small files

2012-05-07 Thread Boyd Waters
Use a directory hierarchy. Even if the filesystem handles a flat structure effectively, userspace programs will choke on tens of thousands of files in a single directory. For example 'ls' will try to lexically sort its output (very slowly) unless given the command-line option not to do so.

Re: btrfs and 1 billion small files

2012-05-07 Thread Hugo Mills
On Mon, May 07, 2012 at 11:28:13AM +0200, Alessio Focardi wrote: Hi, I need some help in designing a storage structure for 1 billion of small files (512 Bytes), and I was wondering how btrfs will fit in this scenario. Keep in mind that I never worked with btrfs - I just read some

Re: btrfs and 1 billion small files

2012-05-07 Thread viv...@gmail.com
Il 07/05/2012 11:28, Alessio Focardi ha scritto: Hi, I need some help in designing a storage structure for 1 billion of small files (512 Bytes), and I was wondering how btrfs will fit in this scenario. Keep in mind that I never worked with btrfs - I just read some documentation and browsed

Re: btrfs and 1 billion small files

2012-05-07 Thread Alessio Focardi
This is a lot more compact (as you can have several files' data in a single block), but by default will write two copies of each file, even on a single disk. Great, no (or less) space wasted, then! I will have a filesystem that's composed mostly of metadata blocks, if I understand correctly.

Re: btrfs and 1 billion small files

2012-05-07 Thread Hugo Mills
On Mon, May 07, 2012 at 01:15:26PM +0200, Alessio Focardi wrote: This is a lot more compact (as you can have several files' data in a single block), but by default will write two copies of each file, even on a single disk. Great, no (or less) space wasted, then! Less space wasted --

Re: btrfs and 1 billion small files

2012-05-07 Thread Johannes Hirte
Am Mon, 7 May 2012 12:39:28 +0100 schrieb Hugo Mills h...@carfax.org.uk: On Mon, May 07, 2012 at 01:15:26PM +0200, Alessio Focardi wrote: ... That's a very clever suggestion, I'm preparing a test server right now: going to use the -m single option. Any other suggestion regarding format

Re: btrfs and 1 billion small files

2012-05-07 Thread David Sterba
On Mon, May 07, 2012 at 11:28:13AM +0200, Alessio Focardi wrote: I tough about compression, but is not clear to me the compression is handled at the file level or at the block level. I don't recommend using compression for your expected file size range. Unless the files are highly compressible