I/O Wait Time: A Guide to Improving Linux Performance (2025)

I/O wait is a plaguing issue in Linux. Speaking in layman terms, I/O wait is the time taken by the processor (here, CPU) to complete an input service request.

Ideally, our CPU doesn't seem to do any work when it is processing one input request at a time, thus the duration between your input and the output provided by the system can be treated as the I/O wait time.

The problem with this seemingly harmless issue is that overtime, this drains our kernel and bogs down our CPU thus resulting in poor performance.

Let’s learn what is I/O wait, the reasons for having such high I/O wait time and the solutions of fixing them in this article.

Let's look at the following:

  1. What is I/O wait in Linux?
  2. Understanding CPU usage in Linux
  3. Causes of high I/O wait time
  4. Assessing high I/O wait in Linux
  5. Fixing the high I/O wait problem
  6. Monitor IO wait time using Atatus

What is I/O wait in Linux?

I/O wait is the term used to describe a state in which a computer's Central Processing Unit (CPU) is idle, waiting for input/output (I/O) operations to complete.

When a computer is in I/O wait, it is not performing any computational tasks and is instead waiting for data to be read from or written to a storage device, such as a hard drive or networked file system.

Normally, a CPU can exist in four states:

  • Running - When the CPU is performing tasks actively
  • Waiting - When the CPU is waiting for new instructions or waiting for a certain input request to be completed
  • Idle - When the CPU currently has no work to do and is waiting to be assigned some new task.
  • Stuck - As in upon encountering an error or when it is unable to complete a task and is in an infinite loop.

Usually, when the CPU is assigned a task which requires an I/O transaction, the CPU passes on a request to the I/O controller. Then this I/O controller takes up this task and serves the request.

I/O Wait Time: A Guide to Improving Linux Performance (1)

This wait time between an input and a processed output is called the I/O wait time. It is the time taken by the I/O controller to process the request.

If you have a CPU with multiple cores, finding exactly where this I/O wait is occurring becomes difficult.

Because there are chances that a task fails in one of the cores, it gets transferred to the following core and again takes up some wait time before producing an output.

So the final I/O wait time you see is a lot more than what is expected, giving a false impression.

Example of IO wait time in Linux

An example of I/O wait in a Linux system might involve a process that is waiting for data to be transferred over a network connection. For instance:

  1. A process is running on a Linux server and needs to retrieve data from a database that is hosted on a remote server.
  2. The process sends a request for the data over the network connection.
  3. The remote server is busy with other tasks and is unable to immediately fulfill the request.
  4. The process on the Linux server is put into an I/O wait state while it waits for the data to be transferred.
  5. Once the data is available, it is transferred over the network connection and received by the Linux server.
  6. The process on the Linux server can now continue executing.

Understanding CPU usage in Linux

Understanding usage is very important when faced with CPU IO wait situations. Some common ways to view and monitor CPU usage in Linux include:

  • The top command: This command allows users to view a list of running processes sorted by CPU and memory usage. It also displays information such as the process ID, the user who owns the process, and the command line used to start the process.
  • The ps command: This command allows users to view information about running processes, including the CPU usage and elapsed time.
  • The vmstat command: This command displays information about system memory, CPU, and I/O activity. It can be used to view real-time CPU usage statistics.
  • The mpstat command: This command displays real-time CPU usage statistics for each CPU core on a system.
I/O Wait Time: A Guide to Improving Linux Performance (2)

To view overall CPU usage for the system, you can use the top or vmstat commands. To view CPU usage for a specific process, you can use the ps or top commands, and specify the process ID of the process you want to view. To view CPU usage for individual CPU cores, you can use the mpstat command.

Also, based on the % of I/O wait, we can decide the need to switch to a new kernel or an additional CPU storage. The percentage demarcations for I/O wait and their relevant observations are given below:

  • 0-4% – There is no activity in the kernel.
  • 5-10% – The kernel is starting to work, but it's not under a significant workload.
  • 11-20% – Kernel is working hard and becoming sluggish. This is where you might start to see some performance issues.
  • 21-100% - The kernel is under heavy load and is unable to handle all requests. This is where you will see the biggest performance issues.

Causes of high I/O wait time

I/O wait can have a significant impact on a computer's performance, as it means that the CPU is not being fully utilized.

High levels of I/O wait can indicate that the computer's I/O subsystem is a bottleneck and that the CPU is not being kept busy enough.

To improve performance in such cases, it may be necessary to optimize the I/O subsystem or to add more CPU resources.

