我需要在 NFS 共享上递归删除数百万个目录,为了避免任何性能问题,我运行了以下命令:
ionice -c 3 -t find /dir -type f -exec rm {};
这将删除所有文件和剩余的空目录,我可以使用 rm -rf 删除。
但我无法说 ionice 对上述命令是否有任何影响。
来自 man,ionice 3 级:
仅当没有其他程序在定义的宽限期内请求磁盘 io 时,以空闲 io 优先级运行的程序才会获得磁盘时间。空闲 io 进程对正常系统活动的影响应该为零。
从源代码中,我看到 ionice set ioprio_set。
那么,ioprio_set 是什么?
ioprio_get() 和 ioprio_set() 系统调用分别获取和设置一个或多个线程的 I/O 调度类和优先级。
这是否意味着进程线程带有额外的属性供 I/O 调度程序使用它们来调度进程的 I/O?
这向我提出了以下问题:
如果我完全错了,请纠正我。 …
在 CentOS 6 中,有/etc/tune-profiles/my-server/ktune.sysconfig这样的文字(我指的是解释代码正在做什么的注释):
# This is the I/O scheduler ktune will use. This will *not* override anything
# explicitly set on the kernel command line, nor will it change the scheduler
# for any block device that is using a non-default scheduler when ktune starts.
# You should probably leave this on "deadline", but "as", "cfq", and "noop" are
# also legal values. Comment this out to prevent ktune from changing I/O
# scheduler settings.
ELEVATOR="deadline"
# …Run Code Online (Sandbox Code Playgroud) 我通过组合 4 个 HDD 创建了一个 RAID 5 设备块。
我的设备名称是 md1。
但是 /sys/block/md1/queue/scheduler 文件在执行 cat 时输出“none”。
而且在使用 vim 对其进行编辑后,它会抛出
/sys/devices/virtual/block/md1/queue/scheduler" E667: Fsync failed
Run Code Online (Sandbox Code Playgroud)
我也尝试使用 sysctl.conf 并添加
block.md1.queue.scheduler = deadline
Run Code Online (Sandbox Code Playgroud)
但它再次抛出
error: "block.md1.queue.scheduler" is an unknown key
Run Code Online (Sandbox Code Playgroud)
我真的别无选择。请帮帮我。
scheduler ×4
linux ×2
block ×1
block-device ×1
centos6 ×1
cluster ×1
grid ×1
gridengine ×1
grub2 ×1
io ×1
ionice ×1
nfs ×1
performance ×1
raid ×1
scheduling ×1