Linux Operating system principles

Source: Internet
Author: User

Linux: Process preemption, preemption based on time interruption
System clock: Internal clock frequency, resulting in clock interrupts
TICK: Time resolution, number of interrupts Hz

100Hz 100 times per second interrupt
1000Hz
Every tick produces a clock break that can be robbed.
A:5MS, 1ms
C:

Process Category:
Interactive process (I/O)
Batch process (CPU)
Real-time process (real-time), immediate response, highest priority

CPU intensive (Batch process): Long time slices, low priority
IO-intensive (interactive process): Short time slices, high priority


[Email protected] ~]# ps-e-o class,rtprio,nice,pri,nice,cmd
CLS rtprio ni PRI ni CMD
TS (Other)-0 0/sbin/init
TS-0 0 [Kthreadd] usually parentheses are kernel threads
FF (FIFO) 99-139-[migration/0]
TS-0 0 [ksoftirqd/0]
FF 99-139-[migration/0]


Liunx Precedence: Priority
Real-time Priority: 1-99, the smaller the number, the lower the priority level
Static priority: 100-139, the smaller the number, the higher the priority

Nice value-20 to 19, corresponding to 100 to 139,nice value of 0 for 120, default = 0
Real-time priority with high static priority level

Nice value: Adjust the static priority level

scheduling category;
Real-time processes:
SCHED Fifo:first in first out scheduling FIFO process
Sched_rr:round Robin scheduling RR's real-time scheduling process
Sched_other: A process that is dedicated to scheduling user-space processes between 100-139

More than 2 of Red Hat 6:

Sched_batch Scheduling Batch Processes

Sched_idle Scheduling Idle Processes

Dynamic Priority:
Temporary high priority, mainly to 100-139 of the process, the user space process, long time did not get time slices or long time to obtain time slices, to adjust
Dynamic priority = MAX (100,min (static Priority-bonus + 5,139)) is equal to 100 and min (static Priority-bonus + 5,139) Maximum number

Bonus (range 10 to 10)

For example, after 110 of the priority penalty for Level 3 measures
110-(-3) +5 =118
Equals 118

To manually adjust the process priority level:

100-139:nice value

Nice N COMMAND

Renice-n Specify a new nice value to specify the PID number

1-99:

Chrt:

-P Specify PID

-F Specify FIFO category

-R Specify RR category

-b Specifies the batch process

-I idle Process

Chrt-f-P [Prio] PID tuning FIFO priority

Chrt-r-P [Prio] PID adjusts RR priority


Chrt-f-P [prio] command to specify priority when command is started

PS-E-o class,rtprio,nice,pri,nice,cmd view command

chrt-p [Prio] COMMAND adjusts the priority of the 100-139 process




This article from "Operation and maintenance Growth Road" blog, declined reprint!

Linux Operating system principles

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.