Solved arcstat(1)

arcstat(1)

I have the manual page but the command is not found.

Will it be found if I boot with openzfs instead of zfs?

Code:
% date ; uname -v
Sun  9 May 2021 01:12:06 BST
FreeBSD 14.0-CURRENT #94 main-n246499-097e8701c9f: Thu May  6 07:26:23 BST 2021     root@mowa219-gjp4-8570p:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG
% grep -i zfs_load /boot/loader.conf
zfs_load="YES"
openzfs_load="NO"
% which arcstat
arcstat: Command not found.
% man arcstat | head
ARCSTAT(1)              FreeBSD General Commands Manual             ARCSTAT(1)



NAME
       arcstat - report ZFS ARC and L2ARC statistics

SYNOPSIS
       arcstat [-havxp] [-f field[,field]...] [-o file] [-s string] [interval [count]]

% pkg provides arcstat
Name    : openzfs-2021030100
Desc    : OpenZFS userland for FreeBSD
Repo    : FreeBSD
Filename: usr/local/man/man1/arcstat.1.gz

Name    : munin-contrib-g.2019.06.28_1
Desc    : Contributed plugins and other for munin
Repo    : FreeBSD
Filename: usr/local/share/examples/munin-contrib/plugins/zfs/zfsarcstats-counters
          usr/local/share/examples/munin-contrib/plugins/zfs/zfs_arcstats
          usr/local/share/examples/munin-contrib/plugins/zfs/example-graphs/zfs_arcstats-2.png
          usr/local/share/examples/munin-contrib/plugins/zfs/example-graphs/zfs_arcstats-1.png
% pkg info -x openzfs
openzfs-2021030100
openzfs-kmod-2021030100
%
 
arcstat(1) doesn't come with the default port settings:
Code:
/usr/ports/sysutils/openzfs # make showconfig
===> The following configuration options are available for openzfs-2021030100:
     DEBUG=off: Build with debugging support
     PYTHON=off: Build the pyzfs library, arc_summary, arcstat, and dbufstat utilities
     TESTS=off: Install the ZFS Test Suite
 
… It is in the package list.

I have just the manual page, as explained above.

Code:
root@mowa219-gjp4-8570p:~ # pkg info --list openzfs | grep arcstat
        /usr/local/man/man1/arcstat.1.gz
root@mowa219-gjp4-8570p:~ #

… doesn't come with the default port settings: …

Thanks, will this Makefile.local have the required effect?

Code:
% cat /usr/local/poudriere/ports/default/sysutils/openzfs/Makefile.local 
PYTHON=on
% pkg info -x poudriere
poudriere-devel-3.3.99.20210303_2
%
 
If you are building the ports via poudriere, then I believe that will work.

A little bit confused about some of the info here:
the uname output indicates the system is runn 14-CURRENT, is that correct? Are you doing local builds of -CURRENT?
13.0-RELEASE also uses OpenZFS, but it is built as part of the kernel, pkg info | grep -i zfs does not show anything.
Also your loader.conf having zfs_load=YES and openzfs_load=NO

So I'm confused as to how you got this way on 14-CURRENT to building the openzfs port.

If you are looking for stats from ZFS, there is a port sysutils/zfs-stats that works on ZFS from FreeBSD < 13 (old ZFS) and FreeBSD >= 13 (OpenZFS) that gives a lot of information.

I'm not trying to stop you from whatever it is you are wanting to do, but something feels a bit off.

Code:
 zfs-stats
Usage: /usr/local/bin/zfs-stats [-ABDHLMSabdhus]

-a    : all statistics (-IMAELZDs)

-I    : general system information
-M    : system memory information
-s    : sysctl ZFS tunables
-d    : descriptions for ZFS tunables
-t    : alternate sysctl layout (arc_summary.pl)

-A    : ARC summary
-E    : ARC efficiency
-D    : VDEV cache statistics
-L    : L2 ARC statistics
-O    : dataset operations statistics
-Z    : DMU (zfetch) statistics

-R    : display raw numbers and bytes
-V    : display program version and exit
-h    : display this (help) message
 
Last edited by a moderator:
zfs_load=YES and openzfs_load=NO

Yep, that's as my /boot/loader.conf was before I asked about booting with openzfs i.e. openzfs_load=YES

sysutils/zfs-stats

Thanks, I installed this a couple of months ago.


-CURRENT, is that correct?

Correct.

local builds of -CURRENT?

Yep, I build and install from source.

whatever it is you are wanting

Essentially, I'd like to run arcstat.
 
Ahh. Ok. I'd be inclined to simply:
cd /usr/ports/sysutils/openzfs && make clean && make configure && make, then "find . -name arcstat -print" and copy that to somewhere.

But it sounds like the make/install of the man page isn't wrapped correctly by the #defines.
 
If you are building the ports via poudriere, then I believe that will work. …

Unfortunately not, as far as I can tell:

