RH236GlusterFS-性能监控

简介: RH236GlusterFS-性能监控

RH236GlusterFS-性能监控

RHCSA专栏:戏说 RHCSA 认证

RHCE专栏:戏说 RHCE 认证

此文章(第十四章 GlusterFS-性能监控)收录在RHCA专栏:RHCA 回忆录

VolumeProfile命令

VolumeProfile 命令提供了一个接口,可以查看一些卷的信息,比如I/O或一些文件操作等,从而可以找出瓶颈所在。

启动 Profiling

命令格式:

#gluster volume profile VOLNAME start

For example:
# gluster volume profile test-volume start
# 开启此命令会影响性能,因此建议只在做debug时启用。

查看IO信息

命令格式:

# gluster volume profile VOLNAME info [nfs]

For example:
# gluster volume profile test-volume info

关闭 Profiling

命令格式:

#gluster volume profile VOLNAME stop

For example:
# gluster volume profile test-volume stop

VolumeTop命令

Volume Top命令可以查看glusterFS bricks的一些性能指标。

查看当前打开的文件数及最大打开的文件数

命令格式:

# gluster volume top VOLNAME open [nfs | brick BRICK-NAME] [list-cnt CNT]

For example:
# gluster volume top test-volume open brick g1:/data list-cnt cnt5
# 如果不指定brick ,Volume Top命令默认会返回100条结果,可以使用list-cnt 限制返回的数量。

查看读取频率最高的文件

命令格式:

# gluster volume top VOLNAME read [nfs | brick BRICK-NAME] [list-cnt CNT]

For example:
# gluster volume top test-volume read
# 如果不指定brick ,Volume Top命令默认会返回100条结果,可以使用list-cnt 限制返回的数量。

查看写频率最高的文件

命令格式:

# gluster volume top VOLNAME write [nfs | brick BRICK-NAME] [list-cnt CNT]

Forexample:
# gluster volume top test-volume write list-cnt 10
# 如果不指定brick ,Volume Top命令默认会返回100条结果,可以使用list-cnt 限制返回的数量。

查看打开频率最高的目录

命令格式:

# gluster volume top VOLNAME opendir [nfs | brick BRICK-NAME] [list-cnt CNT]
For example:
# gluster volume top test-volume opendir brick g1:/data list-cnt cnt5
# 如果不指定brick ,Volume Top命令将返回该卷上所有brick的信息。

查看读取频率最高的目录

命令格式:

# gluster volume top VOLNAME readdir [nfs | brick BRICK-NAME] [list-cnt CNT]
 
For example:
# gluster volume top test-volume readdir

查看brick的读/写性能

命令格式:

 # gluster volume top <VOLNAME> {read-perf|write-perf} [bs <size> count <count>] [brick <brick>] [list-cnt <value>] - volume top operations 
此命令可以测试卷的读写性能,命令类似dd

For example:
# gluster volume top test-volume read-perf
# gluster volume top test-volume write-perf bs 1024 count 10 brick g1:/data list-cnt 5

列出当前所有的卷

# gluster volume list

转储状态文件

可以将卷的一些内部变量及状态信息转储到文件中去,文件的默认存储路径为/var/run/gluster,文件名为BRICK-PATH.BRICK-PID.dump.*。

命令格式:

# gluster volume statedump VOLNAME [nfs] [all|mem|iobuf|callpool|priv|fd|inode|history]
mem        Dumps the memory usage and memory pool detailsof the bricks.
Iobuf       Dumps iobuf details of the bricks.
priv        Dumps private information of loaded translators.
callpool    Dumpsthe pending calls of the volume.
fd             Dumps the open file descriptor tables of the volume.
inode       Dumpsthe inode tables of the volume.
history     Dumpsthe event history of the volume
 
更改转储文件的路径
# gluster volume set VOLNAME server.statedump-path PATH

查看卷的状态

命令格式:

# gluster volume status [all] VOLNAME [nfs | shd | BRICKNAME]] [detail |clients | mem | inode | fd |callpool]
 For example:
# gluster volume status test-volume shd
# gluster volume status test-volume g1:/data detail
detail           Displays additional information aboutthe bricks.
clients          Displays the list of clients connectedto the volume.
mem             Displays the memory usage andmemory pool details of the bricks.
inode           Displays the inode tables of thevolume.
fd                  Displays the open filedescriptor tables of the volume.
callpool        Displaysthe pending calls of the volume.
shd               Displays the Self-heal info ofthe volume.

