Skip to contentSkip to conversation

allocsize mount option

DISCUSSION Gim Leong Chin 3 participants 3 messages Jan 13, 2010

lore
Share & tools
lore
#0 lore raw

Hi,

The application is ANSYS, which writes 128 GB files.  The existing computer with SUSE Linux Enterprise Desktop 11 which is used for running ANSYS, has two software RAID 0 devices made up of five 1 TB drives.  The /home partition is 4.5 T, and it is now 4 TB full.  I see a fragmentation > 19%.

I have just set up a new computer with 16 WD Cavair Black 1 TB drives connected to an Areca 1680ix-16 RAID with 4 GB cache.  14 of these drives are in RAID 6 with 128 kB stripes. The OS is also SLED 11. The system has 16 GB memory, and AMD Phenom II X4 965 CPU.

I have done tests writing 100 30 MB files and 1 GB, 10 GB and 20 GB files, with single instance and multiple instances.

There is a big difference in writing speed when writing 20 GB files when using allocsize=1g and not using the option. That is without the inode64 option, which gives further speed gains.

I use dd for writing the 1 GB, 10 GB and 20 GB files.

mkfs.xfs -f -b size=4k -d agcount=32,su=128k,sw=12 -i size=256,align=1,attr=2 -l version=2,su=128k,lazy-count=1 -n version=2 -s size=512 -L /data /dev/sdb1

defaults,nobarrier,usrquota,grpquota,noatime,nodiratime,allocsize=1g,logbufs=8,logbsize=256k,largeio,swalloc

The start of the partition has been set to LBA 3072 using GPT Fdisk to align the stripes.

The dd command is:

chingl@tsunami:/data/test/t2> dd if=/dev/zero of=bigfile20GB bs=1073741824 count=20

Single instance of 20 GB dd repeats were 214, 221, 123 MB/s with allocsize=1g, compared to 94, 126 MB/s without.

Two instances of 20 GB dd repeats were aggregate 331, 372 MB/s with allocsize=1g, compared to 336, 296 MB/s without.

Three instances of 20 GB dd was aggregate 400 MB/s with, 326 MB/s without.

Six instances of 20 GB dd was 606 MB/s with, 473 MB/s without.

My production configuration is

defaults,nobarrier,usrquota,grpquota,noatime,nodiratime,allocsize=1g,logbufs=8,logbsize=256k,largeio,swalloc,inode64

for which I got up to 297 MB/s for single instance 20 GB dd.

Chin Gim Leong

Quoted 76 lines · Eric Sandeen

From: Eric Sandeen <[email protected]>
Subject: Re: allocsize mount option
To: "Gim Leong Chin" <[email protected]>
Cc: [email protected]
Date: Tuesday, 12 January, 2010, 2:16 AM

Quoted 3 lines · Gim Leong Chin

Hi,

Mount options for xfs allocsize=size Sets  the

buffered I/O

Quoted 1 line

end-of-file preallocation size when doing delayed

allocation writeout

Quoted 4 lines

(default size is 64KiB).

I read that setting allocsize to a big value can be

used to combat

Quoted 1 line

filesystem fragmentation when writing big files.

That's not universally necessary though, depending on how you are
writing them.  I've only used it in the very specific case of mythtv
calling "sync" every couple seconds, and defeating delalloc.

Quoted 1 line

I do not understand how allocsize works.  Say I

set allocsize=1g, but

Quoted 1 line

my file size is only 1 MB or even smaller.  Will

the rest of the 1 GB

Quoted 1 line

file extent be allocated, resulting in wasted space

and even file

Quoted 1 line

fragmentation problem?

possibly :)  It's only speculatively allocated, though, so you won't
have 1g for every file; when it's closed the preallocation goes
away, IIRC.

Quoted 1 line

Does setting allocsize to a big value result in

performance gain when

Quoted 1 line

writing big files?  Is performance hurt by a big

value setting when

Quoted 3 lines

writing files smaller than the allocsize value?

I am setting up a system for HPC, where two different

applications

Quoted 1 line

have different file size characteristics, one writes

files of GBs and

Quoted 1 line

even 128 GB, the other is in MBs to tens of MBs.

We should probably back up and say:  are you seeing fragmentation
problems -without- the mount option, and if so, what is your write pattern?

-Eric

Quoted 1 line

I am not able to find documentation on the behaviour

of allocsize

Quoted 9 lines

mount option.

Thank you.

Chin Gim Leong

New Email names for you! Get the Email name you've

always wanted

Quoted 1 line

on the new @ymail and @rocketmail. Hurry before

someone else does!

Quoted 3 lines

http://mail.promotions.yahoo.com/newdomains/sg/

_______________________________________________ xfs

Quoted 9 lines