Code:
root@mowa219-gjp4-8570p:~ # pkg upgrade -f -r poudriere openzfs
Updating poudriere repository catalogue...
poudriere repository is up to date.
All repositories are up to date.
Updating database digests format: 100%
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be REINSTALLED:
        openzfs-2021030100 [poudriere]

Number of packages to be reinstalled: 1

Proceed with this action? [y/N]: y
[1/1] Reinstalling openzfs-2021030100...
[1/1] Extracting openzfs-2021030100: 100%
root@mowa219-gjp4-8570p:~ # pkg info --list openzfs | grep arcstat
        /usr/local/man/man1/arcstat.1.gz
root@mowa219-gjp4-8570p:~ # which arcstat
arcstat: Command not found.
root@mowa219-gjp4-8570p:~ #
 

Attachments

Try what I suggested about doing it completely manually; make sure the config options you think you need build it.
 
How did you check?

Much the same as before,

Code:
% pkg info openzfs | grep Installed
Installed on   : Sun May  9 13:38:39 2021 BST
% which arcstat
arcstat: Command not found.
% pkg info --list openzfs | grep arcstat
        /usr/local/man/man1/arcstat.1.gz
%
 
Builds fine on 12.2-RELEASE:
Code:
/usr/ports/sysutils/openzfs # make showconfig
===> The following configuration options are available for openzfs-2021030100:
     DEBUG=off: Build with debugging support
     PYTHON=on: Build the pyzfs library, arc_summary, arcstat, and dbufstat utilities
     TESTS=off: Install the ZFS Test Suite
===> Use 'make config' to modify these settings

# pkg list | grep arcstat
/usr/local/bin/arcstat
/usr/local/man/man1/arcstat.1.gz

# pkg info -E openzfs
openzfs-2021030100
 
But it's unusable:

Code:
# arcstat
env: python3: No such file or directory

/usr/local/bin/arcstat
#!/usr/bin/env python3

Corrected --> #!/usr/bin/env python3.8

# arcstat
    time  read  miss  miss%  dmis  dm%  pmis  pm%  mmis  mm%  size     c  avail
Traceback (most recent call last):
  File "/usr/local/bin/arcstat", line 554, in <module>
    main()
  File "/usr/local/bin/arcstat", line 538, in main
    calculate()
  File "/usr/local/bin/arcstat", line 485, in calculate
    v["el2mfu"] = d["evict_l2_eligible_mfu"] / sint
KeyError: 'evict_l2_eligible_mfu'


#!/usr/bin/env python3.7

# arcstat
Traceback (most recent call last):
  File "/usr/local/bin/arcstat", line 148, in
    import sysctl

Same with arc_summary and dbufstat, no wonder PYTHON=off.
 
From <https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=244204#c17>:

… after removing poudriere-devel then installing poudriere, the (automatically reinstalled) dialog4ports ran without a segmentation fault. …

poudriere options -cn sysutils/openzfs

– succeeded, then a build with poudriere and:

pkg upgrade -f -r poudriere openzfs

– success.

Code:
% date ; uptime
Sun  9 May 2021 15:29:14 BST
3:29p.m.  up  9:53, 6 users, load averages: 0.84, 1.01, 1.27
% arcstat -f time,hit%,dh%,ph%,mh% 1
    time  hit%  dh%  ph%  mh%
15:29:16     0    0    0    0
15:29:17    97   97    0   96
15:29:18   100  100    0  100
15:29:19   100  100    0  100
15:29:20   100  100    0  100
15:29:21    96   96    0   98
15:29:22    40   40    0   66
15:29:23    77   79    0   91
15:29:24    60   60    0  100
15:29:25   100  100    0  100
15:29:26    98   98    0  100
15:29:27    99   99    0   99
15:29:28   100  100    0  100
15:29:29    99   99  100  100
15:29:30    76   81    0   96
15:29:31    83   84    0   96
15:29:32    82   91    0   98
15:29:33    76   75   96   99
15:29:34    75   75    0   99
15:29:35    94   91  100  100
15:29:36    86   87    0  100
15:29:37    89   85  100  100
15:29:38    88   88    0   95
15:29:39    86   83   98   99
15:29:40    81   81   33   99
15:29:41    99   99  100  100
15:29:42    78   83    9   99
15:29:43    86   89   77   99
15:29:44    85   86   75   99
15:29:45   100  100  100  100
15:29:46    92   93    0   99
15:29:47    91   90   94   99
15:29:48    89   90    0   99
15:29:49    87   91   75  100
15:29:50    71   91    3   99
15:29:51    91   95   68   99
15:29:52    66   79    6   93
15:29:53    87   90   76   99
15:29:54    87   93    5  100
15:29:55    95   94   98   99
15:29:56    83   96    0  100
15:29:57    88   92   72   99
15:29:58    71   72    0   88
15:29:59    83   88   58   99
15:30:00    84   85   71   99
15:30:01    90   96   66   99
15:30:02    86   88   40   99
    time  hit%  dh%  ph%  mh%
