Optimal setting is for the Page Cache to be dumped from full to 0 in 30 seconds as to not hold up pending writes for more than 30 seconds.
To determine the best value for these settings the vioperf script needs to be run against the DR DB data disks. From that data:
- Take the speed per core value.
- Multiply it by 30 (seconds) and it gives us the size of the file cache maximum.
- Figure out the percent of memory by doing:
- (file cache size in MB/size of overall memory in MB)*100=dirty_ratio value
For example for 30 seconds in a sample environment with overall memory at 92 GB.
- 40 MB/s * 30 = 1200 MB (aka 1.2GB)
This means dirty_ratio would be:
- ( 1200 / 92000 ) * 100 = 1.3
Rounding up since we're looking at 30 secs we'd use dirty_ratio = 2 and dirty_background_ratio = 1.
Example for 2 mins:
- 40 MB/s * 120 = 4800 MB (aka 4.8 GB)
Here dirty_ratio would be:
- ( 4800/ 92000 ) * 100 = 5.2
Rounding down since we want to remain under 2 mins max we'd use dirty_ratio = 5 and dirty_background_ratio = 2.
To change a setting immediately run:
To make the setting permanent, add the name=value to /etc/sysctl.conf. This is what we'd recommend here, editing the /etc/sysctl.conf file on all nodes in the cluster. In the above example calculations, we'd add the following lines to the /etc/sysctl.conf file on each node:
# Set dirty_ratio to 2 overriding default value of 20
dirty_ratio = 2
# Set dirty_background_ratio to 1 overriding default value of 10
dirty_background_ratio = 1
NOTE: Adjust your comments and values as needed to fit the given environment.
After making the change permanent via /etc/sysctl.conf edits, run "sysctl -p" on each node to refresh with the system with new configuration.