我正在分析具有
的二进制数据- 当事件数量增加时增加Unix block 大小(一个从
stat
> Blocks得到)如下图 - 但事件之间的字节距离保持不变
- 我注意到文件的其他字段发生了一些变化,这可能解释了 Unix block 大小的增加
unix block 大小是一个动态度量。
我感兴趣的是为什么它在某些系统中随着更大的内存单元而增加。
我有一个想法,它应该是恒定的。
我使用不同的环境来提供 stat
输出:
- Debian Linux 8.1 及其默认
stat
- 带有 Xcode 6 的 OSX 10.8.5 及其默认
stat
Greybeard 的评论可能对积木行为有答案:
The stat (1) command used to be a thin CLI to the stat (2) system call, which used to transfer relevant parts of a file's inode. Pretty early on, the meaning of the st_blksize member of the C struct returned by stat (2) was changed to "preferred" blocksize for efficient file system I/O, which carries well to file systems with mixed block sizes or non-block oriented allocation.
如何分别测量情况(1)和(2)中的 block 大小?
为什么 Unix 的 block 大小会随着内存大小的增加而增加?
最佳答案
“统计 block ”不是 block 大小。它是文件包含的 block 数。很明显, block 的数量与大小成正比。对于大多数文件系统(如果不是全部), block 的大小是恒定的。
关于algorithm - 为什么 Unix block 大小会随着内存大小的增加而增加?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32123914/