Centos optimization I/O Optimization

Source: Internet
Author: User

1 I/O the amount of pre-read requests (the kernel system first responds to read requests by default, the amount of the first response is adjustable ):

Check blockdev -- getra/dev/sda. The default value is 256. This is one-way or more/sys/block/sda/queue/read_ahead_kb. The default value is 512, which is twice the value of 256. This is two-way blockdev adjustment -- setra 512/dev/sda or echo 256/sys/block/sda/queue/read_ahead_kb2 I/O Request queue length (tune to increase Hard Disk Throughput, but more memory is needed ): /sys/block/sda/queue/nr_requests3 I/O scheduling algorithm more/sys/block/sda/queue/sched1_noop anticipatory deadline [cfg] (four I/O Scheduling Algorithms, [] for the selected algorithm) the adjustable parameters of each scheduling algorithm are located in c of the four algorithms:/sys/block/sda/queue/iosched Ho noop>/sys/block/sda/queue/scheduler describes several parameters in deadline (suitable for reading and writing small files, skip-style reading and writing, and fragmented reading and writing (database) iosched: read_expire: 500 by default. write_expire is written as soon as the time is reached. The default value is 5000. At this time, the front_merges 0 1 (default) service can be obtained) when the new request is similar to the read/write location of the current request, the anticipatory (suitable for reading and writing large files, the whole block type, repeated read/write (web server) iosched can be combined with several parameter descriptions: antic_expire wait for this duration after a request ends to check whether there are new requests and the read/write location of this request is near read_expire 124 (default) write_expire 248 (default) cfg (completely fair algorithm) description of several parameters in iosched: queued requests Number length: quantum full number of requests written to a disk; class1 (real-time); real-time value: 0 ~ 7 class2 (best-effort) Round Robin value 0 ~ 7 class3 (idle) can only handle adjustment methods when idle ionice-p 1 (process number)-n7 (priority value)-c2 (class level) the lower the priority value, higher priority noop (no algorithm, applicable to SAN architecture, not Locally Optimized) file System Optimization 1 view filefrag-v/file view a file in the file system information dumpe2fs/dev/sda1 view a partition information 2 mke2fs-m 5/dev/sda1 in/dev/sda1 reserve 5% blocks to prevent data segment tune2fs-m 10/dev/sda1 from changing 5% to 10% tune2fs-r 1000/dev/sda1 and changing 5% to the specific number of blocks 3 mount-o data = ordered/dev/sda1 (default) the file system log area only stores metadata. mount-o data = journal/dev/sda1 first writes data and metadata to the log area (secure and slow) mount-o data = writeback/dev/sda1 write data not in the log area metadata Order (insecure, fast) 4. Disable File System Access time update mount-o notime/dev/sda1 write data by log zone metadata every five seconds mount-o commit = 5 (default) /dev/sda1RAID optimization 1 yum install sysstat (provides iostat, sar, and other system information viewing commands) -y iostat-x/dev/sda (obtain avgrq-sz (average number of request sectors per second )) calculate chunk size = avgrq-sz * 512/1024/number of RAID disks (the chunk size value can only be 2 to the Npower) 2 mdadm-C/dec/md0-l1-n2-B/tmp/md0 (external Bitmap) -- write-behind = 256/dev/sdc1 -- write-mostly/dev/sdd1, otherwise, read-only write/dev/sdc1. This method is used when/dev/sdc1 is superior to/dev/sdd1) 3/sys/block/md0/md/sync_speed_max (maximum Disk Synchronization speed) /sys/block/md0/md/sync_speed_min (minimum Disk Synchronization speed)


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.