Runtime Stats

From XFS.org
Jump to: navigation, search

This page intends to describe info available from /proc/fs/xfs/stat

Contents


Overview

Being advanced filesystem, XFS provides some internal statistics to user's view, which can be helpful on debugging/understanding IO characteristics and optimizing performance. Data available in /proc/fs/xfs/stat as dump of variables values grouped by type of information it holds.

output example

extent_alloc 4260849 125170297 4618726 131131897
abt 29491162 337391304 11257328 11133039
blk_map 381213360 115456141 10903633 69612322 7448401 507596777 0
bmbt 771328 6236258 602114 86646
dir 21253907 6921870 6969079 779205554
trans 126946406 38184616 6342392
ig 17754368 2019571 102 15734797 0 15672217 3962470
log 129491915 3992515264 458018 153771989 127040250
push_ail 171473415 0 6896837 3324292 8069877 65884 1289485 0 22535 7337
xstrat 4140059 0
rw 1595677950 1046884251
attr 194724197 0 7 0
icluster 20772185 2488203 13909520
vnodes 62578 15959666 0 0 15897088 15897088 15897088 0
buf 2090581631 1972536890 118044776 225145 9486625 0 0 2000152616 809762
xpc 6908312903680 67735504884757 19760115252482
debug 0

Fields table

Numbers shown in output example above are presented as table of value names. Cells with red background lack meaningful description and should be edited.

extent_alloc - Extent Allocation xs_allocx xs_allocb xs_freex xs_freeb
abt - Allocation Btree xs_abt_lookup xs_abt_compare xs_abt_insrec xs_abt_delrec
blk_map - Block Mapping xs_blk_mapr xs_blk_mapw xs_blk_unmap xs_add_exlist xs_del_exlist xs_look_exlist xs_cmp_exlist
bmbt - Block Map Btree xs_bmbt_lookup xs_bmbt_compare xs_bmbt_insrec xs_bmbt_delrec
dir - Directory Operations xs_dir_lookup xs_dir_create xs_dir_remove xs_dir_getdents
trans - Transactions xs_trans_sync xs_trans_async xs_trans_empty
ig - Inode Operations xs_ig_attempts xs_ig_found xs_ig_frecycle xs_ig_missed xs_ig_dup xs_ig_reclaims xs_ig_attrchg
log - Log Operations xs_log_writes xs_log_blocks xs_log_noiclogs xs_log_force xs_log_force_sleep
push_ail - Tail-Pushing Stats xs_try_logspace xs_sleep_logspace xs_push_ail xs_push_ail_success xs_push_ail_pushbuf xs_push_ail_pinned xs_push_ail_locked xs_push_ail_flushing xs_push_ail_restarts xs_push_ail_flush
xstrat - IoMap Write Convert xs_xstrat_quick xs_xstrat_split
rw - Read/Write Stats xs_write_calls xs_read_calls
attr - Attribute Operations xs_attr_get xs_attr_set xs_attr_remove xs_attr_list
icluster - Inode Clustering xs_iflush_count xs_icluster_flushcnt xs_icluster_flushinode
vnodes - Vnode Statistics vn_active vn_alloc vn_get vn_hold vn_rele vn_reclaim vn_remove vn_free
buf - Buf Statistics xb_get xb_create xb_get_locked xb_get_locked_waited xb_busy_locked xb_miss_locked xb_page_retries xb_page_found xb_get_read
xpc - eXtended Precision Counters xs_xstrat_bytes xs_write_bytes xs_read_bytes


Fields description:

extent_alloc - Extent Allocation

  • xs_allocx (xfs.allocs.alloc_extent)
    • Number of file system extents allocated over all XFS filesystems.
  • xs_allocb (xfs.allocs.alloc_block)
    • Number of file system blocks allocated over all XFS filesystems.
  • xs_freex (xfs.allocs.free_extent)
    • Number of file system extents freed over all XFS filesystems.
  • xs_freeb (xfs.allocs.free_block)
    • Number of file system blocks freed over all XFS filesystems.

