Report this

What is the reason for this report?

what is jbd2/vda1-8 ? using high io

Posted on January 25, 2018

Hi,

I see that jbd2/vda1-8 using high i/o in iotop. What is it doing?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

jbd2/vda1-8 refers to the journal thread for the ext4 filesystem on the device vda1. Here’s a more detailed explanation of what it is and why it might be using high I/O:

Understanding jbd2

  • jbd2: The jbd2 (Journal Block Device version 2) is a kernel thread that handles journaling for the ext4 filesystem. Journaling is a feature that helps protect the filesystem integrity by keeping track of changes not yet committed to the main filesystem.
  • vda1: This indicates the specific partition on the virtual disk (in this case, the first partition of the virtual disk vda).
  • -8: This typically refers to the thread identifier or a specific instance of the journal thread for that partition.

What is jbd2 Doing?

The jbd2 thread is responsible for writing changes to the filesystem journal before they are committed to the main filesystem. This ensures that in the event of a crash or power failure, the filesystem can recover to a consistent state.

Reasons for High I/O Usage

  1. High Write Activity: If your system or applications are performing a lot of write operations, the jbd2 thread will be more active as it logs these changes.
  2. Large Files or Databases: Operations involving large files or databases can generate significant journal activity.
  3. Frequent File Operations: Frequent creation, modification, and deletion of files increase journal writes.
  4. Background Processes: Background services such as loggers, databases, or other services generating continuous writes can increase jbd2 activity.

Diagnosing High I/O Usage

To understand why jbd2 is consuming high I/O, you can:

  1. Monitor Disk Activity:

    • Use iotop to see which processes are causing high I/O.
    • Use iostat to get an overview of the I/O usage.
    • Use vmstat to check for overall system performance including I/O.
sudo iotop -o
sudo iostat -dx 1
sudo vmstat 1
  1. Check Filesystem Usage:
  • Use du and df to see disk usage.
  • Use lsof to list open files and see which processes are writing to the disk.
sudo du -h /var/log
sudo df -h
sudo lsof +D /path/to/directory
  1. Review System Logs:
  • Check /var/log/syslog or /var/log/messages for any unusual activity.
sudo tail -f /var/log/syslog
sudo tail -f /var/log/messages
  1. Tune System Settings:
  • Adjust the commit interval in /etc/fstab to control how often the journal commits data to the disk.

Example for 5-second interval (default is usually 5 seconds):

UUID=xxxx-xxxx-xxxx-xxxx / ext4 defaults,commit=5 0 1

Reducing High I/O Usage

  1. Reduce Write Frequency: Modify applications to reduce the frequency of write operations if possible.

  2. Optimize Applications: Ensure that applications are writing efficiently and not excessively.

  3. Use noatime and nodiratime: These mount options reduce the number of writes by not updating access times on reads.

    Example /etc/fstab entry:

UUID=xxxx-xxxx-xxxx-xxxx / ext4 defaults,noatime,nodiratime 0 1
  1. Consider Alternative Filesystems: If write performance is a critical issue, consider filesystems designed for high write performance, such as XFS or btrfs.

By monitoring and optimizing the write operations on your system, you can reduce the load on the jbd2 thread and improve overall performance.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.