Persistent Block Device Properties

During the deployment of a shared-nothing, massively parallel database (Greenplum), Pivotal recommend making certain optimisations to the block devices used by the database system to ensure maximum performance.

The key thing we change is the block device's readahead property. This can easily be set at the command prompt via blockdev, and can persist via a single line in /etc/rc.local; but this all feels kind of dirty. The correct way to make this change persist is via udev.

The following block shows how to use udev to configure the readahead property, and should be placed in a new file within /etc/udev/rules.d/


ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/read_ahead_kb}="8192"

We can also use a similar approach to configure the I/O scheduler.


ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/scheduler}="deadline"

This article is my 9th oldest. It is 118 words long