Quantcast
Viewing all articles
Browse latest Browse all 10

Trying to determine the correct number of XFS allocation groups for postgresql server on Linux

Image may be NSFW.
Clik here to view.
Question

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?

Asked by HBlend

Image may be NSFW.
Clik here to view.
Answer

What is the partition size? 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...
Answered by ewwhite

Viewing all articles
Browse latest Browse all 10

Trending Articles