15:30:03    89   87   94   99
15:30:04    76   78   44   99
15:30:05    85   93   63  100
15:30:06    97   97    0   97
15:30:07    95   95  100   95
15:30:08    95   95   75   95
15:30:09    95   95   96   95
15:30:10    95   95    0   95
15:30:11    95   95   97   95
15:30:12    95   95    0   95
15:30:13    96   96   98   96
15:30:14    95   95    0   95
15:30:15    95   95   96   95
15:30:16    95   95    0   95
15:30:17    94   94   99   95
15:30:18    94   94    0   95
15:30:19    95   95  100   95
15:30:20    96   96    0   96
15:30:21    96   96   99   96
15:30:22    95   95    0   95
15:30:23    95   95  100   95
15:30:24    94   94    0   94
15:30:25    88   95   62   98
15:30:26    81   82    0   97
15:30:27    94   91   99  100
15:30:28    73   73    0   93
15:30:29    95   94   99   99
15:30:30    87   87    0  100
15:30:31    97   96  100  100
15:30:32    86   87    0   98
15:30:33    97   95  100  100
15:30:34    99   99  100  100
15:30:35    93   91   97   99
15:30:36    84   85    0   97
15:30:37    97   97   99   99
15:30:38    78   79    0  100
15:30:39    89   87   99   98
15:30:40    82   82  100   97
15:30:41    94   93   97   99
15:30:42    95   93  100  100
15:30:43    84   86    0   97
15:30:44    92   90  100   99
15:30:45    77   77    0  100
15:30:46    92   92    0  100
15:30:47    94   91  100   99
15:30:48    90   87   99   99
15:30:49    80   81    0   98
    time  hit%  dh%  ph%  mh%
15:30:50    91   89   99  100
15:30:51    88   88    0   98
15:30:52    93   91  100  100
15:30:53    88   89    0  100
15:30:54    93   90  100   99
15:30:55    89   89   66   99
15:30:56    94   93  100   99
15:30:57    91   91   42   99
15:30:58    89   87   99   99
15:30:59    78   79    0   97
15:31:00    85   83  100   99
15:31:01    83   83    0   99
15:31:02    85   82   98  100
15:31:03    78   78    0  100
15:31:04    90   87  100   99
15:31:06    90   91   25   92
15:31:07    93   92   99  100
15:31:08    74   74    0  100
15:31:09    88   83   99  100
15:31:10    71   73    0  100
15:31:11    90   86   98   99
15:31:12    88   88    0  100
15:31:13    90   87   96  100
15:31:14    71   71    0  100
15:31:15    91   87   99  100
15:31:16    88   88    0   99
15:31:17    95   94  100  100
15:31:18    98   98    0   99
15:31:19    87   83   99  100
15:31:20    72   72    0  100
15:31:21    98   98  100  100
15:31:22    88   89    0  100
15:31:23    89   87   95  100
15:31:24    71   71    0  100
15:31:25    92   89   98  100
15:31:26    76   79   10   99
15:31:27    93   92   96   99
15:31:28    75   75    0  100
15:31:29    89   85   99   99
15:31:30    77   77  100   99
15:31:31    89   87   96   99
15:31:32    85   85    0   98
15:31:33    89   86   99   99
15:31:34    70   70    0   98
15:31:35    90   87   99   99
15:31:36    78   79    0   97
15:31:37    92   93   88   99
15:31:38    78   83    0   99
15:31:39    93   93   95   99
15:31:40   100  100    0  100
15:31:41   100  100  100  100
15:31:42    94   95    0   98
15:31:43    99   98  100  100
15:31:44    64   64    0   81
^C
%

Code:
% cat /usr/local/etc/poudriere.d/options/sysutils_openzfs/options
# This file is auto-generated by 'make config'.
# Options for openzfs-2021030100
_OPTIONS_READ=openzfs-2021030100
_FILE_COMPLETE_OPTIONS_LIST=DEBUG PYTHON TESTS
OPTIONS_FILE_UNSET+=DEBUG
OPTIONS_FILE_SET+=PYTHON
OPTIONS_FILE_UNSET+=TESTS
%
 
% arcstat -f time,hit%,dh%,ph%,mh% 1
time hit% dh% ph% mh%
15:29:16 0 0 0 0
Code:
# Options for openzfs-2021030100
_OPTIONS_READ=openzfs-2021030100
_FILE_COMPLETE_OPTIONS_LIST=DEBUG PYTHON TESTS
OPTIONS_FILE_UNSET+=DEBUG
OPTIONS_FILE_SET+=PYTHON
OPTIONS_FILE_UNSET+=TESTS

Is that all or are there any additional settings somewhere else? If there is don't hold back why there is a working 'arcstat' on 14.0-CURRENT but not on 12.2-RELEASE.
 
Back
Top