Below you will find a script which I created for a customer, due to the fact we needed to have an overview of the flash cache usage after enable write back mode. In a table the storage cell, allocated flash cache, used and dirty is provide.

Very useful to see in one run the current usage of your flash cache.

Example output:

Mon Jan 04 11:48:52 CET 2016
Host                Cache size          Allocated           Used                Dirty
-----------------------------------------------------------------------------------------
exsc10000000:       5957.5G             5,311,382           5,232,540           4,435,458
exsc20000000:       5957.5G             4,580,368           4,504,112           3,820,839
exsc30000000:       5957.5G             5,074,112           4,606,022           4,318,125
exsc40000000:       5957.5G             6,015,707           5,947,408           4,964,418
exsc50000000:       5957.5G             4,500,983           4,449,573           2,832,322

Script: show_flashcache.sh

dcli -g /root/cell_group -l root "cellcli -e 'list flashcache detail' | grep effect" >/tmp/log1
dcli -g /root/cell_group -l root "cellcli -e 'list metriccurrent fc_by_dirty,fc_by_used,fc_by_allocated'" > /tmp/log2

date;
printf '%-20s'  "Host" "Cache size" "Allocated" "Used" "Dirty" ;printf '\n'
echo "--------------------------------------------------------------------------------------"

for i in `cat /tmp/log1 | grep adm | awk '{ print $1} '`
do

HOST=$i
CACHE=`cat /tmp/log1 | grep $i | awk '{ print $3}'`
ALLOCATED=`cat /tmp/log2 | grep $i | grep FC_BY_ALLOCATED | awk '{ print $4}'`
USED=`cat /tmp/log2 | grep $i | grep FC_BY_USED | awk '{ print $4}'`
DIRTY=`cat /tmp/log2 | grep $i | grep FC_BY_DIRTY | awk '{ print $4}'`

printf '%-20s' $HOST $CACHE $ALLOCATED $USED $DIRTY; printf '\n'
done

rm /tmp/log1
rm /tmp/log2

The script was executed against X4-2 and X5-2. But as always, test it in your own environment. Execute the script as root user on a compute node.

 

Remark: FC_BY_USED can be larger than FC_BY_ALLOCATED when using release 12.1.1.1 on the storage servers. This is due to bug 20638779.