mattlach
Patron
- Joined
- Oct 14, 2012
- Messages
- 280
Seemingly the rest of the ZFS community outside of FreeNAS has done just this.
Back in the v15 pool days, it was CERTAINLY a good idea to mirror your SLOG, as if you lost it your pool was garbage.
These days this is no longer the case, but for some reason FreeNAS still recommend this as best practice. The question is, is it time to reevaluate this recommendation?
TO support this argument, let's go over again how the ZIL (ZFS Intent Log) works:
First off, the SLOG is NOT a cache device and thus the ZIL has nothing to do with cache. It has no cache function what so ever.
The ZIL is never read from during normal use. (and it is never read from or written to for async writes)
If a SLOG is present, the system ZIL is placed on it.
During async writes, ZFS will accept data for a write to RAM, and immediately report back (lie) to the writing device that the data has been committed to disk, even though it hasn't, and a power outage could still cause data loss.
This is why sync writes are recommended for important data. With the default FreeNAS implementation, the ZIL resides on the regular pool. When a sync write is received, it writes an fast log write to the ZIL, then reports back that data has been committed to disk. This is a duplicate copy, the data still resides in RAM and is written to the main pool the next write cycle. Once the data has been written to the main pool, the ZIL data is no longer necessary, and is thus discarded.
The ZIL is never read from UNLESS there is a power outage or other interruption before the data is written to the main pool. Then the ZIL data is read the next time the pool is mounted, and the data in the ZIL is recreated and written to the pool.
When you have a SLOG (a separate log device) it still works the same, but the ZIL is then moved to the separate device, which is hopefully faster than your spinning disks in your pool. With a fast enough SLOG, your sync writes can start to approximate async writes, because as soon as the data has been committed to the ZIL, the system can continue.
So, how would one lose data if a SLOG is lost?
Well, the SLOG would have to die. But just the SLOG dying is not enough. (remember that the data is still in RAM, and written to the pool from there). In addition to the SLOG dying, you would also need to lose power (or otherwise freeze the system) in the second or so before the next write cycle from RAM completes.
How likely is this anyway?
On a stable system with a UPS, I would consider it VERY unlikely of this to happen.
If your FreeNAS server is air starved, and likely to overheat or you have bad non-ECC RAM or you don't have a UPS, that likelihood goes up, but you'd still have to have the SLOG die and the system hang/reset almost at exactly the same time.
I'm starting to think that for a system with ECC RAM, that is well cooled and has a UPS, there is absolutely no reason at all to mirror your slog. Save the $200 bucks you'd spend on an Intel s3700 SLOG device and take your significant other out to a nice dinner instead. :p
Thoughts? (I'm sure Cyberjock will have some)
Back in the v15 pool days, it was CERTAINLY a good idea to mirror your SLOG, as if you lost it your pool was garbage.
These days this is no longer the case, but for some reason FreeNAS still recommend this as best practice. The question is, is it time to reevaluate this recommendation?
TO support this argument, let's go over again how the ZIL (ZFS Intent Log) works:
First off, the SLOG is NOT a cache device and thus the ZIL has nothing to do with cache. It has no cache function what so ever.
The ZIL is never read from during normal use. (and it is never read from or written to for async writes)
If a SLOG is present, the system ZIL is placed on it.
During async writes, ZFS will accept data for a write to RAM, and immediately report back (lie) to the writing device that the data has been committed to disk, even though it hasn't, and a power outage could still cause data loss.
This is why sync writes are recommended for important data. With the default FreeNAS implementation, the ZIL resides on the regular pool. When a sync write is received, it writes an fast log write to the ZIL, then reports back that data has been committed to disk. This is a duplicate copy, the data still resides in RAM and is written to the main pool the next write cycle. Once the data has been written to the main pool, the ZIL data is no longer necessary, and is thus discarded.
The ZIL is never read from UNLESS there is a power outage or other interruption before the data is written to the main pool. Then the ZIL data is read the next time the pool is mounted, and the data in the ZIL is recreated and written to the pool.
When you have a SLOG (a separate log device) it still works the same, but the ZIL is then moved to the separate device, which is hopefully faster than your spinning disks in your pool. With a fast enough SLOG, your sync writes can start to approximate async writes, because as soon as the data has been committed to the ZIL, the system can continue.
So, how would one lose data if a SLOG is lost?
Well, the SLOG would have to die. But just the SLOG dying is not enough. (remember that the data is still in RAM, and written to the pool from there). In addition to the SLOG dying, you would also need to lose power (or otherwise freeze the system) in the second or so before the next write cycle from RAM completes.
How likely is this anyway?
On a stable system with a UPS, I would consider it VERY unlikely of this to happen.
If your FreeNAS server is air starved, and likely to overheat or you have bad non-ECC RAM or you don't have a UPS, that likelihood goes up, but you'd still have to have the SLOG die and the system hang/reset almost at exactly the same time.
I'm starting to think that for a system with ECC RAM, that is well cooled and has a UPS, there is absolutely no reason at all to mirror your slog. Save the $200 bucks you'd spend on an Intel s3700 SLOG device and take your significant other out to a nice dinner instead. :p
Thoughts? (I'm sure Cyberjock will have some)