size the write cache ZFS

I would like to add a write cache to my Nexenta. I thought about using 2 SSDs in mirror with a third disc in spare. The problem is: How do I calculate the size of my array to maximize the investment (of course I do not want to spend much money in SSD space that is not being properly utilized then). Is there any way? I imagine that this calculation is a function of the space used by the datastore and peak workloads, queue lengths of writing, etc. But how do I translate this into gigabytes to buy?

I currently have a storage SATA 4x3TB and I could double it within a few years I also have a 256GB SSD dedicated to the read cache, but its size was chosen almost at random!

thank you very much


Solution 1:

I probably should start with "ZIL is not write cache". It's the ZFS Intent Log for Synchronous write requests, which means it's only used in certain circumstances (mainly for synchronous writes) and only improves speed in those situations when the write to the actual storage array would take longer than writing to the ZIL, and it doesn't actually write any quicker it only returns from the synchronous write request quicker (so the application thinks stuff is written to disk quicker, but the actual write throughput is not improved on the whole).

The ZIL doesn't need to be very big. Find the transfer speed of the fastest disk in your array and multiple by 10s, this is about how big your ZIL should be. You can double that if you want extra room for error, but any more is a waste. A fast platter drive these days can crank out just over 200Mb/s, so a ZIL for an array made from that drive should be about 2-4GB.

Solution 2:

Your write cache (ZIL) does not need to be large. Sizing is really a function of your anticipated write rate to the array.

Think about the purpose of the ZIL... to absorb random writes to low-latency storage and coalesce them to flush sequentially to the disk pool. In Nexenta, you basically need a ZIL large enough to handle up-to 30 seconds worth of writes... The devices I use a fairly small. One is a 4GB device. The other I recommend has an 8GB capacity.

Try to get a high quality SSD if you feel the need to run with a ZIL. You can mirror the ZILs. You don't need a spare ZIL.

Oh, and more comprehensive ZIL reading is here: http://nex7.blogspot.com/2013/04/zfs-intent-log.html