FortiGate
FortiGate Next Generation Firewall utilizes purpose-built security processors and threat intelligence security services from FortiGuard labs to deliver top-rated protection and high performance, including encrypted traffic.
vsharma
Staff
Staff
Article Id 424038
Description This article describes how to configure syslog affinity and verify that the syslog process is running only on the intended CPUs.
Scope FortiGate VMs and FortiOS 7.4.8+.
Solution

syslogd is a process responsible for handling logging operations.

 

In scenarios requiring controlled CPU utilization, syslog can be restricted to specific CPUs rather than running on a broad or unrestricted CPU range.

 

config system global
    set syslog-affinity "<affinity-mask>"
end

 

Before configuring the affinity:

 

diagnose sys process pidof syslogd
2209

 

fnsysctl cat /proc/2209/status
Name: syslogd

Umask: 0022
State: S (sleeping)
Tgid: 2209
Ngid: 0
Pid: 2209

---clipped------------

Cpus_allowed: f
Cpus_allowed_list: 0-3  <----- Allowed to run on all four CPUs.
Mems_allowed: 00000000,00000001
Mems_allowed_list: 0
voluntary_ctxt_switches: 25492
nonvoluntary_ctxt_switches: 3

 

Restricting syslogd to CPUs 0 and 1.

 

config sys global

set syslog-affinity "0x0000000000000003"

end

 

fnsysctl cat /proc/2209/status
Name: syslogd
Umask: 0022
State: S (sleeping)
Tgid: 2209
Ngid: 0
Pid: 2209
PPid: 1

-----clipped---------

Speculation_Store_Bypass: thread vulnerable
Cpus_allowed: 3
Cpus_allowed_list: 0-1 <----- syslogd restricted to CPUs 0 and 1.
Mems_allowed: 00000000,00000001
Mems_allowed_list: 0
voluntary_ctxt_switches: 25596
nonvoluntary_ctxt_switches: 3