课本练习(以练习来进行了解)

[root@workstation ~]# lab profiling setup

1. 启用对prod-vol卷的分析。

[root@servera ~]# gluster volume profile prod-vol start
Starting volume profile on prod-vol has been successful

2. 验证已经为prod-vol启用了分析。

[root@servera ~]# gluster volume info prod-vol 
Volume Name: prod-vol
Type: Replicate
Volume ID: 56889e01-995f-47f7-bb9a-c38c4907e747
Status: Started
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: servera:/bricks/brick-a1/brick
Brick2: serverb:/bricks/brick-b1/brick
Options Reconfigured:
diagnostics.count-fop-hits: on
diagnostics.latency-measurement: on
performance.readdir-ahead: on

3. 检查prod-vo1的累积统计信息。

[root@servera ~]# gluster volume profile prod-vol info cumulative 
Brick: servera:/bricks/brick-a1/brick
-------------------------------------
Cumulative Stats:
   Block Size:                  1b+                   2b+                   4b+ 
 No. of Reads:                    0                     0                     0 
No. of Writes:                 4010                   610                  1355 
 
   Block Size:                  8b+                  16b+                  32b+ 
 No. of Reads:                    0                     0                     0 
No. of Writes:                38581                  9466                    95 
 
   Block Size:                 64b+ 
 No. of Reads:                    0 
No. of Writes:                   17 
 %-latency   Avg-latency   Min-Latency   Max-Latency   No. of calls         Fop
 ---------   -----------   -----------   -----------   ------------        ----
      0.00       0.00 us       0.00 us       0.00 us             40     RELEASE
      0.00       0.00 us       0.00 us       0.00 us            669  RELEASEDIR
      0.11       3.44 us       2.00 us       5.00 us             80     OPENDIR
      9.63     392.42 us      48.00 us    1279.00 us             60      STATFS
     18.98     290.23 us      32.00 us     832.00 us            160     READDIR
     24.28     424.19 us      32.00 us    2210.00 us            140    GETXATTR
     47.00     442.19 us      41.00 us    1584.00 us            260      LOOKUP
 
    Duration: 103168 seconds
   Data Read: 0 bytes
Data Written: 669785 bytes
 
Brick: serverb:/bricks/brick-b1/brick
-------------------------------------
Cumulative Stats:
   Block Size:                  1b+                   2b+                   4b+ 
 No. of Reads:                    0                     0                     0 
No. of Writes:                 4010                   610                  1355 
 
   Block Size:                  8b+                  16b+                  32b+ 
 No. of Reads:                    0                     0                     0 
No. of Writes:                38581                  9466                    95 
 
   Block Size:                 64b+ 
 No. of Reads:                    0 
No. of Writes:                   17 
 %-latency   Avg-latency   Min-Latency   Max-Latency   No. of calls         Fop
 ---------   -----------   -----------   -----------   ------------        ----
      0.00       0.00 us       0.00 us       0.00 us             40     RELEASE
      0.00       0.00 us       0.00 us       0.00 us            511  RELEASEDIR
      0.13       3.65 us       3.00 us       5.00 us             80     OPENDIR
      7.90     293.02 us      57.00 us     981.00 us             60      STATFS
     18.53     257.52 us      34.00 us     768.00 us            160     READDIR
     26.57     422.15 us      31.00 us    2564.00 us            140    GETXATTR
     46.86     400.89 us      43.00 us    1307.00 us            260      LOOKUP
 
    Duration: 76271 seconds
   Data Read: 0 bytes
Data Written: 669785 bytes

4. 禁用对prod-vol的分析。

[root@servera ~]# gluster volume profile prod-vol stop
Stopping volume profile on prod-vol has been successful 
[root@servera ~]# gluster volume info prod-vol 
Volume Name: prod-vol
Type: Replicate
Volume ID: 56889e01-995f-47f7-bb9a-c38c4907e747
Status: Started
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: servera:/bricks/brick-a1/brick
Brick2: serverb:/bricks/brick-b1/brick
Options Reconfigured:
performance.readdir-ahead: on

5. 使用glusterfs volume top选项查看性能指标。

查看当前打开的文件数及最大打开的文件数
[root@servera ~]# gluster volume top prod-vol open
Brick: servera:/bricks/brick-a1/brick
Current open fds: 0, Max open fds: 1, Max openfd time: 2020-12-14 09:08:06.670735
Count        filename
=======================
1        /file020.bin
1        /file019.bin
1        /file018.bin
1        /file017.bin
…………

