# Disk

+ I/O scheduler
  + The I/O scheduler determines when and for how long an I/O operation runs on a storage device, also known as an I/O lift.
  + 1. NOOP
  + 2. CFQ
  + 3. Deadline
+ Mount Parameters
  + By default, Linux records the file access time atime, and the file system records some timestamps of the file when the file is accessed, created, modify, etc., such as: file creation time, last modify time, and last access time; this is unnecessary in most cases. 
  + You can try using noatime and nodiratime to disallow logging the timestamp of the most recent visit.
------------------------------------------------------------
disk
- I/O scheduler
  - Definitions:
The Linux kernel I/O scheduler's job is to pass data to the underlying storage device in a reasonable and optimized manner. Depending on the policies of the I/O scheduler, the performance of a TiDB DB instance may vary. Of course, if your system is under low load, the I/O scheduler won't make much of a difference.
However, if you are facing I/O limitations and your system must handle heavy loads, choosing the right I/O scheduler may be critical. 
In general, Linux supports the following I/O schedulers:
NOOP:
NOOP is the simplest of all I/O schedulers. It simply sends data to a FIFO queue, merges request to save on disk to find and pass the data.
CFQ:
CFQ is short for “Totally Fair Scheduler.” The idea of CFQ is to give all processes that belong to the same priority a time slice of the same size. Processes that perform sequential I/O may receive more bandwidth than processes that perform random I/O (random I/O often occurs during OLTP workloads in a database).
CFQ is the default and is usually preferred for desktop applications, and should remain responsive. This is not necessarily the optimal configuration for a database server.
Deadline:
The DEADMAL scheduler tries to ensure that no process will go hungry. The kernel imposes a deadline (deadline) for each I/O. Actual tests have shown that using a deadline is actually always faster than relying on the default value (= CFQ). However, in many cases, they make no difference.
  - The I/O scheduler determines when and for how long an I/O operation will run on a storage device, also known as an I/O lift
  - Set to noop for SSD devices
- Mount Parameters
  - By default, Linux records the time of file access, atime. The file system records some timestamps of files when files are accessed, created, modify, etc., such as: file creation time, last modify time, and last access time; this is unnecessary in most cases. 
Because a large number of files are accessed while the system is running, reducing some actions (such as reducing the number of timestamp records, etc.) will significantly improve the efficiency of disk IO and improve the performance of the file system. 
If you are experiencing high machine IO load or high CPU WAIT, you can try using noatime and nodiratime to disallow logging the timestamp of the most recent access.
  - Noatime will disable updates to metadata when reading files
  - Nodiratime disables metadata updates when reading directories
