Skip to content

Tunables

Petros Koutoupis edited this page Nov 3, 2016 · 1 revision

The following are suggested tunables to increase performance with both RapidDisk and RapidDisk-Cache.

RapidDisk

When loading the RapidDisk module adjust the max_sectors and nr_requests to the desired values:

# modprobe rxdsk max_sectors=2048 nr_requests=1024

Sysstat

Verify that the sysstat package is installed from your distributions package repository.

# echo "vm.dirty_background_ratio = 20" >> /etc/sysctl.conf
# echo "vm.dirty_ratio = 60" >> /etc/sysctl.conf

Source Block Device for RapidDisk-Cache

You will most likely need to script this as part of the rc.local bootup script or udev. Increase the following parameters of the device(s) to the desired values:

# echo "2048" > /sys/block/sdb/queue/max_sectors_kb 2>&1
# echo "1024" > /sys/block/sdb/queue/nr_requests 2>&1
# echo "1024" > /sys/block/sdb/queue/read_ahead_kb 2>&1
# echo "128" > /sys/block/sdb/device/queue_depth 2>&1

If the underlying device is a Solid State Drive (SSD), you will need to ensure that noop is the drive’s configured scheduler.

# echo "noop" > /sys/block/sdb/queue/scheduler 2>&1

Miscellaneous

Disable Write-Caching to the Underlying Device

At first glance you may wonder why I am stating this but truth be told, write-cache on a disk drive can be extremely dangerous and may lead to data corruption. Most conventional drives, both commercial and enterprise grade enable this feature but do so with Volatile DRAM. What happens if the power of the drive was cut just before that cached data is synchronized to the spinning platter? It disappears and as far as the operating system is concerned, it was persisted to disk and the data is there; even though the reality is, it may not be. This is why, most storage vendors, disable any and all write-back local to the disk drive in favor of their own caching implementation. Anyway, you too, should make it a good practice to disable write-back caching on all locally attached disk drives using the hdparm utility. Make sure you install it from your distributions repository and remove the comment on the following line of the /etc/hdparm.conf file:

#write_cache = off

You can also manually disable the cache in realtime with the following command:

# /sbin/hdparm -W0 /dev/sdb