Wednesday, October 8, 2014

Does issuing a sync call flush an SSD's write cache?



Suppose I create a number of directories on SSD, then issue a "sync" call.



The sync call will guarantee that any writes, even if they are stored in the write cache, will be flushed to disk by the time the sync call returns, right?



Answer



There is no real way to know that. Each drive may do different things and there is no one to keep the vendors accountable.



The enterprise drives will ensure that your data can be written to disk on power off with internal capacitors intended for this purpose. The consumer grade drives usually have no such guarantee and you are their mercy if their flush command implementation really does write the data to the media.



Your only way to know is to test the specific drives you intend to work with.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...