abt - Allocation Btree

  • xs_abt_lookup (xfs.alloc_btree.lookup)
    • Number of lookup operations in XFS filesystem allocation btrees.
  • xs_abt_compare (xfs.alloc_btree.compare)
    • Number of compares in XFS filesystem allocation btree lookups.
  • xs_abt_insrec (xfs.alloc_btree.insrec)
    • Number of extent records inserted into XFS filesystem allocation btrees.
  • xs_abt_delrec (xfs.alloc_btree.delrec)
    • Number of extent records deleted from XFS filesystem allocation btrees.

blk_map - Block Mapping

  • xs_blk_mapr (xfs.block_map.read_ops)
    • Number of block map for read operations performed on XFS files.
  • xs_blk_mapw (xfs.block_map.write_ops)
    • Number of block map for write operations performed on XFS files.
  • xs_blk_unmap (xfs.block_map.unmap)
    • Number of block unmap (delete) operations performed on XFS files.
  • xs_add_exlist (xfs.block_map.add_exlist)
    • Number of extent list insertion operations for XFS files.
  • xs_del_exlist (xfs.block_map.del_exlist)
    • Number of extent list deletion operations for XFS files.
  • xs_look_exlist (xfs.block_map.look_exlist)
    • Number of extent list lookup operations for XFS files.
  • xs_cmp_exlist (xfs.block_map.cmp_exlist)
    • Number of extent list comparisons in XFS extent list lookups.

bmbt - Block Map Btree

  • xs_bmbt_lookup (xfs.bmap_btree.lookup)
    • Number of block map btree lookup operations on XFS files.
  • xs_bmbt_compare (xfs.bmap_btree.compare)
    • Number of block map btree compare operations in XFS block map lookups.
  • xs_bmbt_insrec (xfs.bmap_btree.insrec)
    • Number of block map btree records inserted for XFS files.
  • xs_bmbt_delrec (xfs.bmap_btree.delrec)
    • Number of block map btree records deleted for XFS files.

dir - Directory Operations

  • xs_dir_lookup (xfs.dir_ops.lookup)
    • This is a count of the number of file name directory lookups in XFS filesystems. It counts only those lookups which miss in the operating system's directory name lookup cache and must search the real directory structure for the name in question. The count is incremented once for each level of a pathname search that results in a directory lookup.
  • xs_dir_create (xfs.dir_ops.create)
    • This is the number of times a new directory entry was created in XFS filesystems. Each time that a new file, directory, link, symbolic link, or special file is created in the directory hierarchy the count is incremented.
  • xs_dir_remove (xfs.dir_ops.remove)
    • This is the number of times an existing directory entry was removed in XFS filesystems. Each time that a file, directory, link, symbolic link, or special file is removed from the directory hierarchy the count is incremented.
  • xs_dir_getdents (xfs.dir_ops.getdents)
    • This is the number of times the XFS directory getdents operation was performed. The getdents operation is used by programs to read the contents of directories in a file system independent fashion. This count corresponds exactly to the number of times the getdents(2) system call was successfully used on an XFS directory.

trans - Transactions

  • xs_trans_sync (xfs.transactions.sync)
    • This is the number of meta-data transactions which waited to be committed to the on-disk log before allowing the process performing the transaction to continue. These transactions are slower and more expensive than asynchronous transactions, because they force the in memory log buffers to be forced to disk more often and they wait for the completion of the log buffer writes. Synchronous transactions include file truncations and all directory updates when the file system is mounted with the 'wsync' option.
  • xs_trans_async (xfs.transactions.async)
    • This is the number of meta-data transactions which did not wait to be committed to the on-disk log before allowing the process performing the transaction to continue. These transactions are faster and more efficient than synchronous transactions, because they commit their data to the in memory log buffers without forcing those buffers to be written to disk. This allows multiple asynchronous transactions to be committed to disk in a single log buffer write. Most transactions used in XFS file systems are asynchronous.
  • xs_trans_empty (xfs.transactions.empty)
    • This is the number of meta-data transactions which did not actually change anything. These are transactions which were started for some purpose, but in the end it turned out that no change was necessary.

ig - Inode Operations

  • xs_ig_attempts (xfs.inode_ops.ig_attempts)
    • This is the number of times the operating system looked for an XFS inode in the inode cache. Whether the inode was found in the cache or needed to be read in from the disk is not indicated here, but this can be computed from the ig_found and ig_missed counts.
  • xs_ig_found (xfs.inode_ops.ig_found)
    • This is the number of times the operating system looked for an XFS inode in the inode cache and found it. The closer this count is to the ig_attempts count the better the inode cache is performing.
  • xs_ig_frecycle (xfs.inode_ops.ig_frecycle)
    • This is the number of times the operating system looked for an XFS inode in the inode cache and saw that it was there but was unable to use the in memory inode because it was being recycled by another process.
  • xs_ig_missed (xfs.inode_ops.ig_missed)
    • This is the number of times the operating system looked for an XFS inode in the inode cache and the inode was not there. The further this count is from the ig_attempts count the better.
  • xs_ig_dup (xfs.inode_ops.ig_dup)
    • This is the number of times the operating system looked for an XFS inode in the inode cache and found that it was not there but upon attempting to add the inode to the cache found that another process had already inserted it.
  • xs_ig_reclaims (xfs.inode_ops.ig_reclaims)
    • This is the number of times the operating system recycled an XFS inode from the inode cache in order to use the memory for that inode for another purpose. Inodes are recycled in order to keep the inode cache from growing without bound. If the reclaim rate is high it may be beneficial to raise the vnode_free_ratio kernel tunable variable to increase the size of the inode cache.
  • xs_ig_attrchg (xfs.inode_ops.ig_attrchg)
    • This is the number of times the operating system explicitly changed the attributes of an XFS inode. For example, this could be to change the inode's owner, the inode's size, or the inode's timestamps.

log - Log Operations

  • xs_log_writes (xfs.log.writes)
    • This variable counts the number of log buffer writes going to the physical log partitions of all XFS filesystems. Log data traffic is proportional to the level of meta-data updating. Log buffer writes get generated when they fill up or external syncs occur.
  • xs_log_blocks (xfs.log.blocks)
    • This variable counts (in 512-byte units) the information being written to the physical log partitions of all XFS filesystems. Log data traffic is proportional to the level of meta-data updating. The rate with which log data gets written depends on the size of internal log buffers and disk write speed. Therefore, filesystems with very high meta-data updating may need to stripe the log partition or put the log partition on a separate drive.
  • xs_log_noiclogs (xfs.log.noiclogs)
    • This variable keeps track of times when a logged transaction can not get any log buffer space. When this occurs, all of the internal log buffers are busy flushing their data to the physical on-disk log.
  • xs_log_force (xfs.log.force)
    • The number of times the in-core log is forced to disk. It is equivalent to the number of successful calls to the function xfs_log_force().
  • xs_log_force_sleep (xfs.log.force_sleep)
    • Value exported from the xs_log_force_sleep field of struct xfsstats.

push_ail - Tail-Pushing Stats

  • xs_try_logspace (xfs.log_tail.try_logspace)
    • Value from the xs_try_logspace field of struct xfsstats.
  • xs_sleep_logspace (xfs.log_tail.sleep_logspace)
    • Value from the xs_sleep_logspace field of struct xfsstats.
  • xs_push_ail (xfs.log_tail.push_ail.pushes)
    • The number of times the tail of the AIL is moved forward. It is equivalent to the number of successful calls to the function xfs_trans_push_ail().
  • xs_push_ail_success (xfs.log_tail.push_ail.success)
    • Value from xs_push_ail_success field of struct xfsstats.
  • xs_push_ail_pushbuf (xfs.log_tail.push_ail.pushbuf)
    • Value from xs_push_ail_pushbuf field of struct xfsstats.
  • xs_push_ail_pinned (xfs.log_tail.push_ail.pinned)
    • Value from xs_push_ail_pinned field of struct xfsstats.
  • xs_push_ail_locked (xfs.log_tail.push_ail.locked)
    • Value from xs_push_ail_locked field of struct xfsstats.
  • xs_push_ail_flushing (xfs.log_tail.push_ail.flushing)
    • Value from xs_push_ail_flushing field of struct xfsstats.
  • xs_push_ail_restarts (xfs.log_tail.push_ail.restarts)
    • Value from xs_push_ail_restarts field of struct xfsstats.
  • xs_push_ail_flush (xfs.log_tail.push_ail.flush)
    • Value from xs_push_ail_flush field of struct xfsstats.