There are several reasons why a computer's CPU may be in I/O wait:

  1. Disk I/O: If the computer is reading from or writing to a storage device, such as a hard drive or SSD, it will be in I/O wait while it waits for the data to be transferred.
  2. Network I/O: If the computer is waiting for data to be transferred over a network connection, it will be in I/O wait.
  3. Other I/O operations: A computer may also be in I/O wait while waiting for other I/O operations to complete, such as reading from or writing to a USB device or printer.
  4. Insufficient CPU resources: If the CPU is not able to keep up with the demand for computational tasks, it may spend a significant amount of time in I/O wait.
  5. Slow I/O subsystem: If the computer's I/O subsystem is slow or overloaded, it may take longer for I/O operations to complete, resulting in higher levels of I/O wait.

High I/O wait on specific CPU cores can occur when the CPU is waiting for input/output operations to be completed.

This can occur when a system is reading or writing data to a storage device, or when it is communicating with a network or external device.

High levels of I/O wait on specific CPU cores can indicate that the system is experiencing a hurdle in its I/O operations, which can slow down overall performance.

There are several potential causes of high I/O wait on specific CPU cores, including:

  • Slow or congested network connections
  • Outdated hardware, such as slow hard drives or insufficient RAM
  • Heavy workloads that are causing the system to constantly read and write data
  • Poorly optimized software or operating system configurations

To address high I/O wait on specific CPU cores, it may be necessary to upgrade hardware, optimize software and operating system configurations, or distribute workloads more evenly across the system.

Assessing high I/O wait in Linux

i.) Using top command

The top command is a Linux utility that allows you to monitor system performance in real time.

You can use it to view the CPU utilization, including the percentage of time that the CPU is spending waiting for I/O operations to complete (i.e., I/O wait time).

To view the I/O wait time using the command top, follow these steps:

  • Open a terminal and type top. This will display a real-time view of your system's performance, with the most CPU-intensive processes listed at the top.
  • Press the I key to sort the processes by I/O wait time. This will cause the processes with the highest I/O wait time to be listed at the top of the top output.
  • Press Q to quit top when you are finished.

You can also use the -i flag to display I/O wait time in the top output. For example:

top -i

This will display the I/O wait time as a percentage of the total CPU time. You can press the I key to toggle the display of I/O wait time on and off.

I/O Wait Time: A Guide to Improving Linux Performance (3)

ii.) Using vmstat command

vmstat in Linux allows you to monitor system performance and resource utilization. You can use it to view the I/O wait time for your system.

To view the I/O wait time using vmstat, follow these steps:

  • Open a terminal and type vmstat. This will display real-time statistics for your system, including the I/O wait time.
  • Press CTRL+C to stop the vmstat output.

You can also specify the number of seconds between updates and the number of updates to display.

For example, to display updates every 5 seconds for a total of 3 updates, you can use the following command:

vmstat 5 3
I/O Wait Time: A Guide to Improving Linux Performance (4)

This will display the I/O wait time as a percentage of the total CPU time.

iii.) Discover processes causing high I/O wait using iotop

The iotop is a Linux command that allows you to monitor I/O usage in real time. It is similar to top, but it displays information about I/O usage instead of CPU usage. You can use iotop to view the I/O wait time for each process.

To use iotop, follow these steps:

  • Open a terminal and type sudo iotop. This will display a real-time view of I/O usage, with the most I/O-intensive processes listed at the top.
  • Press the F key and then the W key to save the current display settings to a configuration file. This will allow you to view the I/O wait time every time you run iotop.
  • Press Q to quit iotop when you are finished.
I/O Wait Time: A Guide to Improving Linux Performance (5)

Here SWAPIN and IO shows the percentage of time spent by processes or threads while swapping in and waiting on IO operations respectively.

You can also use the --only flag to display only the processes that are currently performing I/O operations. For example:

sudo iotop --only

This will display a list of processes that are currently performing I/O operations, along with their I/O wait time.

Some common options for the iotop command include:

-o: displays only processes that are actively using I/O

-b: runs iotop in batch mode, allowing it to be used in scripts

-d: sets the refresh interval for the display

-p: specifies a specific process to monitor

For example, to view a list of all processes using I/O in real-time, you can use the command iotop -o. To monitor the I/O usage of a specific process, you can use the command iotop -p [pid], where [pid] is the process ID of the process you want to monitor.

iv.) Find out which disks are being written to with iostat

The iostat command allows you to monitor disk I/O activity and disk utilization. You can use it to view the I/O wait time for your disks.

To view the I/O wait time for all disks using iostat, follow these steps:

  • Open a terminal and type iostat. This will display real-time statistics for all disks, including the I/O wait time.
  • Press CTRL+C to stop the iostat output.
I/O Wait Time: A Guide to Improving Linux Performance (6)

You can also use the -x flag to display extended statistics, including the I/O wait time. For example:

iostat -x

This will display the I/O wait time as a percentage of the total CPU time.

