Configuring Disks
Disk Planning
In a Hadoop-like environment, a single disk is used as the data disk. Therefore, there are two options: JBOD and single-disk RAID 0.
If the LSI SAS3108, LSI SAS3408, or LSI SAS3508 RAID controller card is used, you are advised to create a single-disk RAID 0 group to fully utilize the cache of the RAID controller card (the cache of the LSI SAS3508 RAID controller card is 2 GB) and improve the read/write speed.
Cache Policy
Use the StorCLI tool to modify the cache settings of the RAID group. Set the read policy to read ahead and use the cache of the RAID controller card for pre-reading. Set the write policy to write back, and use the cache of the RAID controller card for write-back instead of write-through. Set the I/O policy to cached I/O to use the cache of the RAID controller card to cache I/Os.
In actual tests, there is a 3% to 5% end-to-end performance difference between RAWBD and RAWBC. RAWBC (without a supercapacitor)/RWBC (with a supercapacitor) provides better performance.
The configuration commands are as follows:
1 2 3 |
./storcli /c0/vx set rdcache=RA ./storcli /c0/vx set wrcache=WB/AWB ./storcli /c0/vx set iopolicy=Cached |
In the ./storcli /c0/vx set wrcache=WB/AWB command, WB/AWB depends on whether the RAID controller card has a supercapacitor. If there is no supercapacitor, use AWB.
Block Device Configuration
For block device configuration, the scheduler, sector_size, and read_ahead_kb parameters need to be configured.
- According to the test result, setting the value of scheduler to deadline can achieve the optimal performance.
1cat /sys/block/sdx/queue/scheduler
- The sector_size of a block device must match the sector size of the physical disk. The hw_sector_size, max_hw_sectors_kb, and max_sectors_kb parameters can be used for matching. The values of the first two parameters are read from the hardware, and the value of the third parameter is the maximum aggregation block size of the kernel block device. It is recommended that the value of the third parameter be the same as that of the hardware. That is, the values of the latter two parameters should be the same.
- It is recommended that the prefetch size of a block device be set to 4 MB to achieve better read performance. The default value is 128 KB.
- Viewing the prefetch setting.
1/sbin/blockdev --getra /dev/sdb

- Set the prefetch size and verify the setting.
1/sbin/blockdev --setra 4096 /dev/sdb

- Viewing the prefetch setting.

