Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am running a postgres 8.4.5 server on the linux 2.6.33.7 kernel on an 8 disk raid array with an LSI controller.

Most of the tables are around 1GB or less.

I know that XFS uses allocation groups (AG) to achieve I/O parallelism.

My first question is, does this mean that if two tables are in the same AG, all I/O requests are queued to both of them if either is being read from/written to?

If so, I assume I would want to spread my tables across as my allocation groups as possible, correct? Wouldn't this ensure that multiple users querying different tables would get the best performance?

share|improve this question
    
From the XFS FAQ: I want to tune my XFS filesystems for something: "The standard answer you will get to this question is this: use the defaults". –  Cristian Ciupitu Aug 8 at 22:00

1 Answer 1

up vote 2 down vote accepted

What is the partition size in gigabytes? I usually divide that by 4 in order to determine the number of XFS allocation groups. I've run into situations where I only had one allocation group, and had problems with repair with an error indicating that there wasn't another AG to refer to in the file repair process. Either way, I think the general rule is partition size/4. There's some level of parallelism when running I/O against multiple allocation groups. But I'm assuming there's diminishing return on that number, so anywhere between partitionsize/2 and partitionsize/4 is reasonable.

So for a 200GB partition named "partitionname" on /dev/sdb1, I'd probably use the following mkfs.xfs command sequence.

mkfs.xfs -f -L /partitionname -d agcount=50 -l size=128m,version=2 /dev/sdb1

Also see: http://en.wikipedia.org/wiki/XFS#Allocation_groups

and http://everything2.com/index.pl?node_id=1479435 where it is noted:

At least one allocation group is needed per 4 gigs of space...
share|improve this answer
    
Thanks for the response. I have one 500GB partition and one 4TB partition. When you are saying the general rule is partition size/4 can I ask where you found this info? I have been googling all day and not been able to find anything this clear. –  HBlend Jan 14 '11 at 1:19
    
See my edits above. –  ewwhite Jan 14 '11 at 1:21
    
Thanks again for the follow up. I think the second reference may be outdated now though. The newer mkfs.xfs man pages (linux.die.net/man/8/mkfs.xfs) say an AG can go up to 1TB now unless I am misunderstanding something. –  HBlend Jan 14 '11 at 1:31
    
I've been diving by four for 6 years or so in XFS deployments. It's a reasonable rule. If in doubt, test with different settings. But there are other places to tune your XFS mounts; noatime, nobarrier, log sizes, etc. –  ewwhite Jan 14 '11 at 1:35

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.