mailing list

Quoted 2 lines

[email protected] http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

New Email addresses available on Yahoo!
Get the Email name you&#39;ve always wanted on the new @ymail and @rocketmail. Hurry before someone else does!
http://mail.promotions.yahoo.com/newdomains/sg/

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#1 lore raw
Quoted 8 lines · Gim Leong Chin

Hi,

The application is ANSYS, which writes 128 GB files.  The existing computer with SUSE Linux Enterprise Desktop 11 which is used for running ANSYS, has two software RAID 0 devices made up of five 1 TB drives.  The /home partition is 4.5 T, and it is now 4 TB full.  I see a fragmentation > 19%.

XFS will start to fragment when the filesystem gets beyond 85% full - it seems that you are very close to that threshold.

That being said, if you've pulled the figure of 19% from the xfs_db measure of fragmentation, that doesn't mean the filesystem is badly fragmented, it just means that that there are 19% more fragments than the ideal. In 4TB of data with 1GB sized files, that would mean there are 4800 extents (average length ~800MB, which is excellent) instead of the perfect 4000 extents (@1GB each). Hence you can see how misleading this "19% fragmentation" number can be on an extent based filesystem...

Quoted 13 lines

I have just set up a new computer with 16 WD Cavair Black 1 TB drives connected to an Areca 1680ix-16 RAID with 4 GB cache.  14 of these drives are in RAID 6 with 128 kB stripes. The OS is also SLED 11. The system has 16 GB memory, and AMD Phenom II X4 965 CPU.

I have done tests writing 100 30 MB files and 1 GB, 10 GB and 20 GB files, with single instance and multiple instances.

There is a big difference in writing speed when writing 20 GB files when using allocsize=1g and not using the option. That is without the inode64 option, which gives further speed gains.

Quoted 8 lines

I use dd for writing the 1 GB, 10 GB and 20 GB files.

mkfs.xfs -f -b size=4k -d agcount=32,su=128k,sw=12 -i size=256,align=1,attr=2 -l version=2,su=128k,lazy-count=1 -n version=2 -s size=512 -L /data /dev/sdb1

defaults,nobarrier,usrquota,grpquota,noatime,nodiratime,allocsize=1g,logbufs=8,logbsize=256k,largeio,swalloc

The start of the partition has been set to LBA 3072 using GPT Fdisk to align the stripes.

This all looks good - it certainly seems that you have done your research. ;) The only thing I'd do differently is that if you have only one partition on the drives, I wouldn't even put a partition on it.

Quoted 3 lines

The dd command is:

chingl@tsunami:/data/test/t2> dd if=/dev/zero of=bigfile20GB bs=1073741824 count=20

I'd significantly reduce the size of that buffer - too large a buffer can slow down IO due to the memory it consumes and TLB misses it causes. I'd typically use something like:

$ dd if=/dev/zero of=bigfile bs=1024k count=20k

Which does 20,000 writes of 1MB each and ensures the dd process doesn't consume over a GB of RAM.

Quoted 2 lines

Single instance of 20 GB dd repeats were 214, 221, 123 MB/s with allocsize=1g, compared to 94, 126 MB/s without.

This seems rather low for a buffered write on hardware that can clearly go faster. SLED11 is based on 2.6.27, right? I suspect that many of the buffered writeback issues that have been fixed since 2.6.30 are present in the SLED11 kernel, and if that is the case I can see why the allocsize mount option makes such a big difference.

It might be worth checking how well direct IO writes run to take buffered writeback issues out ofthe equation. In that case, I'd use stripe width multiple sized buffers like:

$ dd if=/dev/zero of=bigfile bs=3072k count=7k oflag=direct

I'd suggest that you might need to look at increasing the maximum IO size for the block device (/sys/block/sdb/queue/max_sectors_kb), maybe the request queue depth as well to get larger IOs to be pushed to the raid controller. if you can, at least get it to the stripe width of 1536k....

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Reviewed-by
#2 lore raw

Re: xfstests: Clean up build output

Quoted 15 lines

We don't need to see every compiler command line for every file that is compiled. This makes it hard to see warnings and errors during compile. For progress notification, we really only need to see the directory/file being operated on.

Turn down the verbosity of output by suppressing various make output and provide better overall visibility of which directory is being operated on, what the operation is and what is being done to the files by the build/clean process.

While doing this, remove explicit target-per-file rules in the subdirectories being built and replace them with target based rules using the buildrules hooks for doing this. This results in the makefiles being simpler, smaller and more consistent.

Quoted 6 lines

This patch does not address the dmapi subdirectory of the xfstests build system.

The old style verbose builds can still be run via "make V=1 ..."

Didn't get this in my mail box but it looks good to me.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs