监控项说明
JuiceFS 为每个文件系统提供一个 Prometheus API,本章仅罗列和介绍部分常用监控指标,完整列表请访问控制台,在「监控」页面点击「Prometheus API」,直接查看接口数据。
部分指标由于子项众多,并未完整列出,比如 juicefs_fuse_ops_lookup、juicefs_fuse_ops_open 就统一收录在 juicefs_fuse_ops_<name>。
另外,本章介绍的指标全部冠以 juicefs_ 前缀,在私有部署的 Grafana 中并没有这个统一前缀,比如:
- juicefs_trash_size叫作- jfs_stat_trash_size
- juicefs_operationDuration叫作- mount_operationDuration
因此,如果你关心的指标没搜到,试试掐头去尾重新搜索其中的部分关键字。
文件系统
标签
| 名称 | 说明 | 
|---|---|
| name或volume | 文件系统名 | 
| path或subdir | 目录路径 | 
指标
| 名称 | 说明 | 单位 | 
|---|---|---|
| juicefs_size | 文件系统大小 | 字节 | 
| juicefs_inodes | inodes 数量 | |
| juicefs_trash_size | 回收站文件大小 | 字节 | 
| juicefs_trash_files | 回收站文件数量 | |
| 私有部署 jfs_stat_delay_bytes | 延迟删除的对象存储大小(文件已删除,但对象存储的部分还在等待删除) | byte | 
| 私有部署 jfs_stat_delay_chunks | 延迟删除的 chunk 数量 | |
| juicefs_quota_size或volume_quota_size_usage | 目录配额中已使用的数据量百分比 | |
| juicefs_quota_files或volume_quota_inodes_usage | 目录配额中已使用的文件数量百分比 | 
客户端
标签
| 名称 | 说明 | 
|---|---|
| name或subdir | 文件系统名 | 
| host | 客户端所在主机名 | 
| ip | 客户端所在主机 IP 地址 | 
| mountpoint | 挂载点路径 | 
| cache_group | 缓存组名称 | 
| cache_group_role | 缓存组角色,可选值有 Provider、Consumer。如果没有加入任何缓存组,  这个标签的值为空。 | 
指标
操作系统
| 名称 | 说明 | 单位 | 
|---|---|---|
| juicefs_uptime | 运行时长 | 秒 | 
| juicefs_cpuusage | 累计 CPU 使用时间 | 微秒 | 
| juicefs_memusage | 当前占用 RSS 内存量 | 字节 | 
| juicefs_heapSys | Go 申请的内存总量,同 Sys | 字节 | 
| juicefs_heapInuse | 同 HeapInuse | 字节 | 
| juicefs_handles | 客户端持有文件句柄数 | |
| juicefs_threads | 客户端 Go 线程数量,详见 ThreadCreateProfile | |
| juicefs_goroutines | 客户端 Go 协程数量 | |
| juicefs_gcPause | 同 PauseTotalNs | 纳秒 | 
元数据服务
| 名称 | 说明 | 单位 | 
|---|---|---|
| juicefs_metaDuration | 元数据服务请求延迟 | 微秒 | 
| juicefs_metaRequest | 元数据服务请求数 | |
| juicefs_meta | meta前缀的指标汇总,不单独参考 | |
| juicefs_meta_operations | 元数据操作量 | |
| juicefs_meta_bytes_sent | 元数据服务请求发送流量 | 字节 | 
| juicefs_meta_bytes_received | 元数据服务请求接受流量 | 字节 | 
| juicefs_meta_packets_sent | 元数据服务请求包发送流量 | |
| juicefs_meta_packets_received | 元数据服务请求包接受流量 | |
| juicefs_meta_reconnects | 元数据服务重连次数 | |
| juicefs_meta_usec_ping | 元数据服务 ping 延迟 | 微秒 | 
文件操作
| 名称 | 说明 | 单位 | 
|---|---|---|
| juicefs_read_bytes | 读取总量,与 juicefs_get_bytes不同,这是文件操作层级的统计 | 字节 | 
| juicefs_write_bytes | 写入总量,与 juicefs_put_bytes不同,这是文件操作层级的统计 | 字节 | 
| juicefs_operations | 文件操作总量 | |
| juicefs_operationDuration | 文件操作延迟,体现了应用通过 JuiceFS 读写文件所耗费的时间 | 微秒 | 
| juicefs_operationErrors | 文件操作错误的数量,可以通过该指标监控客户端的读写出错 | |
| juicefs_operationSlows | 文件操作慢请求(超过 10 秒)的数量 | |
| juicefs_operationInterrupted | 文件操作中断的数量 | |
| juicefs_fuse_ops | 文件操作总量(分类再汇总统计,与 juicefs_operations有少量差别) | |
| juicefs_fuse_ops_<name> | 单个文件操作的计数,例如 getattr、lookup、open | |
| juicefs_openfiles | 打开的文件数 | 
缓冲区
| 名称 | 说明 | 单位 | 
|---|---|---|
| juicefs_totalBufferUsed | 读写缓冲区已使用大小 | 字节 | 
| juicefs_readBufferUsed | 读缓冲区已使用大小 | 字节 | 
| juicefs_readWastedBytes | 预读的数据中未被实际读取的量,导致浪费的原因有很多,可以使用 juicefs stats --schema=fa -l 1 <mount point>命令来输出更详细的读放大数据,排查具体原因。 | 字节 | 
| juicefs_readahead_bytes | 将预读的数据从缓存区写入内核页缓存的总量 | 字节 | 
元数据缓存
| 名称 | 说明 | 单位 | 
|---|---|---|
| juicefs_meta_dircache | 命中客户端元数据缓存的所有操作总量 | |
| juicefs_meta_dircache_<name> | 命中客户端元数据缓存的各种操作的总量,例如 getattr、open、lookup | |
| juicefs_meta_dircache<zone-number>_dirs | 分区号为 <zone-number>(如0、1)的客户端元数据缓存的目录数量 | |
| juicefs_meta_dircache<zone-number>_inodes | 分区号为 <zone-number>(如0、1)的客户端元数据缓存的 inodes 数量 | |
| juicefs_symlink_cache | 所有符号链接缓存操作的数量 | |
| juicefs_symlink_cache_<name> | 具体的符号链接缓存操作的数量,如 inserts、search_hits、search_misses | 
本地缓存
建议先阅读「缓存」文档,帮助了解以下监控指标的具体含义。
| 名称 | 说明 | 单位 | 
|---|---|---|
| juicefs_blockcache_blocks | 缓存块的总个数 | |
| juicefs_blockcache_bytes | 缓存块的总大小 | 字节 | 
| juicefs_blockcache_capacity | 缓存盘的总容量 | 字节 | 
| juicefs_blockcache_errors | 访问缓存盘的总错误数 | |
| juicefs_blockcache_pri0 | 优先级为 0 的缓存块的总大小 | 字节 | 
| juicefs_blockcache_pri1 | 优先级为 1 的缓存块的总大小 | 字节 | 
| juicefs_blockcache_pri2 | 优先级为 2 的缓存块的总大小 | 字节 | 
| juicefs_blockcache_pri3 | 优先级为 3 的缓存块的总大小 | 字节 | 
| juicefs_blockcache_hits | 命中缓存块的总次数 | |
| juicefs_blockcache_hitBytes | 命中缓存块的总大小 | 字节 | 
| juicefs_blockcache_miss | 没有命中缓存块的总次数 | |
| juicefs_blockcache_missBytes | 没有命中缓存块的总大小 | 字节 | 
| juicefs_blockcache_evict | 淘汰缓存块的总次数 | |
| juicefs_blockcache_evictBytes | 淘汰缓存块的总大小 | 字节 | 
| juicefs_blockcache_evictDur | 淘汰缓存块的时间 | 微秒 | 
| juicefs_blockcache_expired | 过期的缓存块总个数(参考 --cache-expire选项) | |
| juicefs_blockcache_expiredBytes | 过期的缓存块总大小(参考 --cache-expire选项) | 字节 | 
| juicefs_blockcache_readDuration | 从缓存盘读取缓存块的延迟 | 微秒 | 
| juicefs_blockcache_directReads | 从缓存盘直接读取(Direct I/O)的总次数 | |
| juicefs_blockcache_directReadErrors | 从缓存盘直接读取(Direct I/O)的总错误数 | |
| juicefs_blockcache_write | 写到缓存盘的缓存块(包括读缓存块和写缓存块)的总个数 | |
| juicefs_blockcache_writeBytes | 写到缓存盘的缓存块(包括读缓存块和写缓存块)总大小 | 字节 | 
| juicefs_blockcache_writeDuration | 将缓存块(包括读缓存块和写缓存块)写到缓存盘的延迟 | 微秒 | 
| juicefs_blockcache_stageBlocks | 等待上传的写缓存块的总个数 | |
| juicefs_blockcache_stageBlockBytes | 等待上传的写缓存块的总大小 | 字节 | 
| juicefs_blockcache_stageBlockDelay | 缓存块从写入缓存盘到开始上传至对象存储的等待时间 | 微秒 | 
| juicefs_blockcache_dropped | 当缓存队列满时,被丢弃的缓存块总个 数 | |
| juicefs_blockcache_droppedBytes | 当缓存队列满时,被丢弃的缓存块总大小 | 字节 | 
| juicefs_blockcache_prefetch | 预取(prefetch)的缓存块总个数 | |
| juicefs_blockcache_prefetchBytes | 预取(prefetch)的缓存块总大小 | 字节 | 
| juicefs_blockcache_extraBytes | 缓存没有命中时,需要从对象存储额外读取的数据总大小(即由于读放大产生的额外流量) | 字节 | 
分布式缓存
在缓存组中,读数据和写数据都会存在「发送方」和「接收方」的对应指标,下方也称作「服务端」、「客户端」。需要注意,这里的「服务端」指的是缓存组架构中,负责提供缓存服务的那一方,「客户端」指代读取数据的一方。在一个缓存组中,服务端和客户端可能是同一批 JuiceFS 客户端,但如果将缓存组单独部署成「独立缓存集群」,这时候客户端不对外共享自身的缓存数据,那么服务端和客户端就是分离的两批 JuiceFS 客户端。
比方说通过缓存组读取文件时,成员节点既会从其他成员接收数据,也会把自身的缓存数据共享、发送给其他成员。
分布式缓存监控指标中存在着两组互相对照的指标,分别对应不同的应用场景:
- remotecache_get和- remotecache_send:客户端的读、服务端的发送
- remotecache_put和- remotecache_receive:客户端往分布式缓存写数据、服务端收到的写数据。对于分布式缓存组而言,缓存写请求来自于开启- --fill-group-cache选项时,客户端的写请求贡献,或者分布式缓存发生节点间数据均衡
可想而知,正常情况下,如果对所有缓存组成员(同样包含 --no-sharing 节点)的监控指标进行求和,那么 remotecache_sendBytes 的大小应该与 remotecache_getBytes 大致相等。如果发现 remotecache_sendBytes 远大于 remotecache_getBytes,则代表收发存在异常,这时需要关注 remotecache_errors 指标,并且关注客户端日志,定位异常的来源。
| 名称 | 说明 | 单位 | 
|---|---|---|
| juicefs_remotecache_errors | 缓存组客户端所有请求的失败数 | |
| juicefs_remotecache_get | 缓存组客户端读数据的请求数 | |
| juicefs_remotecache_getBytes | 缓存组客户端读请求的数据大小 | 字节 | 
| juicefs_remotecache_getDuration | 缓存组客户端读请求延迟 | 微秒 | 
| juicefs_remotecache_send | 缓存组服务端发送数据的请求数 | |
| juicefs_remotecache_sendBytes | 缓存组服务端发送数据的大小 | 字节 | 
| juicefs_remotecache_sendDuration | 缓存组服务端发送数据的延迟,该延迟包含读取本地缓存的延迟( juicefs_blockcache_readDuration)。如果本地缓存没有命中,那么也包含对象存储的请求时间(juicefs_objectDuration_get),如果对象存储响应慢或者存在限速,都会导致该指标增大 | 微秒 | 
| juicefs_remotecache_put | 缓存组客户端写数据的请求数 | |
| juicefs_remotecache_putBytes | 缓存组客户端写请求的数据大小 | 字节 | 
| juicefs_remotecache_putDuration | 缓存组客户端写请求延迟 | 微秒 | 
| juicefs_remotecache_receive | 缓存组服务端接收数据的请求数 | |
| juicefs_remotecache_receiveBytes | 缓存组服务端接收数据的大小 | 字节 | 
| juicefs_remotecache_recvDuration | 缓存组服务端接收数据的延迟 | 微秒 | 
| juicefs_remotecache_delete | 缓存组客户端删除数据的请求数 | |
| juicefs_remotecache_warmup | 缓存组客户端预热数据的请求数 | |
| juicefs_remotecache_redirect新增自 v5.0.17 | 缓存组服务端重定向数据的次数 | |
| juicefs_remotecache_redirectBytes新增自 v5.0.17 | 缓存组服务端重定向数据的大小 | 字节 | 
| juicefs_blockcache_transfer | 数据重新均衡(rebalance)时发送到其它缓存节点的数据块个数 | |
| juicefs_blockcache_transferBytes | 数据重新均衡时发送到其它缓存节点的数据块总大小 | 字节 | 
| juicefs_blockcache_transferDur | 数据重新均衡时发送数据块到其它缓存节点的延迟 | 微秒 | 
| juicefs_blockcache_transferScanDur | 数据重新均衡时扫描所有数据块 key 的延迟 | 微秒 | 
对象存储
| 名称 | 说明 | 单位 | 
|---|---|---|
| juicefs_object | 对象存储总请求数 | |
| juicefs_object_get | 对象存储 GetObject请求数 | |
| juicefs_object_put | 对象存储 PutObject请求数 | |
| juicefs_object_delete | 对象存储 DeleteObject请求数 | |
| juicefs_object_copy | 对象存储 CopyObject请求数 | |
| juicefs_object_head | 对象存储 HeadObject请求数 | |
| juicefs_object_list | 对象存储 ListObjects请求数 | |
| juicefs_object_error | 对象存储请求失败数 | |
| juicefs_objectDuration | 对象存储所有请求延迟 | 微秒 | 
| juicefs_objectDuration_get | 对象存储 GetObject请求延迟 | 微秒 | 
| juicefs_objectDuration_getDelay | 对象存储 GetObject请求的程序内的排队等待时间,包括因为客户端令牌限速或者--max-downloads过低导致并发拥堵 | 微秒 | 
| juicefs_objectDuration_put | 对象存储 PutObject请求延迟 | 微秒 | 
| juicefs_objectDuration_putDelay | 对象存储 PutObject请求延迟,包含程序内的排队等待时间,包括因为客户端令牌限速或者--max-uploads过低导致并发拥堵 | 微秒 | 
| juicefs_objectDuration_delete | 对象存储 DeleteObject请求延迟 | 微秒 | 
| juicefs_objectDuration_copy | 对象存储 CopyObject请求延迟 | 微秒 | 
| juicefs_objectDuration_head | 对象存储 HeadObject请求延迟 | 微秒 | 
| juicefs_objectDuration_list | 对象存储 ListObjects请求延迟 | 微秒 | 
| juicefs_get_bytes | 对象存储读取总量 | 字节 | 
| juicefs_put_bytes | 对象存储写入总量 | 字节 | 
| juicefs_currentReq_get | 正在执行中的 GetObject请求数 | |
| juicefs_currentReq_put | 正在执行中的 PutObject请求数(不包括后台任务发送的请求) | |
| juicefs_currentReq_delete | 正在执行中的 DeleteObject请求数 | 
共享块设备
建议先阅读「共享块设备」文档,帮助了解以下监控指标的具体含义。
| 名称 | 说明 | 单位 | 
|---|---|---|
| juicefs_block_read | 从块设备读数据的次数 | |
| juicefs_block_readByteDur | 从块设备读数据的延迟 | 微秒 | 
| juicefs_block_readBytes | 从块设备读数据的总量 | 字节 | 
| juicefs_block_write | 往块设备写数据的次数 | |
| juicefs_block_writeByteDur | 往块设备写数据的延迟 | 微秒 | 
| juicefs_block_writeBytes | 往块设备写数据的总量 | 字节 | 
后台任务
| 名称 | 说明 | 单位 | 
|---|---|---|
| juicefs_bgjobs | 所有后台任务正在执行的数量 | |
| juicefs_bgjobs_compact | 正在执行碎片合并任务的数量 | |
| juicefs_bgjobs_convert | 正在执行转存任务的数量 | |
| juicefs_bgjobs_delete | 正在执行删除任务的数量 | |
| juicefs_bgjobs_migrate | 正在执行将数据从块设备迁移到对象存储的任务的数量 | |
| juicefs_bgjobs_sync | 镜像集群客户端正在执行数据复制任务的数量 | |
| juicefs_compacts | 碎片合并任务的执行次数 | |
| juicefs_compact_bytes | 碎片合并任务处理的数据块总大小 | 字节 | 
| juicefs_compact_duration | 碎片合并任务的执行时间 | 微秒 | 
| juicefs_migrates | 将数据从块设备迁移到对象存储的任务的执行次数 | |
| juicefs_migrate_bytes | 将数据从块设备迁移到对象存储的任务处理的数据块总大小 | 字节 | 
| juicefs_migrate_duration | 将数据从块设备迁移到对象存储的任务的执行时间 | 微秒 | 
| juicefs_syncs | 镜像集群客户端的数据复制任务的执行次数 | |
| juicefs_sync_bytes | 镜像集群客户端的数据复制任务处理的数据块总大小 | 字节 | 
| juicefs_sync_duration | 镜像集群客户端的数据复制任务的执行时间 | 微秒 | 
数据同步
| 名称 | 说明 | 单位 | 
|---|---|---|
| juicefs_sync_scanned | 从源端扫描的所有对象数量 | |
| juicefs_sync_handled | 已经处理过的来自源端的对象数量 | |
| juicefs_sync_pending | 等待同步的对象数量 | |
| juicefs_sync_copied | 已经同步过的对象数量 | |
| juicefs_sync_copied_bytes | 已经同步过的数据总大小 | 字节 | 
| juicefs_sync_skipped | 同步时被跳过的对象数量 | |
| juicefs_sync_failed | 同步时失败的对象数量 | |
| juicefs_sync_deleted | 同步时被删除的对象数量 | |
| juicefs_sync_checked | 同步时校验过 checksum 的对象数量 | |
| juicefs_sync_checked_bytes | 同步时校验过 checksum 的数据总大小 | 字节 | 


