Nice and renice scheduling in Linux takes precedence

Source: Internet
Author: User

The scheduling priority is an integer value, from 20 (highest priority) to +20 (lowest priority). By default, the bash shell starts a process of 0 for all priority processes!

  1. Nice command: nice-n
    The nice command can set the priority when the command is started!
    [Email protected] ~]# nice-n/test39.sh > Test39out &

    [1] 7753

    [[Email protected] ~]# PS AL

    F UID PID PPID PRI NI VSZ RSS wchan STAT TTY time COMMAND

    4 0 2151 1 0 1664 420-ss+ tty1 0:00/sbin/mingetty

    4 0 2162 1 0 1664 420-ss+ Tty2 0:00/sbin/mingetty

    4 0 2167 1 0 1664 424-ss+ tty3 0:00/sbin/mingetty

    4 0 2170 1 0 1664 420-ss+ Tty4 0:00/sbin/mingetty

    4 0 2173 1 0 1664 420-ss+ tty5 0:00/sbin/mingetty

    4 0 2203 1 0 1664 420-ss+ tty6 0:00/sbin/mingetty

    4 0 6904 6902 0 5080 1640 wait Ss pts/1 0:00-bash

    0 0 7753 6904 4736 992 finish TN pts/1 0:00/bin/bash./tes

    4 0 7754 6904 0 4460 812-r+ pts/1 0:00 PS al

    [1]+ Stopped nice-n/test39.sh > Test39out

  2. Renice command
    Change the priority of a command in a running system
    [Email protected] ~]# renice 9-p 7753

    7753:old priority Ten, new priority 9

    [[Email protected] ~]# PS AL

    F UID PID PPID PRI NI VSZ RSS wchan STAT TTY time COMMAND

    4 0 2151 1 0 1664 420-ss+ tty1 0:00/sbin/mingetty

    4 0 2162 1 0 1664 420-ss+ Tty2 0:00/sbin/mingetty

    4 0 2167 1 0 1664 424-ss+ tty3 0:00/sbin/mingetty

    4 0 2170 1 0 1664 420-ss+ Tty4 0:00/sbin/mingetty

    4 0 2173 1 0 1664 420-ss+ tty5 0:00/sbin/mingetty

    4 0 2203 1 0 1664 420-ss+ tty6 0:00/sbin/mingetty

    4 0 6904 6902 0 5080 1640 wait Ss pts/1 0:00-bash

    0 0 7753 6904 9 4736 992 finish TN pts/1 0:00/bin/bash./tes

    4 0 7762 6904 0 4460 840-r+ pts/1 0:00 PS al

This article is from the Linux Operations sharing blog, so be sure to keep this source http://liangey.blog.51cto.com/9097868/1575061

Nice and renice scheduling in Linux takes precedence

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.