Home > Workload Solutions > SQL Server > Best Practices > AMD-Based SQL Server Best Practices on Dell PowerEdge R740 and PowerMax 2000 > Linux Best Practices > Performance Best Practices > Red Hat Enterprise Linux: Read Ahead Value for Storage
In this best practice, the read-ahead Linux OS setting was changed to improve reads from storage.
Category | Operating System |
Product | Red Hat Enterprise Linux 8.3 |
Type of best practice | Performance Optimization |
Day and value | Day 3, Fine Tuning |
Overview
When the Linux operating system performs a read from disk, it reads additional data and this is referred to as read ahead. A benefit to reading additional data is the operating system improves performance if the data has relevance to what the application has requested. However, if the data has no relevance to what the application requested then reading the additional data could impact performance. Operating system administers can adjust the value of the read-ahead setting to optimize performance. For example, Microsoft recommends a read-ahead value of 4096 for SQL Server. The default read-ahead value was 8192 thus, in changing the value to 4096 the operating system will read half as much data.
By changing the read-ahead value to 4096 our test results showed no performance gains.
Recommendation
Changing the operating system to use a read-ahead value of 4096 had no impact on these performance metrics:
Although our OLTP workload tests showed no performance improvements, this read-ahead best practice might be valuable for other databases. Thus, we are including the read-ahead recommendation as a Day 3, Fine Tuning recommendation.
Implementation Steps
Use the blockdev command to view and edit the read-ahead value. To view the current read-ahead value for a particular block device, run:
blockdev --getra device
To modify the read-ahead value for that block device, run the following command. N represents the number of 512-byte sectors.
blockdev --setra N device
References
Performance best practices and configuration guidelines for SQL Server on Linux
Red Hat Performance Turning Guide: File system performance tuning