GNU/Linux >> Linux Esercitazione >  >> Cent OS

Come impostare l'affinità della CPU per il processo SYSTEMD in CentOS/RHEL 7

Affinità CPU è una delle direttive per controllare l'affinità della CPU dei processi eseguiti da systemd.

dalla pagina man di systemd.exec:

# man systemd.exec

CPUAffinity=

Controls the CPU affinity of the executed processes. Takes a list of CPU indices or ranges separated by either
 whitespace or commas. CPU ranges are specified by the lower and upper CPU indices separated by a dash. This 
option may be specified more than once in which case the specified CPU affinity masks are merged. If the empty 
string is assigned, the mask is reset, all assignments prior to this will have no effect. See sched_setaffinity(2)
 for details.

Configurazione dell'affinità della CPU

1. Modifica il file “/etc/systemd/system.conf “:

# vi /etc/systemd/system.conf

2. Decommenta “CPUaffinity ” e aggiungere i numeri della CPU.

CPUAffinity=2,3

3. Riavvia il server e verifica lo stato dell'affinità della CPU.

Verifica

I seguenti comandi rivelano l'affinità del processo con la CPU:

# taskset -p [process ID]
# ps --ppid 2 -p 2 -o uname,pid,ppid,cmd,cls,psr --deselect


Cent OS
  1. Linux:come impostare l'affinità della CPU predefinita per tutti i demoni in Systemd?

  2. CentOS / RHEL:come abilitare SSL per Apache

  3. Come impostare children-max per il servizio udev in CentOS/RHEL 7

  4. Come controllare la risorsa (cgroup) con systemd per il gruppo di processi utente in CentOS/RHEL 7

  5. Come impostare i valori ulimit per un servizio systemd

Come installare/aggiornare Systemd su RHEL/CentOS 7

Come impostare/modificare il nome host in CentOS 8 / RHEL 8

Come installare Varnish Cache 6 per Nginx su CentOS/RHEL 8

Come configurare una VPN basata su IPsec con Strongswan su CentOS/RHEL 8

Come configurare SSH su CentOS e RHEL

Come impostare l'affinità della CPU per un processo da C o C++ in Linux?