Description | This article describes how to resolve a scenario with high CPU usage in the system space because of the inet_hash_connect function. |
Scope | FortiGate. |
Solution |
When troubleshooting CPU issues, the first step is to determine in which category of usage it is. This case focuses on high system space usage.
The following is an example of high system usage:
FGT01 # get system performance status CPU states: 0% user 99% system 0% nice 1% idle 0% iowait 0% irq 0% softirq
Since this issue can happen very intermittently, it is best to use diagnose sys mpstat instead of diagnose system performance status.
FGT01 # diagnose sys mpstat TIME CPU %usr %nice %sys %iowait %irq %soft %steal %idle
TIME CPU %usr %nice %sys %iowait %irq %soft %steal %idle
Once high system space is identified, perform CPU profiling. This shows what functions are being called by FortiOS and can provide some insight why high system space usage has been observed. Follow the steps provided in Troubleshooting Tip: FortiGate CPU Profiling.
In cases of source port exhaustion, the function inet_hash_connect will be found in the list. The higher it is in the list, the more FortiOS is preoccupied with this issue.
Kernel=0xffffffff80200190-0xffffffff8062c69d, module-gap=0x1f9d3963
Possible workarounds:
config system global
The configurable port range is for TCP layer. By default, it is not overlapping with the port range(fixed, not configurable) used by firewall layer. When enlarging the configurable port range the two port ranges start to overlap each other.
Having multiple outgoing IPs will increase the source ports FortiOS can draw from by 25000 for every added IP.
The following is an example configuration:
config system interface config web-proxy explicit
A lower session TTL will free up ports more quickly. For more information, refer to the following articles: |
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.