当前位置:网站首页>RHCE 8.0 learning diary day13

RHCE 8.0 learning diary day13

2020-11-10 15:20:36 The shadow of rebellion 1992

System performance tuning

Adjust tuning profile

tuned To optimize system performance by tuning configuration files managed by the daemons , There are two ways to tune: dynamic and static .

Static tuning will change the configuration file by tuned Predefined application at run time kernel Parameters to configure .

Dynamic tuning ,tuned The daemons monitor system activity , And adjust according to the change of runtime behavior .

Tuned The profile classification provided by the application :

  • Energy efficient profile
  • Performance enhanced profiles :1. Low latency for storage and networking . 2. High throughput of storage and network .3. Virtual machine performance .4. Virtualization host performance .

tuned-adm The command is used to change tuned Settings for the daemons . You can query the current settings 、 List the available configuration files 、 Recommend tuning profiles for your system 、 Change the configuration file directly or turn off tuning .

tuned-adm active Determine the tuning profile for the current activity .

tuned-adm list List all available tuning profiles . Includes built-in configuration files and custom tuning configuration files created by system administrators .

tuned-adm profile profilename You can switch the active configuration file to a configuration file that is more in line with the current tuning requirements of the system . Example :

tuned-adm recommend Used to determine the default configuration file of the system after installation .

tuned-adm off    close tuned Tuning activities

Affect process scheduling

The scheduling policy used by most processes running on a regular system is called SCHED_OTHER, Processes running with a secondary policy specify a relative priority . This priority is called the process's nice value , Yes 40 Different levels of nice value .

nice The range of level values is between -20( Highest priority ) To 19( Lowest priority ) Between . By default , Usually it is 0.

The privileges of non privileged users can only improve their own processes nice Level , Only root Users can reduce the process of nice Level , Modify other user processes nice Level .

top command Default display nice Level and priority .NI Column shows the process of nice value ,PR Column shows the priority of its schedule .top In the interface ,nice Levels map to internal system priority queues .nice Level -20 Map to PR In column 0.nice Level 19 Map to PR The priority in the column 39.

When creating a process , A process inherits its parent nice Level . When the command line starts a process , The process will start from shell The process inherits nice Level . This leads to a new process of nice The level is usually 0.

nice Command to start with default or higher nice Level command . Default start a default nice The value is 10 The process of .

-n Options can be user-defined nice Level is applied to the started process . The default setting is 10. Example :sha1sum The process started by the command is 15

renice Command can change the existing process's nice Level . Example : Change the current nice Level from 15 Change to 19

Use ACL Control access to files

Access control list (ACL) Multiple specified users and groups access files with different file permission sets . Enable file system ACL Support ,mount Order or in /etc/fstab Use in the file system entry of the configuration file ACL Options .

ls -l  The command outputs the least ACL Set details .

10 The plus sign at the end of the character permission string (+) Indicates that there are extensions with several entries on the file ACL structure .

user : Show users ACL Set up , It's the same as the standard user file settings ;rwx.

Group : Show current ACL Mask settings , Instead of the group owner setting ;rw.

other : Show others ACL Set up , It's the same as other standard file settings ; No access .

If you use chmod The change has ACL Group permissions for files of , The group owner permissions are not changed , It's a change ACL Mask . If you want to update the group owner permissions for a file , Need to use setfacl  -mg ::perms file.

getfacl file , Show... On the file ACL Set up .

getfacl  directory command . Show... On the table of contents ACL Set up .

ACL Mask definition can be granted to specified users 、 Maximum permissions for the group owner and the specified group ., All implementation ACL The files and directories of will have ACL Mask .

getfacl Look at the mask .setfacl Display settings mask . Every time you add 、 Modify or delete any affected ACL when , Will recalculate the mask .

ACL Permission priority rules :

  • If you are running a process as the file owner , Then the user of the application file ACL jurisdiction .
  • If you are specifying the user ACL The user ID listed in the entry runs the process , The specified user is applied ACL jurisdiction ( As long as the mask allows ).
  • If you are running the process as a group that matches the group owner of the file , Or display the specified group with ACL The group identity of the entry runs the process , Then apply the matching ACL jurisdiction ( As long as the mask allows ).
  • otherwise , Other... Of the file will be applied ACL jurisdiction .

版权声明
本文为[The shadow of rebellion 1992]所创,转载请带上原文链接,感谢