Created on
08-23-2019
01:30 AM
Edited on
09-18-2025
01:05 AM
By
Debbie_FTNT
Description
This article describes general actions that could be taken and which information should be sent to Fortinet Support in case of unexpected entry of the unit into Conserve Mode, the unit is out of memory.
Scope
FortiGate.
Solution
get system performance status
CPU states: 1% user 0% system 0% nice 99% idle 0% iowait 0% irq 0% softirq
CPU0 states: 1% user 0% system 0% nice 99% idle 0% iowait 0% irq 0% softirq
Memory: 2004540k total, 586528k used (29%), 1418012k free (71%)
Average network usage: 1 / 0 kbps in 1 minute, 0 / 0 kbps in 10 minutes, 0 / 0 kbps in 30 minutes
Average sessions: 25 sessions in 1 minute, 25 sessions in 10 minutes, 25 sessions in 30 minutes
Average session setup rate: 0 sessions per second in last 1 minute, 0 sessions per second in last 10 minutes, 0 sessions per second in last 30 minutes
Virus caught: 0 total in 1 minute
IPS attacks blocked: 0 total in 1 minute
Uptime: 0 days, 23 hours, 41 minutes
Run the command above a few times and compare patterns of memory usage, throughput, and number of sessions.
Memory: 2004540k total, 586528k used (29%), 1418012k free (71%)
If the used memory is more than 75%, this may indicate that a further check may be required. The unit is either getting overloaded, or there is a memory leak in some process/kernel, or there is a lot of cached memory.
Check the amount of traffic and compare it to the datasheet (throughput section). If it is too close, the device is likely to be overloaded, and there is a sizing issue. If the amount is vastly different between the last 1 minute and the last 30 minutes, this might indicate a traffic spike.
Average sessions: 25 sessions in 1 minute, 25 sessions in 10 minutes, 25 sessions in 30 minutes
Session table is stored in memory as well.
Higher number of sessions lead to higher memory usage.
FortiGate performance data sheet also defines the maximum number of sessions firewall can handle.
diag sys top 1 45 199
In order:
process name, Process ID, Process state, CPU usage %, and Memory usage %, the last column is the CPU core on which the process is running.
By default, processes are sorted by CPU usage (4th column). To sort processes by memory usage (5th column) to find out which process is consuming the most memory resources, press Shift + M.
Check % of memory usage to see if any process is constantly using an unreasonably high fraction of memory, which may be the process causing the issue.
Note 1:
Some processes can have multiple instances, like 'miglogd' in the example above. WAD and IPSengine are also such processes.
In such cases, sum up the total memory usage for all instances, and it should not exceed -20 -25%, but it depends on the device and its total memory - for small devices with a small amount of memory, it might be normal. Security profiles like Web filtering and antivirus can increase memory usage.
diagnose sys top | grep miglogd <----- Use grep to group all instances with process name <miglogd>.
Note 2:
In rare cases, the output of the 'get system performance status' command can show that memory utilization is high (for example, more than 90%), but at the same time 'diagnose sys top' command does not indicate any processes that are using memory. This can indicate that memory is utilized by the kernel and/or being cached. For that, refer to the following two articles:
Technical Tip: High cached memory due to increasing file-sizes
Technical Tip: FortiGate out of memory due to memory cache on v7.0/v7.2
get system status
get system performance status <----- Use this command three times, leaving a time of 1 minute between each execution.
diagnose sys top 2 40 <----- Let this command run for 1 minute, then stop it by pressing 'q' or add a repeat value to the end of the command to automate. For example, 'diagnose sys top 2 40 30'.
diagnose sys top-summary <----- Let this command run for 1 minute, then stop it by pressing 'q' - on FortiOS v6.4, this command does not exist.
diagnose sys top-mem <----- Run this command 4 - 5 times.
diagnose hardware sysinfo memory
diagnose hardware sysinfo slab
diagnose hardware sysinfo shm
diagnose autoupdate versions
diagnose hardware sysinfo conserve
diagnose sys session stat
diagnose debug crashlog read <----- It lists all instances with timestamp for conserve modes and crashes, if any.
And these commands for each VDOM, if configured:
get log disk setting
get log disk filter
get log memory setting
get log memory filter
Meanwhile, the following script can be used when FortiGate starts entering conserve mode and exits out of conserve mode once rebooted.
By default, the maximum log size of an auto-script is 10MB. If the file size is reached, the log is deleted and the script starts anew. It should be avoided to use commands that generate too many outputs, such as 'execute tac report' or 'diagnose sys session list'.
config system auto-script
edit "performance"
set interval 60 <- Will run every minute.
set repeat 3600
set start manual
set script "
execute time
get system performance status
get system ha status
diagnose hardware sysinfo memory
diagnose sys session full-stat
diagnose sys top 1 20 1"
set output-size 20
next
end
To start the script:
execute auto-script start SCRIPT_NAME
To stop the script:
execute auto-script stop SCRIPT_NAME
To view results for the script:
execute auto-script result SCRIPT_NAME
This will help find the process responsible for the high CPU/high memory, pushing FortiGate to conserve mode at the time of the incident.
If the process is still consuming an abnormally large amount of memory resources, consider opening a Technical Support ticket (Support) and attaching the output to the ticket along with configuration and debug.log files while contacting Fortinet TAC (Support).
fnsysctl df -k
fnsysctl du -i /tmp
fnsysctl du -a /tmp
fnsysctl du -i /dev/shm
fnsysctl du -a /dev/shm
fnsysctl du -i /dev/cmdb
fnsysctl du -l /dev/cmdb
fnsysctl ls -l /dev/shm
Note:
Super Admin privilege is required to run the 'fnsysctl' command. Otherwise, FortiGate will return an error, as explained in Troubleshooting Tip: fnsysctl command returns Unknown action 0
Analyze the collected information and Cli output and proceed to steps such as:
diagnose sys process pid <process id>
To obtain the process ID number:
diagnose sys process pidof <PPROCESS_NAME>
To obtain detailed process information:
diagnose sys process dump <process id>
Here are reference articles about restarting daemons, including different methods:
Technical Tip: Find and restart/kill a process on a FortiGate by the process ID (PID) via pidof
Technical Tip: Restarting internal processes/daemons
Note:
The 'crashlog' might correlate with SNMP monitoring to has been set up for this FortiGate.
External monitoring and recording, like SNMP, can greatly help to trace when such issues might have started.
Use 'diagnose sys top' as an alternative to 'diagnose sys top-summary'.
Related articles:
Technical Tip: How conserve mode is triggered
Technical Tip: Basic Troubleshooting for high memory or high CPU usage
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.