Este contenido no está disponible en el idioma seleccionado.

Chapter 4. Reviewing a system by using the tuna interface


The tuna tool reduces the complexity of performing tuning tasks. Use tuna to adjust scheduler tunables, tune thread priority, IRQ handlers, and to isolate CPU cores and sockets. By using the tuna tool, you can perform the following operations:

  • List the CPUs on a system.
  • List the interrupt requests (IRQs) currently running on a system.
  • Change policy and priority information about threads.
  • Display the current policies and priorities of a system.

4.1. Installing the tuna tool

The tuna tool is designed to be used on a running system. This allows application-specific measurement tools to see and analyze system performance immediately after changes have been made.

Procedure

  • Install the tuna tool:

    # dnf install tuna
    Copy to Clipboard Toggle word wrap

Verification

  • Display the available tuna CLI options:

    # tuna -h
    Copy to Clipboard Toggle word wrap

4.2. Viewing the system status by using the tuna tool

You can use the tuna command-line interface (CLI) tool to view the system status.

Prerequisites

Procedure

  1. View the current policies and priorities:

    # tuna show_threads
    pid   SCHED_ rtpri affinity             cmd
    1      OTHER     0      0,1            init
    2       FIFO    99        0     migration/0
    3      OTHER     0        0     ksoftirqd/0
    4       FIFO    99        0      watchdog/0
    Copy to Clipboard Toggle word wrap

    Alternatively, to view a specific thread corresponding to a PID or matching a command name, enter:

    # tuna show_threads -t pid_or_cmd_list
    Copy to Clipboard Toggle word wrap

    The pid_or_cmd_list argument is a list of comma-separated PIDs or command-name patterns.

  2. Depending on you scenario, perform one of the following actions:

  3. Save the changed configuration:

    # tuna save filename
    Copy to Clipboard Toggle word wrap

    This command saves only currently running kernel threads. Processes that are not running are not saved.

4.3. Tuning CPUs by using the tuna tool

The tuna tool commands can target individual CPUs. By using the tuna tool, you can perform the following actions:

Isolate CPUs
All tasks running on the specified CPU move to the next available CPU. Isolating a CPU makes this CPU unavailable by removing it from the affinity mask of all threads.
Include CPUs
Allows tasks to run on the specified CPU.
Restore CPUs
Restores the specified CPU to its previous configuration.

Prerequisites

Procedure

  1. List all CPUs and specify the list of CPUs to be affected by the command:

    # ps ax | awk 'BEGIN { ORS="," }{ print $1 }'
    PID,1,2,3,4,5,6,8,10,11,12,13,14,15,16,17,19
    Copy to Clipboard Toggle word wrap
  2. Display the thread list in the tuna interface:

    # tuna show_threads -t 'thread_list from above cmd'
    Copy to Clipboard Toggle word wrap
  3. Specify the list of CPUs to be affected by a command:

    # *tuna [command] --cpus cpu_list *
    Copy to Clipboard Toggle word wrap

    The cpu_list argument is a list of comma-separated CPU numbers, for example, --cpus 0,2.

    To add a specific CPU to the current cpu_list, use, for example, --cpus +0.

  4. Depending on your scenario, perform one of the following actions:

    • To isolate a CPU, enter:

      # tuna isolate --cpus cpu_list
      Copy to Clipboard Toggle word wrap
    • To include a CPU, enter:

      # tuna include --cpus cpu_list
      Copy to Clipboard Toggle word wrap
  5. To use a system with four or more processors, make all ssh threads run on CPU 0 and 1 and all http threads on CPU 2 and 3:

    # tuna move --cpus 0,1 -t ssh*
    # tuna move --cpus 2,3 -t http\*
    Copy to Clipboard Toggle word wrap

Verification

  • Display the current configuration and verify that the changes were applied:

    # tuna show_threads -t ssh*
    
    pid   SCHED_  rtpri  affinity   voluntary   nonvoluntary   cmd
    855   OTHER   0      0,1        23           15            sshd
    
    # tuna show_threads -t http\*
    pid   SCHED_  rtpri  affinity   voluntary   nonvoluntary   cmd
    855   OTHER   0       2,3        23           15           http
    Copy to Clipboard Toggle word wrap

4.4. Tuning IRQs by using the tuna tool

The /proc/interrupts file records the number of interrupts per IRQ, the type of interrupt, and the name of the device that is located at that IRQ.

Prerequisites

Procedure

  1. View the current IRQs and their affinity:

    # tuna show_irqs
    # users            affinity
    0 timer                   0
    1 i8042                   0
    7 parport0                0
    Copy to Clipboard Toggle word wrap
  2. Specify the list of IRQs to be affected by a command:

    # tuna [command] --irqs irq_list --cpus cpu_list
    Copy to Clipboard Toggle word wrap

    The irq_list argument is a list of comma-separated IRQ numbers or user-name patterns.

    Replace [command] with, for example, --spread.

  3. Move an interrupt to a specified CPU:

    # tuna show_irqs --irqs 128
    users            affinity
    128 iwlwifi           0,1,2,3
    
    # tuna move --irqs 128 --cpus 3
    Copy to Clipboard Toggle word wrap

    Replace 128 with the irq_list argument and 3 with the cpu_list argument.

    The cpu_list argument is a list of comma-separated CPU numbers, for example, --cpus 0,2. For more information, see Tuning CPUs by using the tuna tool.

Verification

  • Compare the state of the selected IRQs before and after moving any interrupt to a specified CPU:

    # tuna show_irqs --irqs 128
         users            affinity
     128 iwlwifi                 3
    Copy to Clipboard Toggle word wrap
Volver arriba
Red Hat logoGithubredditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar. Explore nuestras recientes actualizaciones.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

Theme

© 2025 Red Hat