[Gluster-users] Optimal XFS formatting?

Papp Tamas tompos at martos.bme.hu
Thu Oct 20 22:14:27 UTC 2011


On 10/20/2011 03:18 PM, Gerald Brandt wrote:
> Hi,
>
> Are there any 'optimal' settings for XFS formatting under GlusterFS?  The storage will be used for Virtual Disk storage, virtual disk size from 8GB to 100 GB in size.
>
> One of the VM's (separate gluster volume) will be running MSSQL server (4K reads and writes).  The other will be running file servers, etc).

hi,

Why do you use VM images for these IO demanding tasks?

Anyway, we use this script:

#!/bin/bash
BLOCKSIZE=4096 # Make sure this is in bytes
CHUNKSIZE=128  # Make sure this is in KiB
NUMSPINDLES=8
RAID_TYPE=6
RAID_DEVICE_NAME="/dev/sda4" # Specify device name for your RAID device
FSLABEL="gluster" # specify filesystem label for generating mkfs line here

case "$RAID_TYPE" in
0)
     RAID_DISKS=${NUMSPINDLES};
     ;;
1)
     RAID_DISKS=${NUMSPINDLES};
     ;;
10)
     RAID_DISKS=${NUMSPINDLES};
     ;;
5)
     RAID_DISKS=`echo "${NUMSPINDLES} - 1" | bc`;
     ;;
6)
     RAID_DISKS=`echo "${NUMSPINDLES} - 2" | bc`;
     ;;
*)
     echo "Please specify RAID_TYPE as one of: 0, 1, 10, 5, or 6."
     exit
     ;;
esac

SUNIT=`echo "${CHUNKSIZE} * 1024 / 512" | bc`
SWIDTH=`echo "$RAID_DISKS * ${SUNIT}" | bc`

echo "System blocksize=${BLOCKSIZE}"
echo "Chunk Size=${CHUNKSIZE} KiB"
echo "NumSpindles=${NUMSPINDLES}"
echo "RAID Type=${RAID_TYPE}"
echo "RAID Disks (usable for data)=${RAID_DISKS}"
echo "Calculated values:"
echo "Stripe Unit=${SUNIT}"
echo -e "Stripe Width=${SWIDTH}\n"
echo "mkfs line:"
echo -e "mkfs.xfs -b size=${BLOCKSIZE} -d 
sunit=${SUNIT},swidth=${SWIDTH} -L ${FSLABEL} ${RAID_DEVICE_NAME}\n"
echo "mount line:"
echo -e "mount -o remount,sunit=${SUNIT},swidth=${SWIDTH}\n"
echo "Add these options to your /etc/fstab to make permanent:"
echo "sunit=${SUNIT},swidth=${SWIDTH}"


Corresponding fstab:

/dev/sda4    /mnt/brick1    xfs    
delaylog,sunit=256,swidth=1536,logbufs=8,logbsize=256k,noatime,nodiratime    
0    0


tamas



More information about the Gluster-users mailing list