Tuning I/O Performance

8576 ワード

本論文の転送先:http://doc.opensuse.org/products/draft/SLES/SLES-tuning_sd_draft/cha.tuning.io.
Chapter 13. Tuning I/O Performance。
コンテント
13.1.Switch I/O Schenduling
13.2.Available I/O Elevators
13.3.I/O Barrier Tuning
I/O scheduling controlls how input/output operations will be submitted to storage.SUSE Linux Enterpris Server off various I/O algorithms-caled  elevators—suiting different workloads.Elevatos can help to reduce sek operation、can prortize I/O requess、or make sure、and I/O request is carried out before a given deadline.
Choosing the best suited I/O elevator not only depends on the workload、but on the hard ware、too.Single ATA disk systems、SSDs、RAID arrays、or network storems、for exple、each direefferement。
13.1. Switching I/O Scheduling gg。
SUSE Linux Enterprise Server lets a default I/O scheduler at boot-time,which can be changed on the fly per block device.This makes it possible to set different algorithms fore.g.the device Hostine partem。
By default the  CFQ (Computely Fair Queuing)scheduler is used.Change this default by entering the boot parameter
elevator=SCHEDULER
where  SCHEDULER is one of  cfq、  noop、or  deadline.See アクション 13.2「Available I/O Elevators」 for details.
To change the elevator for a specific device in the running system,run the follwing command:
echo SCHEDULER > /sys/block/DEVICE/queue/scheduler
where  SCHEDULER is one of  cfq、  noop、or  deadline and  DEVICE the block device(sda) for example)
Default Schendulter on IBM System z
On IBM System z the default I/O scheduler for a storge device is set by the device driver.
13.2. Available I/O Elevators/
In the follwing elevators available on SUSE Linux Eterprise Server are listed.Each elevator has a set of tunable parameters,which can be set with the following command:
echo VALUE > /sys/block/DEVICE/queue/iosched/TUNABLE
where  VALUE is the desired value for the  TUNABLE and  DEVICE the block device.
To find out which elevator is the current default,run the follwing command.The currently selected scheduler is listed in bracted:
jupiter:~ # cat /sys/block/sda/queue/scheduler
noop deadline [cfq]
13.2.1.  CFQ (Complettelly Fair Queuing)/CFQ アイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイティティティティティティティティティティティティティティティティティティティティアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアイアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアscheduling decisions マン1 ionice.The  CFQ scheduler has the follwing tunable parameters:/sys/block/<device>/queue/iosched/slice_アイドル
When a task has no more I/O to submit in its time slice,the I/O scheduler waits for a while before scheduling the next thread to improve locality of I/O.For media where locality does not Play biros。  /sys/block/<device>/queue/iosched/slice_アイドル ト  0 can improve the throughput consideable./sys/block/<device>/queue/iosched/quantum
This option limits the maximnumber of requests that are processed by the device at once.The default value is  4.For a storge with several diss、this setting can unnecessarly limit parallel processing of requests.The refore、increase the value can improve performance althis can can cause castate the latens the latensemaduei/soreeiyou can also consider tuning  /sys/block/<device>/queue/iosched/slice_async_rq。 (the default value is  2)which limits the maximumber of asynchronous requests-usualy writing requests-that are submitted in one time slace./sys/block/<device>/queue/iosched/low_latency
For workloads where the latency of I/O is crucial,setting  /sys/block/<device>/queue/iosched/low_latencyto  1 can help.
13.2.2.  NOOPA trivial scheduler that just passes down the I/O that couses to it.Useful for checking whether complex I/O scheduling decisions of other schers schedulers are not causing I/O performance regress.
In some cases it can be helpful for devices that do I/O scheduling themselves、as intelligent storge、or devices that do not depend on mechanicavement、like SSDs.Usually、the  DEADLINE I/O scheduler is a better chece for these devices、but due to less overhead  NOOP may produce better performance on certain workloads.
13.2.3.  DEADLINEDEADLINE is a latency-orented I/O scheduler.Each I/O request has got a deadline assigned.Usually,requests are stored in queues(read and write)sorted by sector numbers.The  DEADLINE algorithm mantains two addititional queues(read and write)where the requests are sorted by deadline.As long asのrequest has timed out,the「sector」 queue is used.If timeouts occur,requests from the “deadline queue are served until there no more expired requests.Generaly,the algorithm prefers reads over writes.
This scheduler can provide a superior throughput over the  CFQ I/O scheduler in cases where several threads read and write and fairnes is not an ise.For example,for several parallel readers from a saN and for databases(especially when using) “TCQ diskys.The  DEADLINE scheduler has the follwing tunable parameters:/sys/block/<device>/queue/iosched/writes_starved
Controls how many reads can be sent to disk before it is possible to send writes.A value of  3 means、that three read operations are carried out for one write operation./sys/block/<device>/queue/iosched/read_expire
Sets the deadline(current time plus the read u)expire value for read operations in miliseconds.The default is 500./sys/block/<device>/queue/iosched/write_expire/sys/block/<device>/queue/iosched/read_expire Sets the deadline(current time plus the read u)expire value for read operations in miliseconds.The default is 500.
13.3. I/O Barrier Tuning。
Most file systems(XFS,ext 3,ext 4,reiserfs)send write barriers to disk afsync or during trnsaction comits.Write barriers enforce proper orders of writes,making volatile disk of cachematedisabling barriers may safely improve performance.
Sending write barriers can be disabled using the  barrier=0 mount option(for ext 3、ext 4、and reiserfs)、or using the nobarrier mount option(for XFS)
 
Dispabling barriers when disk cannot garantee caches are properly written in case of power failure can lead to severe file system coruption and data loss.
MySQL の に して、 はこの を と の の として んで、まず のブログに して、それからゆっくりと して、 して、 めます。