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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • 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. i3status: command not found
  2. eject: command not found
  3. ptx: command not found
  4. repquota: command not found
  5. “docker exec” Command Examples
  6. gdb: The GNU Debugger
  7. CentOS / RHEL 7 : unable to start vsftpd service
  8. Xtreme Download Manager(xdman): Internet Download Manager(IDM) For Ubuntu
  9. jarsigner: command not found
  10. ip Command Examples to Manage Networking in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • “glab pipeline” Command Examples
  • “glab mr” Command Examples
  • “glab mr merge” Command Examples
  • “glab mr” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright