Add a summary line of the ZFS Compressed ARC to top(1)
ClosedPublic

Authored by allanjude on Feb 28 2017, 5:33 AM.

Details

Summary

This provides details about the compression of cached ZFS data

Example output:
CPU: 0.1% user, 0.0% nice, 0.0% system, 0.0% interrupt, 99.9% idle
Mem: 72M Active, 13G Inact, 30G Wired, 81G Free
ARC: 20G Total, 12G MFU, 6304M MRU, 1853K Anon, 369M Header, 1685M Other
_ 17G Compressed, 36G Uncompressed, 1.81:1 Ratio, 1238M Overhead
Swap: 4096M Total, 4096M Free

The compression ratio is logical_size / actual_size.

Sponsored By: FreeBSD Storage Summit

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
allanjude retitled this revision from to Add a summary line of the ZFS Compressed ARC to top(1).Feb 28 2017, 5:33 AM
allanjude updated this object.
allanjude edited the test plan for this revision. (Show Details)
allanjude added reviewers: jpaetzel, avg, smh, imp, jhb.
bcr added a subscriber: bcr.Feb 28 2017, 10:43 AM

No comments about the actual change other than I really want to see this going into the tree. Thanks for working on it.

I considered putting it behind a flag, but, decided against it.

jpaetzel accepted this revision.Feb 28 2017, 2:33 PM
This revision is now accepted and ready to land.Feb 28 2017, 2:33 PM
smh added a comment.EditedFeb 28 2017, 4:54 PM

Some may find it useful if it was bit shorter, currently its 82 chars in the example.

May be change "Compressed ARC:" to just "ARC:" as the detail gives whats compressed and whats not?

Edit: Or not as I just spotted the line above is already just ARC :(

In D9829#202940, @smh wrote:

Some may find it useful if it was bit shorter, currently its 82 chars in the example.

May be change "Compressed ARC:" to just "ARC:" as the detail gives whats compressed and whats not?

Edit: Or not as I just spotted the line above is already just ARC :(

I didn't notice it was that wide, yes, let me fix that.

jhb added a comment.Feb 28 2017, 9:10 PM

I agree with shortening the line a bit so it fits in 80 cols. If you are worried about duplicating "ARC:" you could perhaps just use a whitespace prefix so you end up with something like:

Mem: 754M Active, 836M Inact, 75M Laundry, 3761M Wired, 10G Free
ARC: 2476M Total, 914M MFU, 1302M MRU, 1696K Anon, 140M Header, 118M Other
     1899M Compressed, 6065M Uncompressed, 2.45:1 Ratio, 318M Overhead
Swap: 3072M Total, 3072M Free

Also, "Sponsored by:" usually implies funding, but "Suggested by:" might work.

smh added a comment.Feb 28 2017, 11:19 PM
In D9829#203014, @jhb wrote:

I agree with shortening the line a bit so it fits in 80 cols. If you are worried about duplicating "ARC:" you could perhaps just use a whitespace prefix so you end up with something like:

Mem: 754M Active, 836M Inact, 75M Laundry, 3761M Wired, 10G Free
ARC: 2476M Total, 914M MFU, 1302M MRU, 1696K Anon, 140M Header, 118M Other
     1899M Compressed, 6065M Uncompressed, 2.45:1 Ratio, 318M Overhead
Swap: 3072M Total, 3072M Free

I like this idea, looks nice

allanjude updated this revision to Diff 25858.Mar 2 2017, 2:43 AM

Update the output to fit within 80 columns

Use jhb@'s suggestion and don't bother with a header

CPU: 0.1% user, 0.0% nice, 0.0% system, 0.0% interrupt, 99.9% idle
Mem: 72M Active, 13G Inact, 30G Wired, 81G Free
ARC: 20G Total, 12G MFU, 6304M MRU, 1853K Anon, 369M Header, 1685M Other

17G Compressed, 36G Uncompressed, 1.81:1 Ratio, 1238M Overhead

Swap: 4096M Total, 4096M Free

This revision now requires review to proceed.Mar 2 2017, 2:43 AM
allanjude updated this object.Mar 2 2017, 2:46 AM
allanjude updated this object.
This revision is now accepted and ready to land.Mar 7 2017, 2:26 PM
smh accepted this revision.Mar 7 2017, 4:39 PM
jpaetzel accepted this revision.Mar 7 2017, 4:45 PM
imp accepted this revision.Mar 7 2017, 4:47 PM
This revision was automatically updated to reflect the committed changes.