Questo è quello che viene indicato nella pagina del supporto:
Resolution
The most straightforward way to do this is to edit the service definition file as follows.
Assuming you want to tie the service to CPU #24, you would add the CPUAffinity line to the [Service] definition. In the example below, we’ve also used isolcpus to isolate most of the CPUs from the process scheduler, so we can assign them to specific services. See What is the use of kernel parameter “isolcpus” ? for more information on isolcpus.
Raw
# cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-3.10.0-327.el7.x86_64 root=/dev/mapper/rhel-root ro rd.lvm.lv=rhel/root crashkernel=auto rd.lvm.lv=rhel/swap vconsole.font=latarcyrheb-sun16 vconsole.keymap=us rhgb quiet isolcpus=1-3,5-31
# grep -A2 Service /usr/lib/systemd/system/httpd.service
[Service]
Type=notify
EnvironmentFile=/etc/sysconfig/httpd
# sed '/^\[Service\]$/a CPUAffinity=24' /usr/lib/systemd/system/httpd.service > /etc/systemd/system/test.service
# grep -A2 Service /etc/systemd/system/test.service
[Service]
CPUAffinity=24
Type=notify
# systemctl start test.service
# systemctl status test.service
● test.service - The Apache HTTP Server
Loaded: loaded (/etc/systemd/system/test.service; disabled; vendor preset: disabled)
Active: active (running) since Wed 2016-01-27 18:55:19 EST; 1s ago
Docs: man:httpd(8)
man:apachectl(8)
Main PID: 2910 (httpd)
Status: "Processing requests..."
CGroup: /system.slice/test.service
├─2910 /usr/sbin/httpd -DFOREGROUND
├─2911 /usr/sbin/httpd -DFOREGROUND
├─2912 /usr/sbin/httpd -DFOREGROUND
├─2913 /usr/sbin/httpd -DFOREGROUND
├─2914 /usr/sbin/httpd -DFOREGROUND
└─2915 /usr/sbin/httpd -DFOREGROUND
Jan 27 18:55:17 amnesiac systemd[1]: Starting The Apache HTTP Server...
Jan 27 18:55:19 amnesiac systemd[1]: Started The Apache HTTP Server.
# grep -i cpu /proc/291?/status
/proc/2910/status:Cpus_allowed: 01000000
/proc/2910/status:Cpus_allowed_list: 24
/proc/2911/status:Cpus_allowed: 01000000
/proc/2911/status:Cpus_allowed_list: 24
/proc/2912/status:Cpus_allowed: 01000000
/proc/2912/status:Cpus_allowed_list: 24
/proc/2913/status:Cpus_allowed: 01000000
/proc/2913/status:Cpus_allowed_list: 24
/proc/2914/status:Cpus_allowed: 01000000
/proc/2914/status:Cpus_allowed_list: 24
/proc/2915/status:Cpus_allowed: 01000000
/proc/2915/status:Cpus_allowed_list: 24
Note that CPUAffinity takes a space-separated list of CPU indices. 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.