Database Reference
In-Depth Information
Disk readahead
Disk readahead boosts sequential access to the disk by reading a little more data than re-
quested ahead of time to mitigate some effects of slow disk reads. This is called readahead
( RA ). This means less frequent requests to the disk.
But this function has its disadvantages as well. If your system is performing high-frequency
random reads and writes, a high RA would translate them into magnified reads and/or
writes—much higher I/O operations than actually is. This will slow down the system. (It
also piles up memory with the data that you do not actually need.)
To view the current value of RA, execute blockdev -report as shown in the follow-
ing command line:
$ sudo blockdev -report
RO RASSZ BSZ StartSec Size Device
rw256 512 4096 0 320072933376 /dev/sda
rw256 512 4096 2048 104857600 /dev/sda1
rw256 512 4096 206848 73295462400 /dev/sda2
rw256 512 1024 143362110 1024 /dev/sda3
...
In the preceding example, RA is 256 blocks of a sector size ( SSZ ) of 512 bytes. Therefore,
512 * 256 bytes = 128 KB.
Unfortunately, the commonly suggested value of RA is 65536, or 32 MB! This is very bad
for a Cassandra setup. Do not use this high value for RA. It is recommended to set the
readahead to 512 . Here is how to do that:
# set RA, may require sudoer permission
$ sudo blockdev --setra 512 /dev/<device>
The setting can be made permanent by placing it in a local run-config file.
Search WWH ::




Custom Search