引用:
作者linczs2000
SERVER通常都會操到不能有時間跑GC
這時候SANDFORCE的價值就出來了
|
請教大大,這種理論要如何驗證呢?
Sandforce光寫入不到一半容量效能已經降了很多了
這樣真的放在server上還有什麼優勢呢?
Sandforce本身也應該會有類GC的機制在作用吧?
不然他都在寫入下筆資料時發覺這裡有舊資料才來做抹除
然後再寫入,效能不就降很大嗎?
下面是wikipedia的一些解釋,我不清楚正確度如何
但看來GC跟Trim是相輔相成的
沒有Trim的狀況,GC仍在運作,但會讓一些實際上已刪除
沒有必要去規劃他存放位置的檔案重複再次因為移動而寫入造成Flash耗損
所以Trim是讓GC更有效率的一個指令。
arbage collection (GC) and TRIM are interrelated. There is some detailed information here on Wikipedia Garbage Collection
All SSDs have garbage collection. That is a function of NAND flash memory used in SSDs. Some drives may be more efficient at GC than others. Some do not recover as well as others after they have been used for a period of time. Some drives perform GC in the background when the drive is otherwise not busy with user data (idle), but there are some drawbacks to that background operation (you can see the wikipedia article for more details). In general background GC is not good for the endurance of the drive because it moves data that the OS (and user) may delete and render unnecessary to GC in the first place. The best solution is to do it on the fly as fast as possible.
TRIM is a command sent by the OS to the drive identifying the actual logical block addresses (LBAs) that are no longer needed. To understand TRIM you must understand how the OS and SSD tracks the data. When you put an item in the OS trash you are not actually deleting the items. They are just marked ready for deletion. If the user says to empty the trash, the OS notes this and now says those LBAs are free to accept new data. This is true for all storage devices, not just SSDs. Many people do not realize that the storage device does not actually delete the data at that point. The act of erasing a file is simply the OS marking its internal lookup tables for that file as free to store new information. An HDD still has the data on the drive at that location until the OS writes something new into that spot. For an SSD it is the same; the SSD still has the data in the flash at that location until the OS writes something new into that spot. Of course the NAND flash memory requires the replacement data to be written into a new location and the old data is marked as "invalid" now. Then during garbage collection that invalid data is NOT moved with other valid data in that block to a new block.
The performance of an SSD is at its peak when it is brand new out of the box because there is nothing to GC. Unfortunately this occurs only at the beginning of the drive's life or after you secure erase the drive and start over. Performance is also affected by the size of the over provisioning (OP) (details also in the wikipedia article above). During GC if the drive does not have to move around as much data it can operate faster. The TRIM command enables the OS to tell the SSD what LBAs are no longer valid data. Without the TRIM command this only happens when the OS tries to write something new into that same spot or it tries to replace the current data. If the SSD knew in advance that some of the LBAs holding data were invalid the drive would not move that data during GC. The effect gets you closer to the performance of a drive with larger OP. Without the TRIM command the drive will perform like it is at full capacity at all times and only has the amount of OP set at the factory (plus any space left unused during the partition process when first setting up the drive).
All this is common for all SSDs. An SSD with a SandForce controller has one other factor related to this GC and TRIM story. Due to their data compression techniques most data will be reduced when written to the drive. This results in a larger OP, with the same user capacity. In contrast if the OS did the compression you would fit more data on the drive, but the OP would be the same. This larger OP results in faster performance during GC. The RevoDrive cannot use TRIM because of the RAID controller onboard. This is true of all RAID controllers that I know of today, so it is not OCZ's fault it does not pass through. However, since OCZ chose the SandForce controller they have the advantage of automatically having more OP with most data and that results in higher performance normally only seen with the TRIM command.
The wikipedia link above is part of a larger article on Write Amplification (WA) that is pretty key to SSDs. The is an additional article on TRIM as well and it tracks the OSes that support TRIM by version. Today in Windows environments you must start with Win 7.