技术解析
性能监控的时候使用vmstat
,查看 man
bo: Blocks sent to a block device (blocks/s).
下图是分别运行vmstat 1
和iostat 1
截图
盲猜 block 大小为 1KB,
但是通过fdisk -l
[email protected]:~# fdisk -l
Disk /dev/sda: 80 GiB, 85899345920 bytes, 167772160 sectors
Disk model: VMware Virtual S
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x5e118ce6
看到I/O size (minimum/optimal): 512 bytes / 512 bytes
执行dumpe2fs -h /dev/sda1
[email protected]:~# dumpe2fs -h /dev/sda1
dumpe2fs 1.44.5 (15-Dec-2018)
Filesystem volume name:
Last mounted on: /
Filesystem UUID: 7305e4f3-57d3-49f9-8348-8416ad736173
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery extent 64bit flex_bg sparse_super large_file huge_file dir_nlink extra_isize metadata_csum
Filesystem flags: signed_directory_hash
Default mount options: user_xattr acl
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 4964352
Block count: 19847168
Reserved block count: 992358
Free blocks: 15643755
Free inodes: 4807531
First block: 0
Block size: 4096
Fragment size: 4096
Group descriptor size: 64
Reserved GDT blocks: 1024
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 8192
Inode blocks per group: 512
Flex block group size: 16
Filesystem created: Tue Sep 24 15:52:12 2019
Last mount time: Wed Jun 24 08:13:34 2020
Last write time: Wed Jun 24 08:13:32 2020
Mount count: 27
Maximum mount count: -1
Last checked: Tue Sep 24 15:52:12 2019
Check interval: 0 ()
Lifetime writes: 282 GB
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 256
Required extra isize: 32
Desired extra isize: 32
Journal inode: 8
First orphan inode: 4195685
Default directory hash: half_md4
Directory Hash Seed: aaa256b0-0045-4830-aed1-533d6f7f0a28
Journal backup: inode blocks
Checksum type: crc32c
Checksum: 0xba8682f2
Journal features: journal_incompat_revoke journal_64bit journal_checksum_v3
Journal size: 512M
Journal length: 131072
Journal sequence: 0x00c303f9
Journal start: 103755
Journal checksum type: crc32c
Journal checksum: 0x9e666967
看到
Block size: 4096
Reserved GDT blocks: 1024
那么问题来了,block 的大小到底的多少?