Disable disk caches in AWS EBS for PostgreSQL?
- by Alexandr Kurilin
It's my understanding that, without correctly disabling OS-level and drive-level caching, there is a chance that in case of system failure the Write-Ahead Log might not be saved correctly and in fact might get corrupted, possibly preventing data recovery.
I've already made sure that
wal_sync_method=fdatasync
however I was unable to make any configuration changes with hdparm since I get the following:
$ sudo htparm -I /dev/xvdf
/dev/xvdf:
HDIO_DRIVE_CMD(identify) failed: Invalid argument
Looks like that option is not available in the kind of setup you get in EC2.
Am I missing anything here? Are there any other obvious caches I have to disable to ensure the WAL's safety?