XFS: How to calculate the correct sunit,swidth values for optimal performance

XFS allows to optimize for a given RAID stripe unit (stripe size) and stripe width (number of data disks) via mount options.

These options can be sometimes autodetected (for example with md raid and recent enough kernel (>= 2.6.32) and xfsprogs (>= 3.1.1) built with libblkid support) but manual calculation is needed for most of hardware raids.

The calculation of these values is quite simple:
su =
sw = <# of data disks (don't count parity disks)>

User tags

cfq etch usb dovecot pam conntrack xargs build cpanm backup Swift tun swap xfs ha ipmi find xen squeeze nvidia MODx backtrace NFS mdadm language shorewall pvmove arping idmapd video limit_conn kernel sublime core dump netfilter qcow2 ip opreport iptables dpkg shellshock parallel security erase 3Ware boot fail2ban bridge encrypt taskset rkhunter elliptics glxinfo lxc sysctl.conf groups perlbrew tiger cpu RT APU dstat debootstrap bash exim4 alien tool nfs4 performance regex proxy cgroups oprofile php Adaptec gre search ansible OpenStack SYN corosync mkfs docker-compose raid ps quagga git numa graylog2 OpenSSL iostat grub scsi htop opcontrol lubuntu HDFS virsh lenny apache virtualbox vrrpd wordpress profiling sysfs munin radeon hotplug sysrq Salt vlan su gdb arch source lstat debian flash puppet iSCSI sftp rpm vim HTTPS /etc/network/interfaces LSI slab ddos xhost ssh noop ubuntu pacemaker route fio gtk sysctl wget glusterfs tar .htaccess deb mount cluster sg freedos ulimit gpg LVM rsync virt-install zRam openvpn ipmitool KVM X forwarding vrrp newgrp equalizer sysresccd arp bind apt top leap second mysql alsa drupal CentOS raid5 SpamAssassin dhclient bonding tftp rtl8723be AMD SuperMicro iowait youtube mariadb storage replication tin bug dns PTR lts java jackd qemu vtysh tzdata in-addr.arpa bacula chroot firefox dhcp soa bscan routing DRBD initrd iops centos 7 exim chromium hdparm perl SSD nginx PXE fido7 StorMan docker MegaRAID ardour pulseaudio CPAN rtsp keyboard Areca asoundrc cache cpu usage