• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

chrt : command not found

by Deepika

The chrt command is a utility in Linux that is used to set the real-time scheduling policy and priority of a process. Real-time scheduling is a type of scheduling algorithm that is used to give priority to certain processes and ensure that they are executed in a timely manner.

To use the chrt command, you will need to specify the priority level and scheduling policy that you want to set for a process. The priority levels range from -20 (highest priority) to 19 (lowest priority). The scheduling policies include SCHED_FIFO (first-in, first-out), SCHED_RR (round-robin), and SCHED_OTHER (normal scheduling).

For example, to set the priority level to -5 and the scheduling policy to SCHED_FIFO for the process with PID 12345, you can use the following command:

# chrt -f -p -5 12345

This will set the priority level to -5 and the scheduling policy to SCHED_FIFO for the process with PID 12345.

You can also use the chrt command with the -m option to display the current real-time scheduling policy and priority of a process:

# chrt -m 12345

This will display the current real-time scheduling policy and priority of the process with PID 12345.

If you encounter the below error while running the command chrt :

chrt: command not found

you may try installing the below package as per your choice of distribution:

Distribution Command
Debian apt-get install util-linux
Ubuntu apt-get install util-linux
Alpine apk add util-linux
Arch Linux pacman -S util-linux
Kali Linux apt-get install util-linux
CentOS yum install util-linux
Fedora dnf install util-linux
OS X brew install util-linux
Raspbian apt-get install util-linux

chrt Command Examples

1. Display attributes of a process:

# chrt --pid PID

2. Display attributes of all threads of a process:

# chrt --all-tasks --pid PID

3. Display the min/max priority values that can be used with `chrt`:

# chrt --max

4. Set the scheduling policy for a process:

# chrt --pid PID --deadline|idle|batch|rr|fifo|other

Conclusion

The chrt command is useful for fine-tuning the performance of real-time processes and ensuring that they are given the necessary resources to execute in a timely manner. It is also useful for setting the real-time scheduling policy and priority of processes that require a higher level of priority, such as audio or video playback applications.

Filed Under: Linux

Some more articles you might also be interested in …

  1. btrbk Command Examples in Linux
  2. kwrite Command Examples in Linux
  3. sudo: command not found
  4. How to Identify NIS Authenticated Users
  5. mpstat Command Examples in Linux
  6. CentOS / RHEL 7 : How to enable telnet for a group of users
  7. pwck Command Examples in Linux
  8. Linux Vs Windows – Why Linux Is Better For Programming & Web Dev
  9. mtr Command Examples in Linux
  10. Why Does “netstat” Output Show Many Connections in CLOSE_WAIT Status?

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright