quo*_*tor 4 linux filesystems inode
根据这个答案,至少可以挂载具有“无限”inode 的 tmpfs。
考虑这种特定的(出于示例目的而选择的数字,我知道它们不现实)情况:
nr_inodes=1000
这意味着,tmpfs的是50%满,但也任何试图写它会导致空间不足错误的。
在我看来,设置nr_inodes=0
(又名无限 inode)会使这种情况消失。
通常(例如:ext2
, ext3
, ext4
, ufs
),文件系统可以容纳的 inode 数量是在创建时设置的,因此没有安装选项可以解决它。
一些文件系统像xfs
inode 使用的空间比率是可调的,所以它可以随时增加。
现代文件系统喜欢ZFS
或btrfs
没有对文件系统可以存储的文件数量的硬编码限制,索引节点(或它们的等效项)是按需创建的。
编辑:缩小更新问题的答案。
使用tmpfs
,默认的 inode 数量被计算为对于大多数实际用例来说足够大。此设置不是最佳的唯一情况是,如果在tmpfs
. 如果是这种情况,最佳做法是将nr_inodes
参数调整为足够大的值,以使所有文件都适合但不使用0
(= 无限制)。tmpfs
文档指出这不应该是默认设置,因为非 root 用户可能会耗尽内存:
if nr_inodes=0, inodes will not be limited. It is generally unwise to
mount with such options, since it allows any user with write access to
use up all the memory on the machine; but enhances the scalability of
that instance in a system with many cpus making intensive use of it.
Run Code Online (Sandbox Code Playgroud)
但是,鉴于tmpfs
默认情况下 RAM 使用率限制为 RAM 的 50%,目前尚不清楚这是如何发生的:
size: The limit of allocated bytes for this tmpfs instance. The
default is half of your physical RAM without swap. If you
oversize your tmpfs instances the machine will deadlock
since the OOM handler will not be able to free that memory.
Run Code Online (Sandbox Code Playgroud)
许多人会更关心默认内存量是否与他们的应用程序需求相匹配。
归档时间: |
|
查看次数: |
3038 次 |
最近记录: |