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.
nevan
Staff
Staff
Article Id 373188
Description This article provides the configuration example for killing any process with high memory consumption.
Scope FortiGate.
Solution

If any process interrupts the service, causing the memory high and is required to kill the process, it can be done automatically with an automation stitch.

The following article can be used to find out the process behind the high memory incident: Troubleshooting Tip: How to do initial troubleshooting of high memory utilization issues (conserve ...

Once the process is being identified, it can be set in the following template to kill it during the high memory incident.

 

config system automation-action
    edit "kill_process"
      set action-type cli-script
      set script "fnsysctl killall <process_name>" <-- Input the process name; Ex: httpsd, cw_acd etc.
    next
end

 

config system automation-trigger
    edit "high_memory_trigger"
      set event-type low-memory
    next
end

 

config system automation-stitch
    edit "auto_kill_process"
      set trigger "high_memory_trigger"
        config actions
            edit 1
               set action "kill_process"
            next
        end
    next
end

 

There are impacts on killing a process such as the daemon being restarted and in the case of a production network, it can restart the process as well as sessions. Before using it, the scope and the risk have to be evaluated.

If the high memory event halts the firewall and all the services, killing the process can be helpful in that scenario. 

Related articles:
Technical Tip: Free up memory to avoid conserve mode
Technical Tip: How conserve mode is triggered

 

Contributors