为什么Unix的块大小增加与更大的内存大小?更大、内存大小、大小、Unix

2023-09-11 04:33:10 作者:我本无心何来刻骨铭心-

我分析的二进制数据,具有

I am profiling binary data which has

在增加的Unix块大小(一个来自有统计>块)时,事件的数量在下面的数字增加为 但事件之间的字节距离保持不变 在我注意到这也许可以解释日益Unix的块大小的文件等领域的一些变化 increasing Unix block size (one got from stat > Blocks) when the number of events are increased as in the following figure but the byte distance between events stay constant I have noticed some changes in other fields of the file which may explain the increasing Unix block size

Unix的块大小是一个动态指标。 我很感兴趣,为什么它正在增加,在某些系统更大的内存单元。 我有一个想法,它应该是恒定的。 我用不同的环境提供了 STAT 输出:

The unix block size is a dynamic measure. I am interested in why it is increasing with bigger memory units in some systems. I have had an idea that it should be constant. I used different environments to provide the stat output:

的Debian的Linux 8.1,其默认的与stat 在OSX 10.8.5使用X code 6和其默认 STAT Debian Linux 8.1 with its default stat OSX 10.8.5 with Xcode 6 and its default stat

樽的评论可能有答案块的行为:

Greybeard's comment may have the answer to the blocks behaviour:

曾经是一个薄CLI到STAT(2)系统的状态(1)命令   调用,它用来传输文件的inode的相关部分。 pretty的   在C结构的st_blksize成员的早期,意义   由stat返回(2)变更为preferred块大小为   高效的文件系统I / O,它携带很好地文件系统   混合块大小或者非块化配置。

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)分别?

How can you measure the block size in case (1) and (2) separately?

为什么Unix的块大小的增加与大内存的大小?

Why can the Unix block size increase with bigger memory size?

推荐答案

统计块是不是块大小。它是块中的文件包括的号码。很明显,块数成比例的大小。块的大小是恒定的大多数文件系统(如果不是全部)。

"Stat blocks" is not a block size. It is number of blocks the file consists of. It is obvious that number of blocks is proportional to size. Size of block is constant for most file systems (if not all).