You can also specify a particular disk or disks to monitor. For example, to monitor sda, you can use the following command:

iostat -x sda

Some common options for the iostat command include:

-x: displays extended statistics, including I/O service time and I/O utilization

-d: displays statistics for individual devices

-c: displays CPU utilization statistics

-p: displays statistics for a specific disk or file system

For example, to view I/O statistics for all disks and file systems on a system, you can use the command iostat -x. To view statistics for a specific device, you can use the command iostat -xd [device], where [device] is the name of the device you want to view. To view CPU utilization statistics, you can use the command iostat -xc.

Fixing the high I/O wait problem

There are several possible ways to fix high I/O wait time in Linux, depending on the cause of the problem. Here are a few general strategies you can try:

  1. Identify the cause of the high I/O wait time: Use top, iotop, or other system monitoring tools to determine which processes or disks are responsible for the high I/O wait time. This will help you to focus your efforts on the right areas.
  2. Check for disk errors: Use the fsck command to check for and fix any errors on your disks. High I/O wait time can sometimes be caused by faulty disks or disk controllers.
  3. Tune your I/O scheduler: Linux uses an I/O scheduler to optimize disk performance. You can try changing the I/O scheduler to see if it improves performance. To do this, you can use the elevator kernel parameter.
  4. Increase the number of I/O requests that can be handled simultaneously: You can try increasing the size of the I/O request queue to allow more I/O requests to be handled at the same time. You can do this using the nr_requests kernel parameter.
  5. Optimize your disk layout: You can try optimizing the layout of your disk partitions to improve I/O performance. For example, you can try placing frequently accessed files on faster disks or near the beginning of the disk.

Monitor IO wait time using Atatus

To monitor IO wait time using Atatus Infrastructure Monitoring, you can do the following:

  1. Sign up Atatus and install the Atatus agent on your servers.
  2. Atatus allows you to track key metrics for your servers, CPU, processes, host etc., including IO wait time.
  3. Set up alerts to notify you if IO wait time exceeds a certain threshold. You can set up alerts in Atatus to send notifications via email, Slack, or VictorOps and much more.
  4. Monitor IO wait time over time using Atatus' dashboard. You can view IO wait time trends and see how they relate to other metrics, such as CPU and memory usage.
I/O Wait Time: A Guide to Improving Linux Performance (7)

By monitoring IO wait time using Atatus Infrastructure Monitoring, you can identify and address issues that may be impacting the performance of your application.

Conclusion

We have now read completely about what I/O wait is and how to diagnose it when the wait time increases.

Using Linux commands like top and vmstat can help with assessing high I/O wait time, while iotop can identify the processes causing this lag and subsequently check with iostat command to find out which disks are increasing this wait time.

Following the solutions that we’ve provided for fixing the I/O wait might help you a great deal to keep your system healthy and running for a longer time.

Infrastructure Monitoring with Atatus

Track the availability of the servers, hosts, virtual machines and containers with the help of Atatus Infrastructure Monitoring. It allows you to monitor, quickly pinpoint and fix the issues of your entire infrastructure.

In order to ensure that your infrastructure is running smoothly and efficiently, it is important to monitor it regularly. By doing so, you can identify and resolve issues before they cause downtime or impact your business.

I/O Wait Time: A Guide to Improving Linux Performance (8)

It is possible to determine the host, container, or other backend component that failed or experienced latency during an incident by using an infrastructure monitoring tool. In the event of an outage, engineers can identify which hosts or containers caused the problem. As a result, support tickets can be resolved more quickly and problems can be addressed more efficiently.

Start your free trial with Atatus. No credit card required.

I/O Wait Time: A Guide to Improving Linux Performance (2025)

FAQs

What is the IOWait time in Linux? ›

I/O wait time is a metric used to measure the amount of time the CPU waits for disk I/O operations to complete. A high I/O wait time indicates an idle CPU and outstanding I/O requests—while it might not make a system unhealthy, it will limit the performance of the CPU.

How to increase io performance in Linux? ›

Software fixes
  1. Use separate virtual and physical hard disks.
  2. Install the host operating system onto a different disk than the virtual machines.
  3. Optimize hard drives by implementing disk partitioning in the guest and host OS.
  4. Update RAID type as per the application workload to see faster application performance.

How do I find processes waiting for IO in Linux? ›

Discover processes causing high I/O wait using iotop. The iotop is a Linux command that allows you to monitor I/O usage in real time. It is similar to top, but it displays information about I/O usage instead of CPU usage. You can use iotop to view the I/O wait time for each process.

What is the normal IOWait in Linux? ›

A value less than 10ms for SSD or 100ms for hard drives is usually not cause for concern, and lower is better.

What is the difference between idle and IOWait? ›

There is a good article that goes into more detail on the subject, but basically, “IOWait” is kind of idle CPU time. If the CPU core gets idle because there is no work to do, the time is accounted as “idle.” If, however, it got idle because a process is waiting on disk, I/O time is counted towards “IOWait.”

How to check disk latency in Linux? ›

Disk latency is the time that it takes to complete a single I/O operation on a block device. You can see the disk latency in Windows Server Performance Monitor and by using iostat -xd 1 on Linux systems. Stats are displayed and monitored per disk. In general, the disk latency will vary by type of disk.

How to speed up Linux performance? ›

How to Improve Boot Speed of Linux
  1. Overview. In this tutorial, we'll dive into the details of how to improve the boot speed of Linux. ...
  2. Analyzing the Boot Time. ...
  3. Disabling Services and Daemons. ...
  4. Optimizing Disk Usage. ...
  5. Kernel and Driver Optimization. ...
  6. Utilizing Bootloaders. ...
  7. Enabling Fastboot. ...
  8. Updating System Regularly.
Mar 18, 2024

How to measure I/O throughput in Linux? ›

If it is high, then we need to check I/O activity in Linux box using the iotop or iostat commands. By using iotop command, you can monitor the disk utilization by individual processes. You will get the following output: By typing the iotop command with o option, you will get the actual I/O activity.

What is Linux performance tuning? ›

Tuned is a Linux feature that monitors a system and optimizes its performance under certain workloads. Tuned uses profiles to do this. A profile is a set of rules that defines certain system parameters such as disk settings, kernel parameters, network optimization settings, and many other aspects of the system.

How do I know which process is causing high IO in Linux? ›

iotop. iotop is a Linux utility that monitors input/output usage as reported by the Linux kernel and displays the information by process or thread. While it doesn't show usage by file or directory, iotop can be useful to identify the process with the highest input/output utilization.

How to check wait process in Linux? ›

We can use several commands to identify whether I/O is causing system slowness, but the easiest is the Unix command top . From the CPU(s) line, we can see the current CPU usage and what that CPU time is being spent on. In the example above, we can see our CPU is 96% waiting for I/O access.

How to check Linux process running time? ›

1. ps Command. The ps command is a fundamental tool for viewing information about processes on a Linux system. This command lists the process ID (PID), command name, and elapsed time (etime) for all processes.

What is a high IOWait time? ›

As such, I/O Wait doesn't have a standard value that is considered high. What is considered high for a given system is when the I/O Wait affects the server's overall performance. However, consistent I/O Wait over 10% should be investigated, as it could be a sign of a degraded or failing drive.

What is a good Load Average for Linux? ›

For most Linux servers, it's ideal to maintain a Load Average that is less than the total number of CPU cores. When the load exceeds this threshold, the system starts to experience considerable stress.

How to check CPU workload in Linux? ›

  1. How to Check CPU Usage from Linux Command Line. top Command to View Linux CPU Load. mpstat Command to Display CPU Activity. sar Command to Show CPU Utilization. iostat Command for Average Usage.
  2. Other Options to Monitor CPU Performance. Nmon Monitoring Tool. Graphical Utility Option.
Mar 6, 2024

What is the IOWait process in Linux? ›

IOWait in this context is the measure of time over a given period that a CPU (or all CPUS) spent idle because all runnable tasks were waiting for a IO operation to be fulfilled.

What is idle time in Linux? ›

The special “idle” task becomes runnable if there are no other runnable tasks assigned to the given CPU and the CPU is then regarded as idle. In other words, in Linux idle CPUs run the code of the “idle” task called the idle loop.

How to check CPU wait time in Linux? ›

You can use web-based root cause analysis tools like yCrash to report 'waiting' CPU time. Tool is capable of generating alerts if 'waiting' CPU time goes beyond the threshold. b. 'waiting' CPU time is also reported in the Unix/Linux command line tool 'top' in the field 'wa' as highlighted in the below image.

How to check os time in Linux? ›

The 'date' command in Linux is used to display and set the system date and time. You can simply type date in the terminal and hit enter to display the current date and time.

Top Articles
Latest Posts
Recommended Articles
Article information

Author: Stevie Stamm

Last Updated:

Views: 5410

Rating: 5 / 5 (60 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Stevie Stamm

Birthday: 1996-06-22

Address: Apt. 419 4200 Sipes Estate, East Delmerview, WY 05617

Phone: +342332224300

Job: Future Advertising Analyst

Hobby: Leather crafting, Puzzles, Leather crafting, scrapbook, Urban exploration, Cabaret, Skateboarding

Introduction: My name is Stevie Stamm, I am a colorful, sparkling, splendid, vast, open, hilarious, tender person who loves writing and wants to share my knowledge and understanding with you.