xstrat - IoMap Write Convert

  • xs_xstrat_quick (xfs.xstrat.quick)
    • This is the number of buffers flushed out by the XFS flushing daemons which are written to contiguous space on disk. The buffers handled by the XFS daemons are delayed allocation buffers, so this count gives an indication of the success of the XFS daemons in allocating contiguous disk space for the data being flushed to disk.
  • xs_xstrat_split (xfs.xstrat.split)
    • This is the number of buffers flushed out by the XFS flushing daemons which are written to non-contiguous space on disk. The buffers handled by the XFS daemons are delayed allocation buffers, so this count gives an indication of the failure of the XFS daemons in allocating contiguous disk space for the data being flushed to disk. Large values in this counter indicate that the file system has become fragmented.

rw - Read/Write Stats

  • xs_write_calls
    • This is the number of write(2) system calls made to files in XFS file systems.
  • xs_read_calls
    • This is the number of read(2) system calls made to files in XFS file systems.

attr - Attribute Operations

  • xs_attr_get
    • The number of "get" operations performed on extended file attributes within XFS filesystems. The "get" operation retrieves the value of an extended attribute.
  • xs_attr_set
    • The number of "set" operations performed on extended file attributes within XFS filesystems. The "set" operation creates and sets the value of an extended attribute.
  • xs_attr_remove
    • The number of "remove" operations performed on extended file attributes within XFS filesystems. The "remove" operation deletes an extended attribute.
  • xs_attr_list
    • The number of "list" operations performed on extended file attributes within XFS filesystems. The "list" operation retrieves the set of extended attributes associated with a file.

icluster - Inode Clustering

  • xs_iflush_count
    • This is the number of calls to xfs_iflush which gets called when an inode is being flushed (such as by bdflush or tail pushing). xfs_iflush searches for other inodes in the same cluster which are dirty and flushable.
  • xs_icluster_flushcnt
    • Value from xs_icluster_flushcnt field of struct xfsstats.
  • xs_icluster_flushinode
    • This is the number of times that the inode clustering was not able to flush anything but the one inode it was called with.

vnodes - Vnode Statistics

  • vn_active
    • Number of vnodes not on free lists.
  • vn_alloc
    • Number of times vn_alloc called.
  • vn_get
    • Number of times vn_get called.
  • vn_hold
    • Number of times vn_hold called.
  • vn_rele
    • Number of times vn_rele called.
  • vn_reclaim
    • Number of times vn_reclaim called.
  • vn_remove
    • Number of times vn_remove called.

buf - Buf Statistics

  • xb_get
  • xb_create
  • xb_get_locked
  • xb_get_locked_waited
  • xb_busy_locked
  • xb_miss_locked
  • xb_page_retries
  • xb_page_found
  • xb_get_read

xpc - eXtended Precision Counters

  • xs_xstrat_bytes
    • This is a count of bytes of file data flushed out by the XFS flushing daemons.
  • xs_write_bytes
    • This is a count of bytes written via write(2) system calls to files in XFS file systems. It can be used in conjunction with the write_calls count to calculate the average size of the write operations to files in XFS file systems.
  • xs_read_bytes
    • This is a count of bytes read via read(2) system calls to files in XFS file systems. It can be used in conjunction with the read_calls count to calculate the average size of the read operations to files in XFS file systems.


NOTES

Many of these statistics are monotonically increasing counters, and of course are subject to counter overflow (the final three listed above are 64-bit values, all others are 32-bit values). As such they are of limited value in this raw form - if you are interested in monitoring throughput (e.g. bytes read/written per second), or other rates of change, you will be better served by investigating the PCP package more thoroughly - it contains a number of performance analysis tools which can help in this regard.

External links

  1. Linux kernel sources: xfs_stats.h
  2. xfs_stats.pl - script to parse and display xfs statistics
  3. Developers on irc

Personal tools