Your IP : 18.216.167.229
3
�<�e�A � @ sj d dl Z ddlmZ ddlT d dlZd dljZd dlm Z d dl
Z
d dlZejj
� ZG dd� dej�ZdS )� N� )�hotplug)�*)�commandsc s� e Zd ZdZ� fdd�Z� fdd�Zdd� Zdd � Zed
d� �Z dd
� Z
dd� Z� fdd�Z� fdd�Z
� fdd�Zedd� �Zedd� �Zdd� Zdd� Zdd� Zd d!� Zd"d#� Zd$d%� Zd&d'� Zd(d)� Zd*d+� Z� fd,d-�Zd.d/� ZdZd1d2�Zd3d4� Zed5d6d7�d8d9� �Ze d5�d[d;d<��Z!ed=d6d7�d>d?� �Z"e d=�d\d@dA��Z#edBd6d7�dCdD� �Z$e dB�d]dEdF��Z%dGdH� Z&dIdJ� Z'edKd6d7�dLdM� �Z(e dK�d^dNdO��Z)e*dPd6d7�dQdR� �Z+dSdT� Z,edUd6d7�dVdW� �Z-e dU�d_dXdY��Z.� Z/S )`�
DiskPlugina�
`disk`::
Plug-in for tuning various block device options. This plug-in can also
dynamically change the advanced power management and spindown timeout
setting for a drive according to the current drive utilization. The
dynamic tuning is controlled by the [option]`dynamic` and the global
[option]`dynamic_tuning` option in `tuned-main.conf`.
+
The disk plug-in operates on all supported block devices unless a
comma separated list of [option]`devices` is passed to it.
+
.Operate only on the sda block device
====
----
[disk]
# Comma separated list of devices, all devices if commented out.
devices=sda
----
====
+
The [option]`elevator` option sets the Linux I/O scheduler.
+
.Use the bfq I/O scheduler on xvda block device
====
----
[disk]
device=xvda
elevator=bfq
----
====
+
The [option]`scheduler_quantum` option only applies to the CFQ I/O
scheduler. It defines the number of I/O requests that CFQ sends to
one device at one time, essentially limiting queue depth. The default
value is 8 requests. The device being used may support greater queue
depth, but increasing the value of quantum will also increase latency,
especially for large sequential write work loads.
+
The [option]`apm` option sets the Advanced Power Management feature
on drives that support it. It corresponds to using the `-B` option of
the `hdparm` utility. The [option]`spindown` option puts the drive
into idle (low-power) mode, and also sets the standby (spindown)
timeout for the drive. It corresponds to using `-S` option of the
`hdparm` utility.
+
.Use a medium-agressive power management with spindown
====
----
[disk]
apm=128
spindown=6
----
====
+
The [option]`readahead` option controls how much extra data the
operating system reads from disk when performing sequential
I/O operations. Increasing the `readahead` value might improve
performance in application environments where sequential reading of
large files takes place. The default unit for readahead is KiB. This
can be adjusted to sectors by specifying the suffix 's'. If the
suffix is specified, there must be at least one space between the
number and suffix (for example, `readahead=8192 s`).
+
.Set the `readahead` to 4MB unless already set to a higher value
====
----
[disk]
readahead=>4096
----
====
The disk readahead value can be multiplied by the constant
specified by the [option]`readahead_multiply` option.
c sr t t| �j||� ddddddddd d
ddg| _d
dddddddddd dg| _t| j�| _d| _d| _t � | _
d S )N� �� �� � � �} �i �U �F �7 � � r � �� �� � � � � �n �Z �<