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 Example 6, Adding Cache Devices. However, you cannot create mirrored cache devices or create them as part of a RAID-Z configuration.
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.