Creating a ZFS Storage Pool With Cache Devices
Cache devices provide an additional layer of caching between main memory and disk. These devices provide the greatest performance improvement for random-read workloads of mostly static content.
To configure a storage pool with cache devices, use the cache
keyword, for example:
$ zpool create system1 mirror c2t0d0 c2t1d0 c2t3d0 cache c2t5d0 c2t8d0 $ zpool status system1 pool: system1 state: ONLINE scrub: none requested config: NAME STATE READ WRITE CKSUM system1 ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 c2t0d0 ONLINE 0 0 0 c2t1d0 ONLINE 0 0 0 c2t3d0 ONLINE 0 0 0 cache c2t5d0 ONLINE 0 0 0 c2t8d0 ONLINE 0 0 0 errors: No known data errors
You can add single or multiple cache devices to the pool, either while it is being created or after it is created, as shown in Adding Cache Devices. However, you cannot create mirrored cache devices or create them as part of a RAID-Z configuration.
Note:
If a read error is encountered on a cache device, that read I/O is reissued to the original storage pool device, which might be part of a mirrored or a RAID-Z configuration. The content of cache devices is considered volatile, similar to other system caches.After cache devices are added, they gradually fill with content from main memory. The time before a cache device reaches full capacity varies depending on its size. Use the zpool iostat
command to monitor capacity and reads, as shown in the following example:
$ zpool iostat -v pool 5
For more information about the zpool iostat
command, see Viewing I/O Statistics for ZFS Storage Pools.