查看读取频率最高的文件
[root@servera ~]# gluster volume top prod-vol read brick servera:/bricks/brick-a1/brick
Brick: servera:/bricks/brick-a1/brick
# 因为没这频率

查看写频率最高的文件
[root@servera ~]# gluster volume top prod-vol write brick servera:/bricks/brick-a1/brick
Brick: servera:/bricks/brick-a1/brick
Count        filename
=======================
4664        /file004.bin
4128        /file012.bin
4089        /file016.bin
3967        /file005.bin
3958        /file007.bin
3554        /file006.bin
…………

查看brick的读/写性能
[root@servera ~]# gluster volume top prod-vol read-perf bs 256 count 1 brick servera:/bricks/brick-a1/brick
Brick: servera:/bricks/brick-a1/brick
Throughput 12.80 MBps time 0.0000 secs
[root@servera ~]# gluster volume top prod-vol write-perf bs 512 count 2 brick servera:/bricks/brick-a1/brick
Brick: servera:/bricks/brick-a1/brick
Throughput 30.12 MBps time 0.0000 secs
MBps Filename                                        Time                      
==== ========                                        ====                      
   0 /file020.bin                                    2020-12-15 02:46:21.855432
   0 /file019.bin                                    2020-12-15 02:46:19.710012
   0 /file018.bin                                    2020-12-15 02:46:17.935527
…………

查看打开频率最高的目录
[root@servera ~]# gluster volume top prod-vol opendir brick servera:/bricks/brick-a1/brick
Brick: servera:/bricks/brick-a1/brick
Count        filename
=======================
1        /2010
1        /2009
1        /2008

查看读取频率最高的目录
[root@servera ~]# gluster volume top prod-vol readdir brick servera:/bricks/brick-a1/brick
Brick: servera:/bricks/brick-a1/brick
Count        filename
=======================
2        /2010

6. 脚本评分。

[root@workstation ~]# lab profiling grade


总结

以上就是【金鱼哥】对Gluster性能监控的分享 。希望能对看到此文章的小伙伴有所帮助。

如果这篇【文章】有帮助到你,希望可以给【金鱼哥】点个赞👍,创作不易,相比官方的陈述,我更喜欢用【通俗易懂】的文笔去讲解每一个知识点,如果有对【运维技术】感兴趣,也欢迎关注❤️❤️❤️ 【金鱼哥】❤️❤️❤️,我将会给你带来巨大的【收获与惊喜】💕💕!

目录
相关文章
|
6天前
|
存储 缓存 监控
|
6天前
|
存储 缓存 监控
磁盘I/O性能监控的指标
【1月更文挑战第22天】
|
12月前
|
监控
性能监控工具nmon安装
性能监控工具nmon安装
|
存储 Prometheus 运维
最强性能监控工具之Grafana+Prometheus+Exporters
有测试工具、监控工具,才能做性能分析和瓶颈定位。 不管数据啥形式展示,最要紧还是数据来源和含义,以做正确判断。
547 0
|
监控 Java
|
数据采集 消息中间件 监控
系统监控+性能监控|学习笔记
快速学习系统监控+性能监控
165 0
系统监控+性能监控|学习笔记
|
监控 Linux
iostat命令安装及详解 《性能监控工具》
iostat命令安装及详解 《性能监控工具》
1049 0
网络性能监控工具
本文研究全球及中国市场网络性能监控工具现状及未来发展趋势,侧重分析全球及中国市场的主要企业,同时对比北美、欧洲、中国、日本、东南亚和印度等地区的现状及未来发展趋势
|
监控
glusterfs 监控
这里以监控gv_KVM这个卷为例 1.启动 Profiling [root@192_168_174_68 ~]# gluster gluster> volume profile gv_KVM start Starting volume profile on gv_KVM has been successful 2.
1627 0
|
Prometheus 监控 Cloud Native
Ceph 监控中应用 Prometheus relabel 功能
1. 问题描述 工作环境中有三个独立的 Ceph 集群,分别负责对象存储、块存储和文件存储。搭建这几个 Ceph 集群时,我对 Ceph 重命名 Cluster name 的难度没有足够的了解,所以使用的都是默认的 cluster name:ceph,不巧的是 Prometheus 的 ceph_exporter 就是用 cluster name 来区分不同集群,结果是 Grafana 中各个集群的数据无法区分,所有的集群数据都绘制在了一个图标中,非常乱不说,而且部分数据还无法正常显示。
1440 0