[转帖]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 ...
随机推荐
- Java 中常见类型的判空方式
引用类型(Reference Types): 使用 == 运算符判断是否为 null. 使用 != 运算符判断是否不为 null. 使用 Objects.isNull() 方法判断是否为 null. ...
- 什么是HuggingFace
一.HuggingFace简介 1.HuggingFace是什么 可以理解为对于AI开发者的GitHub,提供了模型.数据集(文本|图像|音频|视频).类库(比如transformers|peft|a ...
- 神经网络入门篇:激活函数的导数(Derivatives of activation functions)
激活函数的导数 在神经网络中使用反向传播的时候,真的需要计算激活函数的斜率或者导数.针对以下四种激活,求其导数如下: 1)sigmoid activation function 图1.8.1 其具体的 ...
- linux_文本处理工具详细介绍
文本处理工具 1. grep工具 grep是行过滤工具:用于根据关键字进行行过滤 语法和选项 语法: # grep [选项] '关键字' 文件名 常见选项: OPTIONS: -i: 不区分大小写 - ...
- 【华为云技术分享】DLI跨源|当DLI遇见MongoDB
导语: MongoDB作为灵活高效易扩展的no-schema数据库,越来越受到互联网公司.游戏行业等开发者的青睐,但是MongoDB有着独特的语言接口,并不能很好满足数据分析师构建数据治理应用的需求, ...
- 快来,这里有23种设计模式的Go语言实现
摘要:设计模式(Design Pattern)是一套被反复使用.多数人知晓的.经过分类编目的.代码设计经验的总结,使用设计模式是为了可重用代码.让代码更容易被他人理解并且保证代码可靠性. 本文分享自华 ...
- 想发自己的NFT,你要先搞清楚这6个问题
摘要:NFT是Web3世界中标记数据资产独特性的标识,是数据权益的载体. 本文分享自华为云社区<加密数字艺术NFT背后你关心的六个问题>,作者: 薛腾飞 . Connect Wallet ...
- 云图说|图解DGC:基于华为智能数据湖解决方案的一体化数据治理平台
摘要:数据湖治理中心DGC,帮助企业快速构建从数据集成到数据服务的端到端智能数据系统,消除数据孤岛,统一数据标准,加快数据变现,实现数字化转型. 本文分享自华为云社区<[云图说]第232期 图解 ...
- 打通数据治理全链路,火山引擎DataLeap数据治理平台公有云版本正式发布
更多技术交流.求职机会,欢迎关注字节跳动数据平台微信公众号,回复[1]进入官方交流群 近日,火山引擎DataLeap正式对外发布数据治理平台公有云版.DataLeap是火山引擎大数据研发治理套件, ...
- 数据治理如何做?火山引擎DataLeap帮助这款产品3个月降低计算成本20%
更多技术交流.求职机会,欢迎关注字节跳动数据平台微信公众号,回复[1]进入官方交流群 本文讲述字节跳动一款 App 产品的数据治理故事.该产品随着用户体量和数据体量不断增长,数仓的任务量.数据量也不断 ...