[转帖]Optimizing Block Device Parameter Settings of Linux
https://support.huawei.com/enterprise/en/doc/EDOC1000181485/ddbc0e8b/optimizing-block-device-parameter-settings-of-linux#:~:text=The%20queue%20depth%20determines%20the%20maximum%20number%20of,block%20device%2C%20run%20cat.%20linux-ob3a%3A~%20%23%20cat%20%2Fsys%2Fblock%2Fsdc%2Fqueue%2Fnr_requests
Operating block devices will greatly affect host performance. Correct configuration of the queue depth scheduling algorithm, prefetch volume, and I/O alignment for block devices helps improve the system performance.
Queue Depth
The queue depth determines the maximum number of concurrent I/Os written to the block device. In Linux, the default value is 128. Do not change the value unless absolutely necessary. To query the queue depth of the block device, run cat.
linux-ob3a:~ # cat /sys/block/sdc/queue/nr_requests
128
In the event of testing the highest system performance, you can set the queue depth to a larger value to increase the I/O write pressure and the probability of combining I/Os in the queue. To temporarily change the queue depth of a block device, use the following method:
echo 256 > /sys/block/sdc/queue/nr_requests
You can tune the performance by temporarily changing the queue depth of a block device. After the application server is restarted, the queue depth is restored to the default value.
Scheduling Algorithm
Linux 2.6 kernel supports four types of block device scheduling algorithms: noop, anticipatory, deadline, and cfq. The default scheduling algorithm is cfq. To query the block device scheduling algorithm in use, run cat.
linux-ob3a:~ # cat /sys/block/sdc/queue/scheduler
noop deadline [cfq]
Inappropriate configuration of the scheduling algorithm affects system performance, such as I/O concurrency. You can use the following method to temporarily change the scheduling algorithm of the block device:
echo noop > /sys/block/sdc/queue/scheduler
You can tune the performance by temporarily changing the scheduling algorithm. After the application server is restarted, the scheduling algorithm is restored to the default value.
Prefetch Volume
Similar to the prefetch algorithm of a storage array, the prefetch function of Linux is only available for sequential read, sequential streams identification, and reading of data in the read_ahead_kb length (in units of sectors) in advance. For example, the default prefetch volume in SUSE 11 is 512 sectors, namely, 256 KB. To query the prefetch volume of the block device, run cat.
linux-ob3a:~ # cat /sys/block/sdc/queue/read_ahead_kb
512
If an application needs to read a large number of large-sized files, you can raise the system performance by setting the prefetch volume to a larger value. To do this, use the following method:
echo 1024 > /sys/block/sdc/queue/read_ahead_kb
I/O Alignment
If MBR partitions are created in Linux or Windows (pre Windows Server 2003 versions), the first 63 sectors of a disk are reserved for the master boot record and partition table. The first partition starts from the 64th sector by default. As a result, misalignment occurs between data blocks (database or file system) delivered by hosts and data blocks stored in the storage array, causing poor I/O processing efficiency.
In Linux, you can resolve I/O misalignment in either of the following ways:
- Method 1: Change the start location of a partition.
When creating MBR partitions in Linux, it is recommended that you enter the expert mode of the fdisk command and set the start location of the first partition to that of the second extent on a LUN. The default extent size is 4 MB. The following is a quick command used to create an MBR partition in /dev/sdb. The partition uses all space of /dev/sdb. The start sector is set to 8192, namely, 4 MB.
printf "n\np\n1\n\n\nx\nb\n1\n 8192\nw\n" | fdisk /dev/sdb
- Method 2: Create GPT partitions.
The following is a quick command used to create a GPT partition in /dev/sdb. The partition uses all space of /dev/sdb. The start sector is set to 8192, namely, 4 MB.
parted -s -- /dev/sdb "mklabel gpt" "unit s" "mkpart primary 8192 -1" "print"
To create MBR partitions in Windows (pre Windows Server 2003 versions), it is recommended that you run diskpart to set partition alignment.
diskpart> select disk 1
diskpart> create partition primary align=4096
[转帖]Optimizing Block Device Parameter Settings of Linux的更多相关文章
- 部署samba服务之后,在客户端用挂载访问的方式,错误信息:mount: block device //192.168.1.108/mysqldata is write-protected, mounting read-only mount: cannot mount block device //192.168.1.108/mysqldata read-only
部署samba服务之后,在客户端用挂载访问的方式,错误信息:mount: block device //192.168.1.108/mysqldata is write-protected, moun ...
- Is an MTD device a block device or a char device?
转:http://www.linux-mtd.infradead.org/faq/general.html#L_mtd_what Note, you can find Ukranian transla ...
- RMAN备份失败之:mount: block device /dev/emcpowerc1 is write-protected, mounting read-only
今天再做巡检的时候发现有一台服务器的RMAN备份不正常,有一段时间没能正常备份了.检查了一下脚本,正常,定时任务列表也正常,再检查一下/var/log/cron的内容,也没有问题.尝试在该挂载点上创建 ...
- centos6.4 ceph安装部署之ceph block device
1,prelight/preface ceph storage clusterceph block deviceceph filesystemceph object storage 此篇记录ceph ...
- Openstack: aborted: Block Device Mapping is Invalid
Issue: When you create an instance, you may encounter following exception: aborted: Block Device Map ...
- QEMU KVM Libvirt手册(6) – Network Block Device
网络块设备是通过NBD Server将虚拟块设备通过TCP/IP export出来,可以远程访问. NBD Server通常是qemu-nbd 可以提供unix socket qemu-nbd -t ...
- Mount 挂载错误mount:block device /dev/sr0 is write – protected , mounting read-only
Mount 挂载错误mount:block device /dev/sr0 is write – protected , mounting read-only 安装虚拟机出现以下提示: mount:b ...
- mount: block device /dev/cdrom is write-protected, mounting read-only 解决方法
[root@localhost ~]# mount /dev/cdrom /mnt/cdrom/ mount: block device /dev/sr0 is write-protected, mo ...
- DRBD(Distributed Replicated Block Device) 分布式块设备复制 进行集群高可用方案
DRBD是一个用软件实现的.无共享的.服务器之间镜像块设备内容的存储复制解决方案. 外文名 DRBD drbdadm 高级管理工具 drbdsetup 置装载进kernel的DRBD模块 drbdme ...
- Nova: 虚机的块设备总结 [Nova Instance Block Device]
和物理机一样,虚拟机包括几个重要的部分:CPU.内存.磁盘设备.网络设备等.本文将简要总结虚机磁盘设备有关知识. 1. Nova boot CLI 中有关虚机块设备的几个参数 nova boot CL ...
随机推荐
- 如何通过Python将JSON格式文件导入redis?
摘要:如果希望将 JSON 文件导入到 Redis 中,首先要做的就是连接到 redis 服务. 本文分享自华为云社区<Python将JSON格式文件导入 redis,多种方法>,作者: ...
- 几款Java开发者必备常用的工具,准点下班不在话下
摘要:一问一答的形式轻松学习掌握java工具. 以一问一答的形式学习java工具 Q:检查内存泄露的工具有?A: jmap生成dump转储文件,jhat可视化查看. Q:某进程CPU使用率一直占满,用 ...
- 带你读AI论文:SDMG-R结构化提取—无限版式小票场景应用
摘要:在文档图像中提取关键信息在自动化办公应用中至关重要.传统基于模板匹配或者规则的方法,在通用性方面.未见过版式模板数据方面,效果都不好:为此,本文提出了一种端到端的空间多模态图推理模型(SDMG- ...
- 云图说|初识ModelArts开发者生态社区——AI Gallery
阅识风云是华为云信息大咖,擅长将复杂信息多元化呈现,其出品的一张图(云图说).深入浅出的博文(云小课)或短视频(云视厅)总有一款能让您快速上手华为云.更多精彩内容请单击此处. 摘要: AI Galle ...
- vue2.x老项目typescript改造过程经验总结
前言: 关于Vue2.x 的TS改造,其实没有啥好说的. 对于vue-cli项目来说,从新跑一遍 vue create xxx-project ,选择Manually select features ...
- 十分钟读懂火山引擎 DataLeap 数据治理实践
更多技术交流.求职机会,欢迎关注字节跳动数据平台微信公众号,回复[1]进入官方交流群 日前,火山引擎数智平台 VeDI 直播活动「超话数据」在线举办,来自火山引擎 DataLeap 数据产品专家从数据 ...
- 用 bitsandbytes、4 比特量化和 QLoRA 打造亲民的 LLM
众所周知,LLM 规模庞大,如果在也能消费类硬件中运行或训练它们将是其亲民化的巨大进步.我们之前撰写的 LLM.int8 博文 展示了我们是如何将 LLM.int8 论文 中的技术通过 bitsand ...
- Python分析大数据,推荐四款加速器
在数据科学计算.机器学习.以及深度学习领域,Python 是最受欢迎的语言.Python 在数据科学领域,有非常丰富的包可以选择,numpy.scipy.pandas.scikit-learn.mat ...
- 【django-vue】主页前端搭建 git介绍和安装 git工作流程 git常用命令 git过滤文件 重写drf方法 跨域中间件 导出项目依赖
目录 上节回顾 1 主页前端 Header组件 Banner组件 Footer组件 2 git介绍和安装 git和svn比较 pycharm中配置git svn,git ,github,gitee,g ...
- #1016:Prime Ring Problem(经典DFS)
原题链接 题意:很容易理解,就是让你输出满足相邻的相加是素数的序列(注意不要重复) 思路就是深搜思想把每种情况遍历一次 代码实现: #include<iostream> #include& ...