Best Practices - Security Gateway Performance
Best Practices - Security Gateway Performance
Solution ID sk98348
Technical Level
Product Security Gateway, ClusterXL, Cluster - 3rd party, VSX, CoreXL, SecureXL, Application Control, URL Filtering, Anti-Virus, Anti-Bot, IPS
Version All
Platform / Model All
Date Created 11-Mar-2014
Last Modified 11-Oct-2020
Solution
Click Here to Collapse the Entire Article
(1) Background
(2) Introduction and Limitations
(2-1) SecureXL
(2-2) CoreXL
(2-3) SMT (HyperThreading)
(2-4) Multi-Queue
(3) Best practices
(3-1) Network interface cards
(3-2) Throughput
(3-3) SecureXL
(3-4) CoreXL
(3-5) SecureXL with CoreXL
(3-6) SMT (HyperThreading)
(3-7) Multi-Queue
(3-8) Rulebase optimization
(3-9) IPS optimization
(3-10) Application Control & URL Filtering optimization
(3-11) Anti-Virus & Anti-Bot optimization
(4) Initial diagnostics
(4-1) CPU
(4-2) Memory
(4-3) Network interface cards
(4-4) SecureXL
(4-5) CoreXL
(5) Advanced diagnostics
(5-1) CPU
(5-2) Memory
(5-3) Network interface cards
(5-4) SecureXL
(5-5) CoreXL
(6) Command Line syntax
(6-1) SecureXL
(6-1-A) 'fwaccel' command
(6-1-B) 'sim' command
(6-2) CoreXL
(6-2-A) Gateway mode
(6-2-B) VSX mode
(6-3) Multi-Queue
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product=… 1/59
18/01/2021 Best Practices - Security Gateway Performance
(7) Examples
(8) Related documentation
(9) Related solutions
(10) Revision history
Chapter 2 "Introduction" - lists the relevant definitions, supported configurations, limitations, and commands specific to a product.
Chapter 3 "Best practices" - provides the recommendations and guidelines for achieving the optimal performance.
Chapter 4 "Initial diagnostics" - lists the basic commands and guidelines for checking the current utilization of machine's resources.
Chapter 5 "Advanced diagnostics" - lists the advanced commands and guidelines for checking the current utilization of machine's resources.
Chapter 6 "Command Line syntax" - provides the complete list of commands and their options specific to a product.
(1) Background
Performance of Security Gateway depends on:
Definitions:
Performance Pack is a software acceleration product installed on Security Gateways. Performance Pack uses SecureXL technology and other innovative network
acceleration techniques to deliver wire-speed performance for Security Gateways. SecureXL is implemented either in software, or in hardware (SAM cards on Check
Point 21000 appliances; ADP cards on IP Series appliances).
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product=… 2/59
18/01/2021 Best Practices - Security Gateway Performance
Affinity - Association of a particular network interface with a CPU core (either 'Automatic' (default), or 'Static' / 'Manual'). Interfaces are bound to CPU cores via SMP
IRQ affinity settings (refer to sk61962 - SMP IRQ Affinity on Check Point Security Gateway).
Note: The default SIM Affinity setting for all interfaces is 'Automatic' - the affinity for each interface is automatically reset every 60 seconds, and balanced between al
available CPU cores based on the current CPU load.
Connection offload - Firewall kernel passes the relevant information about the connection from Firewall Connections Table to SecureXL Connections Table.
Note: In ClusterXL High Availability, the connections are not offloaded to SecureXL on Standby member.
Connection notification - SecureXL passes the relevant information about the accelerated connection from SecureXL Connections Table to Firewall Connections Table
Partial connection - Connection that exists in the Firewall Connections Table, but not in the SecureXL Connections Table (versions R70 and above).
Delayed connection - Connection created from SecureXL Connection Templates without notifying the Firewall for a predefined period of time. The notified connection
are deleted by the Firewall.
Anticipated connection - Connection that is anticipated by SecureXL based on policy rules to avoid dropping it by Drop Template.
Accept Template - Feature that accelerates the speed, at which a connection is established by matching a new connection to a set of attributes. When a new
connection matches the Accept Template, subsequent connections are established without performing a rule match and therefore are accelerated. Accept Templates
are generated from active connections according to policy rules. Currently, Accept Template acceleration is performed only on connections with the same destination
port (using wildcards for source ports).
Note: Size of Templates table (cphwd_tmpl, id 8111) is limited to 1/4 of the size of Firewall Connections Table (connections, id 8158).
Drop Template - Feature that accelerates the speed, at which a connection is dropped by matching a new connection to a set of attributes. When a new connection
matches the Drop Template, subsequent connections are dropped without performing a rule match and therefore are accelerated. Currently, Drop Template
acceleration is performed only on connections with the same destination port (does not use wildcards for source ports). Drop Templates are generated from policy
rules by special algorithm:
Accelerated path - Packet flow when the packet is completely handled by the SecureXL device. It is processed and forwarded to the network.
Medium path (PXL) - Packet flow when the packet is handled by the SecureXL device, except for IPS (some protections) / VPN (in some configurations) / Application
Control / Content Awareness / Anti-Virus / Anti-Bot / HTTPS Inspection / Proxy mode / Mobile Access / VoIP / Web Portals. The CoreXL layer passes the packet to one
of the CoreXL FW instances to perform the processing (even when CoreXL is disabled, the CoreXL infrastructure is used by SecureXL device to send the packet to the
single FW instance that still functions).
Firewall path / Slow path (F2F) - Packet flow when the SecureXL device is unable to process the packet (refer to sk32578 - SecureXL Mechanism). The packet is
passed on to the CoreXL layer and then to one of the CoreXL FW instances for full processing. This path also processes all packets when SecureXL is disabled.
Active Streaming (CPAS) - Technology that sends streams of data to be inspected in the kernel, since more than a single packet at a time is needed in order to
understand the application that is running (such as HTTP data). Active Streaming is Read- and Write-enabled, and works as a transparent proxy. Connections that
pass through Active Streaming can not be accelerated by SecureXL.
Passive Streaming - Technology that sends streams of data to be inspected in the kernel, since more than a single packet at a time is needed in order to understand
the application that is running (such as HTTP data). Passive Streaming is Read-only and it cannot hold packets, but the connections are accelerated by SecureXL.
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product=… 3/59
18/01/2021 Best Practices - Security Gateway Performance
Passive Streaming Library (PSL) - IPS infrastructure, which transparently listens to TCP traffic as network packets, and rebuilds the TCP stream out of these packets
Passive Streaming can listen to all TCP traffic, but process only the data packets, which belong to a previously registered connection. For more details, refer to
sk95193 - ATRG: IPS.
QXL - Technology name for combination of SecureXL and QoS (R77.10 and above).
F2F / F2Fed - Packets that can not be accelerated by SecureXL (refer to sk32578 - SecureXL Mechanism) are Forwarded to Firewall.
F2P - Forward to PSL/Applications. Feature that allows to perform the PSL processing on the CPU cores, which are dedicated to the Firewall.
SAM card - Security Acceleration Module card (Acceleration Ready card). Connections that use SAM card, are accelerated by SecureXL and are processed by the SAM
card's CPU instead of the main CPU (refer to 21000 Appliance Security Acceleration Module Getting Started Guide)).
ADP card - Accelerated Data Path card. Connections that use ADP card, are accelerated by SecureXL and are processed by network processors (NP) instead of the
main CPU (refer to sk60508 - How to Configure ADP & SecureXL on IPSO).
IRQ Swizzling - Traditionally, in a PCIe bus, all PCIe ports are mapped to one interrupt. Swizzling allows the PCIe slots to be balanced across four interrupts instead o
one (enabling IRQ Swizzling requires a BIOS update).
Gaia OS
Gaia Embedded OS
SecurePlatform OS
SecurePlatform Embedded OS
IPSO OS
Crossbeam XOS
Crossbeam COS
Traffic flow:
Packet flow:
Flow logic:
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product=… 4/59
18/01/2021 Best Practices - Security Gateway Performance
Accelerated packet:
Non-accelerated packet:
Limitations:
For limitations of traffic acceleration and templating, refer to sk32578 - SecureXL Mechanism.
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product=… 5/59
18/01/2021 Best Practices - Security Gateway Performance
SIM Affinity is applicable only to physical interfaces (VLAN / Bond interfaces are influenced by the "physical" decision).
Note: Some systems may require BIOS update to enable IRQ Swizzling and EIRQ technologies. To determine whether a specific system supports the required
technology, contact your hardware vendor.
On VSX Gateway, WARP interfaces can not be assigned to a CPU core.
SecureXL NAT Templates are supported only in R75.40 and above (sk71200).
SecureXL Drop Templates are supported only in R76 and above (sk66402).
SecureXL Optimized Drops feature (used for DoS/DDoS protection) is supported only in R76 and above (sk90861).
SecureXL Penalty box feature (used for DoS/DDoS protection) is supported only in R75.40VS and above (on VSX Gateway, the penalty box would only be enforced on
Virtual System 0) (sk74520).
SecureXL does not support Point-to-Point interfaces (PPP, PPTP, PPPoE).
In R80.20, SAM is supported only for non-accelerated usage. Traffic connected to the Acceleration-ready 10G Interface Card (CPAC-ACCL-4-10F-21000) will be
handled by the host. 10G Ports on the CPAC-ACCL-4-10F-21000 cannot be assigned as SAM ports in R80.20.
Note: In case a PPP-interface is detected, SecureXL disables itself on that interface (sk79880).
ClusterXL Sticky Decision Function (SDF) disables SecureXL.
QoS disables SecureXL (for R77.10 and above, refer to sk98229).
Delayed Synchronization in cluster:
Applies only to TCP services whose 'Protocol Type' is set to 'HTTP' or 'None'.
Delayed Synchronization is disabled if the 'Track' option in the rule is set to 'Log' or 'Account'.
Delayed Synchronization is performed only for connections matching a SecureXL Connection Template.
It is possible that a connection will exist in the Firewall Connections Table, but not in the SecureXL Connections Table (partial connection).
This situation can occur:
After policy installation
After cluster failover
If user turned off ('fwaccel off' command) and turned on ('fwaccel on' command) acceleration
Documentation:
Definitions:
CoreXL - A performance-enhancing technology for Security Gateways on multi-core processing platforms. CoreXL enhances Security Gateway performance by
enabling the CPU processing cores to concurrently perform multiple tasks.
Secure Network Distributor (SND) - Traffic entering network interface cards (NICs) is directed to a processing CPU core running the SND, which is responsible for:
Firewall Instance / FW Instance - On a Security Gateway with CoreXL enabled, the Firewall kernel is replicated multiple times. Each replicated copy, or Firewall
Instance, runs on one CPU processing core. These FW instances handle traffic concurrently, and each FW instance is a complete and independent Firewall inspection
kernel. When CoreXL is enabled, all the Firewall kernel instances on the Security Gateway process traffic through the same interfaces and apply the same security
policy.
Affinity - Association of a particular network interface / FW kernel instance / daemon with a CPU core (either 'Automatic' (default), or 'Manual').
Note: The default CoreXL interface affinity setting for all interfaces is 'Automatic' when SecureXL is installed and enabled.
Accelerated path - Packet flow when the packet is completely handled by the SecureXL device. It is processed and forwarded to the network.
Medium path (PXL) - Packet flow when the packet is handled by the SecureXL device, except for IPS (some protections) / VPN (in some configurations) / Application
Control / Content Awareness / Anti-Virus / Anti-Bot / HTTPS Inspection / Proxy mode / Mobile Access / VoIP / Web Portals. The CoreXL layer passes the packet to one
of the CoreXL FW instances to perform the processing. This path is available only when CoreXL is enabled.
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product=… 6/59
18/01/2021 Best Practices - Security Gateway Performance
Firewall path / Slow path (F2F) - Packet flow when the SecureXL device is unable to process the packet (refer to sk32578 - SecureXL Mechanism). The packet is
passed on to the CoreXL layer and then to one of the CoreXL FW instances for full processing. This path also processes all packets when SecureXL is disabled.
Passive Streaming Library (PSL) - IPS infrastructure, which transparently listens to TCP traffic as network packets, and rebuilds the TCP stream out of these packets
Passive Streaming can listen to all TCP traffic, but process only the data packets, which belong to a previously registered connection. For more details, refer to
sk95193 - ATRG: IPS.
Gaia OS
SecurePlatform OS
IPSO OS
Crossbeam XOS
Crossbeam COS
Architecture:
Note: The real number of CoreXL FW instances depends on the current CoreXL license.
1 0
1
Note: CoreXL is disabled Note: CoreXL is disabled
2 2 2
4 3 1
(*) Note: For Maximal number of CoreXL IPv4 FW instances, check sk98737 - ATRG: CoreXL
The number of IPv4 FW instances - from a minimum of 2 to a number equal to the maximal number of CPU cores on the Security Gateway.
The number of IPv6 FW instances - from a minimum of 2 to a number equal to the number of IPv4 FW instances.
The number of IPv6 FW instances cannot exceed the number of IPv4 FW instances.
The total number of IPv4 FW instances and IPv6 FW instances together cannot exceed 32.
Number of CoreXL FW instances must be identical on all members of the cluster because the state synchronization between members is performed per CoreXL FW
instance (e.g., Instance #2 on Member_A can synchronize only with Instance #2 on Member_B).
Note: Member with higher number of CoreXL FW instances will enter the 'Ready' state. Refer to sk42096 - Cluster member is stuck in 'Ready' state.
Limitations:
Documentation:
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product=… 7/59
18/01/2021 Best Practices - Security Gateway Performance
Firewall Administration Guide (R75, R75.20, R75.40, R75.40VS) - Chapter 'CoreXL Administration'.
Performance Tuning Administration Guide (R76, R77) - Chapter 'CoreXL Administration'.
Definitions:
SMT (Simultaneous Multi-Threading - Intel® HyperThreading, or Intel® HT) is a feature that is supported on Check Point appliances running Gaia OS. When enabled
SMT doubles the number of logical CPUs on the Security Gateway, which enhances physical processor utilization. When SMT is disabled, the number of logical CPUs
equals the number of physical cores.
SMT improves performance up to 30% in NGFW software blades such as IPS, Application & URL Filtering and Threat Prevention by increasing the number of CoreXL
FW instances based on the number of logical CPUs.
Supported configurations:
Limitations:
Notes:
When SMT (HyperThreading) is enabled, the number of available CPU cores is not linear.
Example:
Documentation:
Background:
Today, each network interface card has one traffic queue that is handled by one CPU at a time. Since the Secure Network Distributor (SND) - SecureXL and CoreXL
Distributor is running on the CPU cores that handle the traffic queues, user cannot use more CPU cores for acceleration than the number of network interface cards
passing the traffic.
Definitions:
Multi-Queue is an acceleration feature that lets the user configure more than one traffic queue for each network interface card, which allows using more CPU cores
for acceleration.
Secure Network Distributor (SND) - Traffic entering network interface cards (NICs) is directed to a processing CPU core running the SND, which is responsible for:
IRQ affinity - Process of binding a network interface card's IRQ to one or more CPU cores.
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product=… 8/59
18/01/2021 Best Practices - Security Gateway Performance
Accelerated path - Packet flow when the packet is completely handled by the SecureXL device. It is processed and forwarded to the network.
Medium path (PXL) - Packet flow when the packet is handled by the SecureXL device, except for IPS (some protections) / VPN (in some configurations) / Application
Control / Content Awareness / Anti-Virus / Anti-Bot / HTTPS Inspection / Proxy mode / Mobile Access / VoIP / Web Portals. The CoreXL layer passes the packet to one
of the CoreXL FW instances to perform the processing. This path is available only when CoreXL is enabled.
Firewall path / Slow path - Packet flow when the SecureXL device is unable to process the packet (refer to sk32578 - SecureXL Mechanism). The packet is passed on
to the CoreXL layer and then to one of the CoreXL FW instances for full processing. This path also processes all packets when SecureXL is disabled.
Passive Streaming Library (PSL) - IPS infrastructure, which transparently listens to TCP traffic as network packets, and rebuilds the TCP stream out of these packets
Passive Streaming can listen to all TCP traffic, but process only the data packets, which belong to a previously registered connection. For more details, refer to
sk95193 - ATRG: IPS.
Supported configurations:
Multi-Queue is integrated into R76, R77 and above. For lower versions, a Multi-Queue hotfix has to be installed (refer to sk80940).
Multi-Queue is supported on Check Point Appliances (including IP Series Appliances) and on Open Servers.
Multi-Queue is supported only on machines that run SecurePlatform OS or Gaia OS.
Multi-Queue is supported only for network interface cards that use igb (1 GbE) and ixgbe (10 GbE) drivers.
Limitations:
Documentation:
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product=… 9/59
18/01/2021 Best Practices - Security Gateway Performance
1. SmartDashboard - open Security Gateway object.
2. Go to 'Optimizations' pane.
3. The 'Calculate the maximum limit for concurrent connections' should be set to 'Automatically'.
Note: Manual limit should be set only for security reasons.
4. Enter the desired value.
5. The 'Calculate connections hash table size and memory pool' should be set to 'Automatically'.
6. Click on 'OK'.
7. Install the policy.
Notes:
You should ensure that the total number of concurrent connections is appropriate to the TCP end timeout.
Too many concurrent connections will adversely affect the Security Gateway's performance.
You can calculate the maximum number of concurrent connections by multiplying the session establishment rate by the TCP session timeout:
[MAXIMAL number of concurrent connections] = [MAXIMAL session establishment rate] x [TCP entire session timeout]
Notes:
This formula is used to understand what number of concurrent connections a session rate test will generate.
It is very hard to predict the maximal connections capacity of a Security Gateway because of multiple varying factors.
Administrator should monitor the memory utilization on Security Gateway after changing these settings.
Only the maximal (possible) session rate should be considered.
This formula will not predict connections capacity, which is stated in Check Point datasheet documents.
Average session rate can be obtained using the sk101878 - CPView Utility - from 'Traffic' tab.
Additional information can be obtained based on sk67560 - How to export History Report from SmartView Monitor - from 'Traffic' view.
TCP timeout varies highly between applications and protocols (e.g., SSH is usually long, HTTP is usually short).
By reducing the following timeouts, you increase the capacity of actual TCP and UDP connections (SmartDashboard - 'Policy' menu - 'Global Properties' -
'Stateful Inspection'):
TCP end timeout - determines the amount of time a TCP connection will stay in the FireWall Connections Table (id 8158) after a TCP session has ended.
UDP virtual session timeout - determines the amount of time a UDP connection will stay in the FireWall Connections Table (id 8158) after the last UDP packet
was seen by the Security Gateway.
If you are testing large subnets that are directly connected to the Security Gateway without a router.
If 'kernel: neighbour table overflow' appears repeatedly in /var/log/messages files and in the output of the 'dmesg' command.
Related solutions:
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 10/59
18/01/2021 Best Practices - Security Gateway Performance
Either decrease the TCP end timeout to 2 seconds (SmartDashboard - 'Policy' menu - 'Global Properties' - 'Stateful Inspection').
Or increase the hash size of SND's Connection Table by increasing (permanently per sk26202) the value of the kernel parameter
fwmultik_gconn_tab_hsize from the default 524288 to 8388608 and rebooting the machine.
Important Note: This change reduces the capacity for the maximum number of concurrent connections.
Note: This section does not take the CoreXL into consideration.
BIOS settings:
If your BIOS supports CPU clock setting, then make sure that the BIOS is set to the actual CPU speed (no over-clocking).
If your BIOS supports Hyper-Threading, then refer to "SMT (HyperThreading)" section.
Each NIC should be bound (affined) to a separate CPU core using the 'Static' affinity mode (run the 'sim affinity -s' command).
Pairs of interfaces carrying significant data flows (based on network topology) should be assigned to pairs of CPU cores on the same physical CPU processor.
Pairs of interfaces that serve the same connections (based on network topology) should be assigned to pairs of CPU cores on the same physical CPU core.
For systems with 4 CPU cores and Dual Port NICs, the IRQ Swizzling technology should be enabled to properly distribute IRQs among 4 CPU cores.
Note: Applies only to Dual Port NICs. IRQ Swizzling is not required with Quad Port NICs.
For systems with 8 CPU cores and Quad Port NICs, the EIRQ technology should be enabled to properly distribute IRQs among all 8 CPU cores.
Note: At the time of this writing, there is no certified platform with this ability.
Optimized Drops:
Either disable the synchronization of non-critical connections (e.g., UDP DNS, ICMP).
Or (if connection must be synchronized) start synchronizing the connection only some time after its initiation (right-click on the service - 'Edit...' -
'Advanced...' - check the box 'Start synchronizing [X] seconds after connection initiation' - install policy).
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 11/59
18/01/2021 Best Practices - Security Gateway Performance
Notes:
Applies only to TCP services whose 'Protocol Type' is set to 'HTTP' or 'None'.
Delayed Synchronization is disabled if the 'Track' option in the rule is set to 'Log' or 'Account'.
Delayed Synchronization is performed only for connections matching a SecureXL Connection Template.
Note: This section does not take the SecureXL into consideration.
Notes:
CoreXL improves performance with almost linear scalability in the following scenarios:
It is very important to verify that the CPU cores are equally utilized (run the 'top' command). If this is not the case, you should consider changing the distribution of
the Secure Network Distributors (SNDs) and CoreXL FW instances.
Under normal circumstances, it is not recommended for the SND and a CoreXL FW instance to share the same CPU core.
However, it is necessary in the following cases:
When using a machine with exactly two cores. It is better for both SNDs and CoreXL FW instances to share CPU cores, instead of allocating only one CPU core
to each.
When you know that almost all of the packets are being processed in the Accelerated path, and you want to assign all CPU cores to this path. If the CoreXL FW
instances do not process significant amount of traffic, then it is appropriate to share the CPU cores.
The interfaces affinity should be configured only to to CPU cores that are running as SNDs (CPU cores that are not running CoreXL FW instances), with these
exceptions:
On machines with exactly two CPU cores (both SNDs and CoreXL FW instances use the same CPU cores).
For tests, in which traffic is accelerated by SecureXL (if it is enabled).
If you replaced the CPU on the machine to a CPU with more/less CPU cores than the previous CPU, then you must reconfigure the number of CoreXL FW instances in
the 'cpconfig' menu.
In a cluster environment, changing the number of CoreXL FW instances should be treated as a version upgrade - member with higher number of CoreXL FW
instances will enter the 'Ready' state. Refer to sk42096 - Cluster member is stuck in 'Ready' state.
To change the number of CoreXL FW instances, schedule a maintenance window and follow either a Minimal Effort Upgrade procedure, or a Zero Downtime Upgrade
procedure from the Installation and Upgrade Guide (R75, R75.20, R75.40, R75.40VS, R76, R77 Gaia, R77 Non-Gaia).
Changing the distribution of the SND, CoreXL FW instances, and daemons among the CPU cores:
Note: Run the 'fw ctl affinity -l -r -a -v' command to see the current distribution.
To change the distribution of the SND, CoreXL FW instances, and daemons, change the current affinities of interfaces and/or of daemons.
Notes:
To make the affinity settings persistent, edit the '$FWDIR/conf/fwaffinity.conf' file on Security Gateway (see the contents of the file for the correct syntax)
To apply the configuration from the '$FWDIR/conf/fwaffinity.conf' file on-the-fly (without reboot), execute the '$FWDIR/scripts/fwaffinity_apply' she
script on Security Gateway (see the contents of the script for available flags).
To ensure CoreXL's efficiency, all traffic must be directed to CPU cores that are running as SNDs (CPU cores that are not running CoreXL FW instances).
Therefore, if you change affinities of interfaces and/or daemons, you will need to accordingly set the number of CoreXL FW instances and ensure that the CoreXL FW
instances run on other CPU cores.
It is recommended to allocate an additional CPU core to the SND only if all of the following conditions are met:
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 12/59
18/01/2021 Best Practices - Security Gateway Performance
The sum of the 'idle' values (run the 'top' command and press 1 to display all CPU cores) for the CPU cores running CoreXL FW instances is significantly
higher than 100%.
If any of the above conditions are not met, the default configuration of one processing core allocated to the SND is sufficient, and no further configuration is
necessary.
It is recommended to allocate an additional CPU core to the FWD daemon if the Security Gateway is performing heavy logging.
Note: Avoiding the CPU cores that are running the SND is important only if these CPU cores are explicitly defined as affinities of interfaces. If interface affinities are
set to 'Automatic', any CPU core that is not running a CoreXL FW instance can be used for the FWD daemon, and interface traffic will be automatically diverted to
other CPU cores.
Background:
When most of the traffic is accelerated by SecureXL (run 'fwaccel stats -s' command), the load on CPU cores that run as Secure Network Distributor (SND) can be very
high, while the load on CPU cores that run CoreXL FW instances can be very low. This is an inefficient utilization of CPU capacity.
Notes:
Traffic is processed by the CoreXL FW instances only when the traffic is not accelerated by SecureXL (if SecureXL is installed and enabled).
With CoreXL, there are cases when performance without SecureXL is better than with it, even when SecureXL does manage to accelerate part of the traffic.
Packet flow:
When SecureXL is enabled, a packet enters the Security Gateway and first reaches the SecureXL device. The packet will be handled in one of three ways:
1. Accelerated path - The packet is completely handled by the SecureXL device. It is processed and forwarded to the network.
2. Medium path (PXL) - Packet flow when the packet is handled by the SecureXL device, except for IPS (some protections) / VPN (in some configurations) /
Application Control / Content Awareness / Anti-Virus / Anti-Bot / HTTPS Inspection / Proxy mode / Mobile Access / VoIP / Web Portals. The CoreXL layer passe
the packet to one of the CoreXL FW instances to perform the processing.
This path is available only when CoreXL is enabled.
3. Firewall path / Slow path - The SecureXL device is unable to process the packet (refer to sk32578 - SecureXL Mechanism). The packet is passed on to the
CoreXL layer and then to one of the CoreXL FW instances for full processing.
This path also processes all packets when SecureXL is disabled.
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 13/59
18/01/2021 Best Practices - Security Gateway Performance
If SecureXL is enabled - the default affinities of all interfaces are 'Automatic' - the affinity for each interface is automatically reset every 60 seconds, and balanced
between available CPU cores based on the current load.
If SecureXL is disabled - the default affinities of all interfaces are with available CPU cores - those CPU cores that are not running a CoreXL FW instance or not
defined as the affinity for a daemon.
If SecureXL is enabled - the affinities of all interfaces are handled by the 'sim affinity' command. Interface affinities are automatically distributed among CPU
cores that are not running CoreXL FW instances and that are not set as the affinity for any daemon.
If SecureXL is disabled - interface affinities are loaded at boot based on the $FWDIR/conf/fwaffinity.conf configuration file (if SecureXL is enabled, then lines
beginning with "i" in this file are ignored).
To balance the load on the CPU cores that are running as SNDs (CPU cores that are not running CoreXL FW instances):
B. Check, which CPU cores (that run as SNDs) are most utilized - run:
[Expert@HostName]# top
Note: Press digit 1 (above the letter Q) to display all CPU cores and press Shift+W to save this configuration.
C. Assign the interfaces accordingly across the CPU cores that run as SNDs - run:
Notes:
SMT is not recommended if only FireWall/VPN blades are used, because performance improvement by SMT is achieved on NGFW software blades.
SMT is not recommended for environments that have high memory utilization.
Reason: Firewall consumes memory for traffic inspection. If the memory utilization is already very high before enabling the SMT, the performance will
decrease noticeably because SMT adds more CoreXL FW instances.
To check the extent of memory utilization on the Security Gateway, refer to:
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 14/59
18/01/2021 Best Practices - Security Gateway Performance
Initial diagnostics - Memory
Advanced diagnostics - Memory
Reason: Each of these blades might have high memory consumption. These blades run Security Servers that are executed per CoreXL FW instance.
Since SMT adds more CoreXL FW instances, overall memory consumption on Security Gateway might increase considerably.
To check the extent of memory utilization on the Security Gateway, refer to:
SMT is not recommended for environments that use Hide NAT extensively.
Reason: An entire range of ports for Hide NAT is divided between the current CoreXL FW instances. The more CoreXL FW instances are running, the less
ports for Hide NAT will be available for each CoreXL FW instance. As a result, if one CoreXL FW instance is handling a high number of NATed
connections, its port range may get exhausted, while at the same time, other CoreXL FW instances may have enough available ports for Hide NAT.
To check the extent of NAT on the Security Gateway, use the cpsizeme tool (refer to sk88160):
If you have two ports on 12600/12700/12800, 13500/13800 and 21000 appliances to handle most of the traffic, it is also recommended to enable Multi-Queue feature t
increase SMT performance (refer to Performance Tuning Administration Guide (R76, R77) - Chapter 3 'Multi-queue').
Documentation:
When most of the processing is done in CoreXL - either in the Medium path, or in the Firewall path (Slow path).
All current CoreXL FW instances are highly loaded, so there are no CPU cores that can be reassigned to SecureXL.
When IPS, or other deep inspection Software Blades are heavily used.
When all network interface cards are processing the same amount of traffic.
When all CPU cores that are currently used by SecureXL are congested.
When trying to increase traffic session rate.
When there is not enough diversity of traffic flows. In the extreme case of a single flow, for example, traffic will be handled only by a single CPU core. (Clarification:
The more traffic is passing to/from different ports/IP addresses, the more you benefit from Multi-Queue. If there is a single traffic flow from a single Client to a single
Server, then Multi-Queue will not help.)
Load on CPU cores that run as SND is high (idle < 20%).
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 15/59
18/01/2021 Best Practices - Security Gateway Performance
Load on CPU cores that run CoreXL FW instances is low (idle > 50%).
There are no CPU cores left to be assigned to the SND by changing interface affinity.
Notes:
For Multi-Queue enhancements in Gaia 3.10 refer to: sk153373 - Multi-Queue Management for Check Point R80.30 with Gaia 3.10 kernel
For best performance, it is not recommended to assign both SND and a CoreXL FW instance to the same CPU core.
Do not change the IRQ affinity of queues manually. Changing the IRQ affinity of the queues manually can adversely affect performance.
Documentation:
2. Place most used rules at the top - use the Hit Count in the SmartDashboard (R75.40 and above) and SmartView Monitor ('Top' view).
Related solution: sk72860 - How to reset the 'Hit Count' in SmartDashboard.
Note: the new column-based matching of Gateways of version R80.10 and above eliminates this need.
3. In addition, you can provide a full Connections Table from your Security Gateway to Check Point Support for thorough analysis (run the command 'fw tab -t
connections -u > /var/log/Connections_Table.txt').
1. There are different IPS protections with different confidence levels and performance impacts.
2. The default Optimize Profile for IPS contains the best setup in terms of performance and reliability of the detection rate.
3. Deviation from the Optimize Profile can cause a performance impact on the environment and false positive detection.
4. Avoid setting protections to run in "Detect" mode - it might increase CPU consumption (without increasing the security).
5. Identify the protections that consume most of the CPU resources - follow sk43733 - How to measure CPU time consumed by IPS protections.
6. Disable protections that are not needed in your environment. To check, which protections are needed, you may use vulnerability tools (such as Nessus).
7. Set Protection Scope to "Protect internal hosts only" (SmartDashboard - Security Gateway properties - IPS pane).
Note: this optimization is no longer needed with the improved IPS mechanism for Gateways of version R80.10 and above.
Related solutions:
sk92527 - Traffic rate through Security Gateway is decreased significantly when assigning any IPS profile other than 'Default_Protection'.
1. Create as specific rules as possible, to prevent the unwanted traffic from hitting the wrong rule.
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 16/59
18/01/2021 Best Practices - Security Gateway Performance
Limit the scope of the rule by selecting only the relevant services (instead of the default 'Any') - right-click on the column titles - click on the 'Service' column:
3. In the "Destination" column, use the default "Internet", unless a specific destination has to be explicitly selected (e.g., in case of internal servers).
4. There is no need for "Clean Up" rule at the bottom (because the behavior of Application Control & URL Filtering Blades is different from that of the Firewall Blade).
Such rule should only be used for short period of time and only for logging purposes.
5. Remove the "Any - Any - Allow" rule, if such rule exists (because the behavior of Application Control & URL Filtering Blades is different from that of the Firewall
Blade).
Such rule should only be used for short period of time and only for logging purposes.
2. In the "Website categorization mode" section, select "Background" (to prevent latency due to packet holding until categorization is completed).
Related solutions:
sk92527 - Traffic rate through Security Gateway is decreased significantly when assigning any IPS profile other than 'Default_Protection'.
1. Create as specific rules as possible, to prevent the unwanted traffic from hitting the wrong rule.
3. There is no need for "Clean Up" rule at the bottom (because the behavior of Anti-Virus & Anti-Bot Blades is different from that of the Firewall Blade).
Such rule should only be used for short period of time and only for logging purposes.
2. In the "Website categorization mode" section, select "Background" (to prevent latency due to packet holding until categorization is completed).
A. Go to 'Profiles' pane.
E. Click on 'OK'.
G. Install the policy onto the relevant Security Gateway / Cluster object.
2. Exclude networks:
Consider excluding networks, whose traffic does not have to be inspected - follow sk92515 - How to configure Anti-Virus Exceptions.
Note: Standard exceptions are still being inspected (i.e., CPU is consumed), however the traffic will be allowed. The exceptions per
sk92515
are completely excluded from the Anti-Virus & Anti-Bot engine inspection (i.e., decrease the load on CPU).
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 17/59
18/01/2021 Best Practices - Security Gateway Performance
3. Decrease the CPU consumption by RAD process and DLPU process:
Consider disabling MD5 check and GZIP inspection - follow sk94056 - When Anti-Virus and Anti-Bot blades are enabled, RAD process and DLPU process
consume CPU at high level.
Consider disabling 'Archive Scanning' because it requires high amount of CPU resources:
A. Go to 'Profiles' pane.
D. In the 'Archives' section, uncheck the box 'Enable Archive scanning (impacts performance).'.
E. Click on 'OK'.
G. Install the policy onto the relevant Security Gateway / Cluster object.
Related solutions:
sk92527 - Traffic rate through Security Gateway is decreased significantly when assigning any IPS profile other than 'Default_Protection'.
1. cpview
Background:
Displays the CPU utilization (and many other counters). Refer to sk101878 - CPView Utility.
Diagnostics:
Analysis:
2. cpstat -f multi_cpu os
Background:
Displays internal statistics for OS about all CPU cores as collected by Check Point
Diagnostics:
Analysis:
Processors load
---------------------------------------------------------------------------------
|CPU#|User Time(%)|System Time(%)|Idle Time(%)|Usage(%)|Run queue|Interrupts/sec|
---------------------------------------------------------------------------------
| 1| 1| 2| 96| 4| ?| 0|
| 2| 2| 4| 94| 6| ?| 0|
| 3| 1| 1| 98| 2| ?| 0|
| 4| 2| 3| 94| 6| ?| 0|
---------------------------------------------------------------------------------
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 18/59
18/01/2021 Best Practices - Security Gateway Performance
3. top
Background:
Usage:
Diagnostics:
Analysis:
4. ps auxwwwf
Background:
Usage:
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 19/59
18/01/2021 Best Practices - Security Gateway Performance
Simplest sorting can be done by pipelining the output of ps command to sort command - for example, to sort the CPU usage, run:
[Expert@HostName]# ps auxww | sort -nrk 3
Diagnostics:
Analysis:
Look at the amount of "CPU", "MEM", "VSZ", "RSS", "TIME" consumed by the daemons
Constant increase in memory consumption might suggest some memory leak - valgrind tool should be used to collect the necessary information from the
process - refer to "(5-2) Advanced diagnostics - Memory" section
Constant high CPU consumption can be caused by numerous factors - function stack should be collected from the process using a special Check Point shell
script ('pstack') - refer to "(5-1) Advanced diagnostics - CPU" section
Example (excerpt):
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
admin 1 0.0 0.0 2040 720 ? Ss 01:12 0:01 init [3]
admin 2 0.0 0.0 0 0 ? S< 01:12 0:01 [migration/0]
admin 3 0.0 0.0 0 0 ? S 01:12 0:00 [ksoftirqd/0]
admin 4 0.0 0.0 0 0 ? S< 01:12 0:00 [watchdog/0]
..................
admin 4103 1.0 0.0 0 0 ? S 01:13 8:41 [fw_worker_0]
admin 4104 0.4 0.0 0 0 ? S 01:13 4:07 [fw_worker_1]
admin 4105 1.2 0.0 0 0 ? S 01:13 10:50 [fw_worker_2]
admin 4115 0.0 0.2 13976 4184 ? Ss 01:13 0:02 /opt/CPshrd-R77/bin/cpwd
admin 5098 0.2 2.4 342988 49860 ? Ssl 01:13 2:07 \_ cpd
admin 5136 0.0 0.3 153612 6216 ? Ss 01:13 0:00 \_ mpdaemon /opt/CPshrd-R77/log/
..................
admin 5374 0.1 5.6 610672 113844 ? Ssl 01:13 1:32 \_ fwd
admin 5449 0.0 0.4 27856 9232 ? S 01:13 0:00 | \_ cpca
admin 5720 0.0 2.0 207256 41100 ? S 01:13 0:01 | \_ syslog 514 all
admin 6030 0.0 2.7 295536 54336 ? Sl 01:14 0:06 | \_ vpnd 0
admin 6033 0.0 2.5 239748 52012 ? Sl 01:14 0:15 | \_ pdpd 0 -t
admin 6034 0.0 2.5 211336 50924 ? S 01:14 0:11 | \_ pepd 0 -t
admin 6036 0.0 2.1 233164 43804 ? Sl 01:14 0:02 | \_ fwpushd 0
admin 6038 0.0 0.6 35016 13232 ? S 01:14 0:00 | \_ wstlsd 0 0
..................
admin 5382 0.5 7.5 453272 151396 ? Ssl 01:13 4:18 \_ fwm
admin 5390 0.0 1.0 46240 21504 ? Ss 01:13 0:00 \_ status_proxy
admin 5750 0.0 0.8 35228 17264 ? Ss 01:13 0:01 \_ rad
admin 5827 0.0 1.1 42500 22748 ? Ss 01:13 0:00 \_ cpstat_monitor
admin 5996 0.0 0.5 57176 11516 ? Ssl 01:14 0:02 \_ fwucd
admin 6022 0.0 1.0 132424 21652 ? Ssl 01:14 0:03 \_ dlpu -i 0 0
..................
admin 4636 0.0 0.3 25020 7784 ? Ss 01:13 0:00 /bin/pm
admin 4653 0.1 0.5 31620 11908 ? Ss 01:13 1:02 \_ /bin/confd
admin 4654 0.1 0.7 38040 14312 ? SNsl 01:13 0:57 \_ /bin/searchd -niceboost 10
admin 4656 0.0 0.4 99740 9880 ? Ssl 01:13 0:01 \_ /bin/rconfd /etc/actions_mapping.xml
admin 4657 0.0 0.1 6472 3824 ? Ss 01:13 0:18 \_ /bin/monitord
admin 4683 0.0 0.3 25252 7168 ? Ss 01:13 0:00 \_ /bin/cloningd
admin 4685 0.0 0.1 10048 2348 pts/0 Ss+ 01:13 0:00 \_ /bin/clishd default server
admin 4687 0.0 0.1 19032 2796 ? Ssl 01:13 0:00 \_ /bin/clish -p
admin 4688 0.0 0.0 2948 868 ? Ss 01:13 0:00 \_ /usr/bin/tclsh /usr/libexec/netflowd
admin 4689 0.0 0.3 30360 7368 ? Ss 01:13 0:07 \_ /usr/sbin/snmpd -f -c /etc/snmp/userDefinedSettings.conf
admin 5041 0.0 0.3 32768 6912 ? Ss 01:13 0:00 \_ /bin/routed -N
admin 5047 0.0 0.3 33128 7820 ? S 01:13 0:00 | \_ /bin/routed -i default -f /etc/routed0.conf -h 0
..................
admin 9438 0.0 0.0 1652 496 tty1 Ss+ 01:14 0:00 /sbin/agetty 9600 tty1
admin 9439 0.0 0.0 1648 500 tty2 Ss+ 01:14 0:00 /sbin/agetty 9600 tty2
admin 9440 0.0 0.0 1652 504 tty3 Ss+ 01:14 0:00 /sbin/agetty 9600 tty3
admin 9441 0.0 0.0 2416 1052 ? Ss 01:14 0:00 /bin/bash /bin/console_agetty
admin 9463 0.0 0.0 1652 508 tty4 Ss+ 01:14 0:00 \_ /sbin/agetty 9600 tty4 vt100
admin 16948 2.1 0.5 71692 11072 ? Sl 03:15 15:21 /opt/CPda/bin/DAService
5. cat /proc/interrupts
Background:
Usage:
Diagnostics:
Analysis:
Look at the general trend - which CPU receives more interrupts and from which interfaces
If some CPU cores receive more interrupts than others, then affinity of interfaces to CPU cores should be optimized - interface should be redistributed better
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 20/59
18/01/2021 Best Practices - Security Gateway Performance
CPU0 CPU1 CPU2 CPU3
0: 51254849 0 0 0 IO-APIC-edge timer
1: 4 0 0 5 IO-APIC-edge i8042
6: 2 3 0 0 IO-APIC-edge floppy
7: 0 0 0 0 IO-APIC-edge parport0
8: 3 0 0 0 IO-APIC-edge rtc
9: 0 0 0 0 IO-APIC-level acpi
12: 0 0 0 115 IO-APIC-edge i8042
15: 302 1043 168 1127 IO-APIC-edge ide1
59: 320145 6732 5944 6189 IO-APIC-level ioc0, eth3
67: 15765753 0 0 0 IO-APIC-level eth0
75: 24271 1285 36 0 IO-APIC-level eth1
83: 24272 0 1322 0 IO-APIC-level eth2
NMI: 0 0 0 0
LOC: 50950084 50945459 50949418 50945128
ERR: 0
MIS: 0
6. cat /proc/cpuinfo
Background:
Diagnostics:
Collect this output to see the information about CPU (architecture, vendor, number)
Analysis:
Example (excerpt):
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 44
model name : Intel(R) Xeon(R) CPU E5645 @ 2.40GHz
stepping : 2
cpu MHz : 2399.483
cache size : 12288 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu vme de pse tsc msr pae mce ...
bogomips : 4806.12
7. dmesg
Background:
Diagnostics:
Collect this output to search for errors from various kernel modules and hardware components
Analysis:
Check each line for kernel boot parameters (e.g., vmalloc), errors, failures, components/features being disabled
Related solution: sk115072 - How to determine amount of installed RAM on Check Point Appliance.
1. cpview
Background:
Displays the Memory utilization (and many other counters). Refer to sk101878 - CPView Utility.
Diagnostics:
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 21/59
18/01/2021 Best Practices - Security Gateway Performance
Monitor the Memory utilization during the problem
Analysis:
On the 'Overview' tab, refer to 'Memory:' section - look at counters 'Free MB'
On the 'I/S' tab, go to 'Memory' menu - go to 'FW-Kernel' menu - refer to section 'Firewall kernel memory usage summary:' - look at counter '%Usage'
2. fw ctl pstat
Background:
Diagnostics:
Analysis:
No single field that indicates a problem - need to interpret all counters together
HMEM
failures under HMEM - no real memory problem, just mean HMEM is full ; HMEM should have been configured larger
"failed allocations" under HMEM (only) do not indicate any problem
SMEM
failures under SMEM - reached Check Point memory limit , exhausted OS memory, large non-sleep allocation , indicate some shortage
"failed allocations" under SMEM may not mean that a user's allocation failed, maybe HMEM extension failed
"failed free" under SMEM means an overrun or freeing an invalid pointer - indicates a bug
KMEM
failures under KMEM - application asked for memory and could not get it , usually, it is a memory problem
"failed allocations" under KMEM means that the application didn't get memory
Example:
Cookies:
17293941 total, 0 alloc, 0 free,
19087 dup, 17386724 get, 117090 put,
32037742 len, 0 cached len, 0 chain alloc,
0 chain free
Connections:
82980 total, 31766 TCP, 50795 UDP, 7 ICMP,
412 other, 0 anticipated, 0 recovered, 79 concurrent,
568 peak concurrent
Fragments:
0 fragments, 0 packets, 0 expired, 0 short,
0 large, 0 duplicates, 0 failures
NAT:
0/0 forw, 0/0 bckw, 0 tcpudp,
0 icmp, 0-0 alloc
Sync: off
3. cpstat -f memory os
Background:
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 22/59
18/01/2021 Best Practices - Security Gateway Performance
Diagnostics:
Collect this output continuously during the problem (usually, over some time period)
Analysis:
Example:
4. cat /proc/meminfo
Background:
Diagnostics:
Collect this output continuously during the problem (usually, over some time period)
Analysis:
Sum up these counters: MemFree + Buffers + Cached, and compare the result with counter MemTotal - follow sk42717 - How to read the output of 'cat
/proc/meminfo' on Linux-based system
Constant increase in memory consumption might suggest some memory leak - follow sk35496 - How to detect a memory leak on Security Gateway with
SecurePlatform OS / Gaia OS
Example:
MemTotal: 2005908 kB
RawMemTotal: 2097152 kB
MemFree: 95092 kB
Buffers: 107136 kB
Cached: 198520 kB
SwapCached: 90452 kB
Active: 1335364 kB
Inactive: 121220 kB
HighTotal: 262016 kB
HighFree: 808 kB
LowTotal: 1743892 kB
LowFree: 94284 kB
SwapTotal: 4225084 kB
SwapFree: 3901816 kB
Dirty: 864 kB
Writeback: 0 kB
AnonPages: 1137312 kB
Mapped: 108660 kB
Slab: 82164 kB
PageTables: 19132 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
CommitLimit: 5228036 kB
Committed_AS: 4025512 kB
VmallocTotal: 247800 kB
VmallocUsed: 114732 kB
VmallocChunk: 117952 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
Hugepagesize: 2048 kB
5. dmesg
Background:
Diagnostics:
Collect this output to search for errors from various kernel modules and hardware components
Analysis:
Check each line for kernel boot parameters (e.g., vmalloc), errors, failures, components/features being disabled
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 23/59
18/01/2021 Best Practices - Security Gateway Performance
Show / Hide initial diagnostics information
Important related solution: sk110351 - Traffic latency on VSX Gateway if MTU larger than 4096 (Jumbo Frames) is configured on an interface.
1. cpview
Background:
Displays the traffic and interfaces statistics (and many other counters). Refer to sk101878 - CPView Utility.
Diagnostics:
Analysis:
2. netstat -ni
Background:
Diagnostics:
Collect this output continuously during the problem (usually, over some time period)
Analysis:
Example:
3. ifconfig name_of_interface
Background:
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 24/59
18/01/2021 Best Practices - Security Gateway Performance
Manual page - http://linux.die.net/man/8/ifconfig
Displays the status and traffic statistics for the currently active interfaces
Diagnostics:
Collect this output continuously during the problem (usually, over some time period)
Analysis:
UP - indicates that the kernel modules related to the Ethernet interface has been loaded
BROADCAST - indicates that interface supports broadcasting - a necessary characteristic to obtain IP address via DHCP
NOTRAILERS - indicates that trailer encapsulation is disabled (Linux usually ignore trailer encapsulation so this value has no effect at all)
RUNNING - indicates that interface is ready to accept data
MULTICAST - indicates that the interface supports multicasting
MTU - Maximum Transmission Unit is the size of each packet received by the interface (default value is 1500; setting MTU to a higher value could hazard packe
fragmentation or buffer overflows)
Metric - used to compute the cost of a route - it tells the OS, to which interface a packet should be forwarded, when multiple interfaces could be used to reach
the packet's destinationTakes values of 0,1,2,3,... The lower the value, the more leverage it has. This parameter has significance only while routing packets. Fo
example, if you have two Ethernet cards and you want to forcibly make your machine use one card over the other in sending the data. Then you can set the
Metric value of the Ethernet card which you favor lower than that of the other Ethernet card.
RX packets - total number of packets received via the interface
RX errors - number of damaged packets received (refer to sk61922)
RX dropped - number of dropped packets due to reception errors (refer to sk61922)
RX overruns - number of received packets that experienced data overruns (number of times the receiver hardware was unable to hand received data to a
hardware buffer)
RX frame - number received packets that experienced frame errors
TX packets - total number of packets transmitted via the interface
TX errors - number of packets that experienced transmission error
TX dropped - number of dropped transmitted packets due to transmission errors
TX overruns - number of transmitted packets that experienced data overruns (number of times the transmitter hardware was unable to hand received data to a
hardware buffer)
TX carriers - number received packets that experienced loss of carriers
TX collisions - number of transmitted packets that experienced Ethernet collisions (a nonzero value of this field indicates possibility of network congestion)
TX txqueuelen - configured length of transmission queue
RX bytes - total bytes received over this interface
TX bytes - total total bytes transmitted over this interface
Example:
4. netstat -anp
Background:
Diagnostics:
Collect this output continuously during the problem (usually, over some time period)
Analysis:
Example:
5. ethtool name_of_interface
Background:
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 25/59
18/01/2021 Best Practices - Security Gateway Performance
Displays Ethernet card settings
Diagnostics:
Analysis:
Example:
6. ethtool -i name_of-interface
Background:
Diagnostics:
Analysis:
Example:
driver: e1000
version: 7.6.15.5-NAPI
firmware-version: N/A
bus-info: 0000:02:00.0
7. ethtool -g name_of-interface
Background:
Diagnostics:
Analysis:
Check the current size of the buffers versus the maximum allowed - follow sk42181 - How to increase sizes of buffer on SecurePlatform/Gaia for Intel NIC and
Broadcom NIC
Example:
8. arp -an | wc -l
Background:
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 26/59
18/01/2021 Best Practices - Security Gateway Performance
Displays the system's ARP cache table
Diagnostics:
Analysis:
Example:
9. dmesg
Background:
Diagnostics:
Collect this output to search for errors from various kernel modules and hardware components
Analysis:
Check each line for kernel boot parameters (e.g., vmalloc), errors, failures, components/features being disabled
1. cpview
Background:
Displays the SecureXL status and statistics (and many other counters). Refer to sk101878 - CPView Utility.
Diagnostics:
Analysis:
On the 'SysInfo' tab, refer to 'Configuration Information:' section - look at 'PPack Status'
On the 'Traffic' tab, go to 'Overview' menu - refer to section 'Templates:'
On the 'I/S' tab, go to 'SXL' menu - go to 'Overview' menu
2. fwaccel stat
Background:
Diagnostics:
Analysis:
Example:
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 27/59
18/01/2021 Best Practices - Security Gateway Performance
Accelerator Status : on
Accept Templates : disabled by Firewall
disabled from rule #31
Drop Templates : disabled
NAT Templates : disabled by user
3. fwaccel stats -s
Background:
Diagnostics:
Analysis:
If the ratio of "Accelerated/Total" is less than 80%, it means that acceleration is poor, and the optimization is required
The higher the ratio of "F2Fed pkts/Total pkts" is, the more traffic is Forwarded to Firewall for inspection (the poorer the performance is) - see the fwaccel
conns command below
The higher the ratio of "PXL pkts/Total pkts" is, the more packets passed in Medium path. Meaning, packets were handled by the SecureXL device, except for
IPS / Application Control / Anti-Virus / Anti-Bot processing. The CoreXL layer passed the packets to one of the CoreXL FW instances to perform the processing
This path is available only when CoreXL is enabled.
The higher the ratio of "QXL pkts/Total pkts" is, the more packets were processed by QoS.
Example:
4. fwaccel conns
Background:
Diagnostics:
Collect this output continuously during the problem (Important Note: This command consumes high amount of memory)
Analysis:
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 28/59
18/01/2021 Best Practices - Security Gateway Performance
X.X.X.X 21891 X.X.X.X 0 1 F...... eth2/eth4 eth4/eth2
X.X.X.X 34303 X.X.X.X 389 6 F.N.... eth2/eth2 eth2/-
5. fwaccel templates
Background:
Diagnostics:
Collect this output continuously during the problem (Important Note: This command consumes high amount of memory)
Analysis:
Source SPort Destination DPort PR Flags LCT DLY C2S i/f S2C i/f Inst Identity
------------ ----- ------------ ----- -- --------- ---- --- ------- ------- ---- --------
X.X.X.X * X.X.X.X 161 17 ...A...S. 65 0 36/21 21/36 0 0
X.X.X.X * X.X.X.X 161 17 ...A...S. 5 0 36/8 8/36 1 0
X.X.X.X * X.X.X.X 1437 17 ...A...S. 27 0 36/8 8/36 1 0
X.X.X.X * X.X.X.X 161 17 ...A...S. 23 0 36/21 21/36 2 0
X.X.X.X * X.X.X.X 88 17 ...A...S. 11 0 8/36 36/8 4 0
6. sim if
Background:
Diagnostics:
Analysis:
Example:
7. sim affinity -l
Background:
Diagnostics:
If SIM Affinity was configured in Static mode, then the following configuration file should exist and should not be empty:
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 29/59
18/01/2021 Best Practices - Security Gateway Performance
If SIM Affinity was configured in Automatic mode, then the following Task should exist in CPD Scheduler:
Task: "Sim_Affinity"
Command: sim
Arguments: affinity -c
Interval: 60
Active: true
RunAtStart: false
Example:
eth0 : 0
eth1 : 0
eth2 : 1
eth3 : 1
1. cpview
Background:
Displays the CoreXL status and statistics (and many other counters). Refer to sk101878 - CPView Utility.
Diagnostics:
Analysis:
On the 'SysInfo' tab, refer to 'Configuration Information:' section - look at 'CoreXL Status'
On the 'SysInfo' tab, refer to 'Configuration Information:' section - look at 'CoreXL instances'
On the 'I/S' tab, go to 'CoreXL' menu - go to 'General' menu - refer to 'Queues:' section - look at counter 'Enqueue fail'
On the 'I/S' tab, go to 'CoreXL' menu - go to 'Instances' menu - activate the statistics (!may affect performance) - go to each CoreXL FW instance ('FW-
Instance<N>'):
refer to 'FW Stats' section
refer to 'Top FW-Lock consumers:' section
Background:
Displays status of CoreXL instances and summary for traffic that passes through each CoreXL FW instance (current number and peak number of concurrent
connections)
Diagnostics:
Analysis:
Check the number and the allocation of FW instances to CPU cores (in cluster, the output must be identical on all members)
Check the peak number connections on FW instances (instances should be loaded as equally as possible)
3. fw ctl affinity -l -r -v -a
Background:
Diagnostics:
Analysis:
Check the affinity settings (of interfaces, processes and FW instances) to CPU cores (in cluster, the output must be identical on all members)
The interfaces affinity should be configured only to to CPU cores that are running as SNDs (CPU cores that are not running CoreXL FW instances)
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 30/59
18/01/2021 Best Practices - Security Gateway Performance
Under normal circumstances, it is not recommended for the SND and a CoreXL FW instance to share the same CPU core
Example from machine with 4 CPU cores and 4 interfaces (1 SND + 3 CoreXL FW instances):
4. cat /proc/interrupts
Background:
Usage:
Diagnostics:
Analysis:
Look at the general trend - which CPU receives more interrupts and from which interfaces
If some CPU cores receive more interrupts than others, then affinity of interfaces to CPU cores should be optimized - interface should be redistributed better
1. cpview
Background:
Displays the CPU utilization (and many other counters). Refer to sk101878 - CPView Utility.
Diagnostics:
Analysis:
On the 'I/S' tab, go to 'CPU' menu - go to 'Contexts' menu - refer to section 'Contexts'
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 31/59
18/01/2021 Best Practices - Security Gateway Performance
2. vmstat [-n] [delay_in_sec [number_of_samples]]
Background:
Usage:
Diagnostics:
Analysis:
Look at the "procs" section - number of processes waiting for CPU (counter r)
Look at the "swap" section - reading from swap file (si) and writing to swap file (so)
Look at the "io" section - reading from hard disk (bi) and writing to hard disk (bo)
Look at the "system" section - number of Context Switches (cs)
Look at the "cpu" section - at all counters:
"User Space" - counter us
"System (kernel) Space" - counter sy
"Idle" - counter id
"I/O waiting" - counter wa
Example:
Background:
Usage:
Refer to sk112734 - How to collect System Activity Report using the "sar" command
Diagnostics:
Analysis:
Example:
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 32/59
18/01/2021 Best Practices - Security Gateway Performance
[Expert@R77-GW:0]# sar -u
Linux 2.6.18-92cp (R77-GW) 08/04/16
[Expert@R77-GW:0]# sar -P 1
Linux 2.6.18-92cp (R77-GW) 08/04/16
4. sh pstack_sym.sh <PID_of_problematic_daemon>
Background:
Usage:
A. Download the package that contains the 'pstack' utility and special Check Point shell script that collects the necessary information.
B. Transfer the package to the problematic machine (into some directory, e.g., /some_path_to_pstack/).
[Expert@HostName]# cd /some_path_to_pstack/
F. Determine the PID of the problematic daemon (that consumes the CPU at high level) - run the top command and look at the left-most column 'PID'.
Alternatively, if you already know the name of the daemon, run this command:
G. During the problem, run the special shell script at least 5-7 times:
Important Note: It might take 10-15 minutes for the script to complete the analysis - please wait patiently.
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 33/59
18/01/2021 Best Practices - Security Gateway Performance
CPinfo file from the problematic machine (just to see the versions and the configuration)
Analysis:
All the outputs will be analyzed by Check Point Support and R&D
Example:
**************************************************
Starting the analysis - please wait patiently
**************************************************
30477: cpd
(No symbols found)
0x77751db7 : select + 57 (libc-2.3.2.so) (112, 7f9b7de0, 7f9b85e0, 7f9b8de0, 779c3244, 0) + 1850
0x779acaac : T_event_mainloop_iter_select + 1ec (libComUtils.so) (87f8b90, 779c3244, 96, 779a6259, 779a4560, 779c3738) + 20
0x779ad23f : T_event_mainloop_iter + 16f (libComUtils.so) (87f8b90, 77f95218, 0, 885dad8, 7f9b9678, 77fb5250) + 10
0x779ad298 : T_event_mainloop_e + 28 (libComUtils.so) (87f8b90, 805359c)
0x77f12402 : opsec_mainloop + 22 (libopsec.so) (885dc88, 0, 80516f2, 770d, 0, 0) + 9a0
0x0804cfd8 : /opt/CPshrd-R71/bin/cpd + 4fd8 (1, 7f9ba0c4, 7f9ba0cc, 0, 777b1898, 77fbe020) + 40
0x776917fd : __libc_start_main + ed (libc-2.3.2.so) (804cb10, 1, 7f9ba0c4, 80509e0, 8050a28, 77fb5be0) + 80645f48
**************************************************
This script has completed the analysis
**************************************************
[Expert@FW]#
1. cpview
Background:
Displays the Memory utilization (and many other counters). Refer to sk101878 - CPView Utility.
Diagnostics:
Analysis:
On the 'I/S' tab, go to 'Memory' menu - go to 'FW-Kernel' menu - refer to section 'KMEM:' - look at counter 'Failed'
On the 'I/S' tab, go to 'Memory' menu - go to 'FW-Kernel' menu - refer to section 'HMEM:' - look at counter 'Failed'
On the 'I/S' tab, go to 'Memory' menu - go to 'FW-Kernel' menu - refer to section 'SMEM:' - look at counter 'Failed'
On the 'I/S' tab, go to 'Memory' menu - go to 'SMEM-Failures' menu
On the 'I/S' tab, go to 'Memory' menu - go to 'Contexts' menu
Background:
Usage:
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 34/59
18/01/2021 Best Practices - Security Gateway Performance
By default, only 1 sample is printed (with the average values since boot). Therefore, to collect this output continuously, specify the delay between the samples -
run:
[Expert@HostName]# vmstat [-n] delay_in_sec [number_of_samples]
If you specified the delay between the samples, then the output will be collected indefinitely (until the command is stopped or killed). If you want to limit the
output, then specify the total number of samples - run:
[Expert@HostName]# vmstat [-n] delay_in_sec number_of_samples
Diagnostics:
Analysis:
Look at the "procs" section - number of processes waiting for CPU (r)
Look at the "memory" section - sum of these counters should be compared to the total amount of RAM
Look at the "swap" section - reading from swap file (si) and writing to swap file (so)
Example:
Background:
Usage:
Refer to sk112734 - How to collect System Activity Report using the "sar" command
Diagnostics:
Analysis:
Look at the number of tasks waiting for run time - counter runq-sz
Look at the system load average - counters ldavg-1, ldavg-5, ldavg-15
Look at the percentage of used memory - counter memused
Look at the percentage of used swap memory - counter swpused
Look at the total number of kB the system paged in from disk per second - counter pgpgin/s
Look at the total number of kB the system paged out to disk per second - counter pgpgout/s
Look at the number of page faults (major + minor) made by the system per second - counter fault/s
Look at the number of major faults the system has made per second - counter majflt/s
Look at the total number of swap pages - counter pswpin/s and counter pswpout/s
Example:
[Expert@R77-GW:0]# sar -q
Linux 2.6.18-92cp (R77-GW) 08/04/16
[Expert@R77-GW:0]# sar -r
Linux 2.6.18-92cp (R77-GW) 08/04/16
16:10:01 kbmemfree kbmemused %memused kbbuffers kbcached kbswpfree kbswpused %swpused kbswpcad
16:20:01 1221768 784220 39.09 43328 381364 2128604 0 0.00 0
16:30:01 1220728 785260 39.15 44648 381408 2128604 0 0.00 0
16:40:01 1219280 786708 39.22 45880 381432 2128604 0 0.00 0
16:50:01 1218016 787972 39.28 47300 381456 2128604 0 0.00 0
17:00:01 1216792 789196 39.34 48628 381420 2128604 0 0.00 0
17:10:01 1215504 790484 39.41 50076 381444 2128604 0 0.00 0
17:20:01 1214964 791024 39.43 51272 381472 2128604 0 0.00 0
17:30:01 1213444 792544 39.51 52524 381492 2128604 0 0.00 0
17:40:01 1212624 793364 39.55 53568 381436 2128604 0 0.00 0
17:50:01 1210840 795148 39.64 54940 381488 2128604 0 0.00 0
Average: 1216396 789592 39.36 49216 381441 2128604 0 0.00 0
[Expert@R77-GW:0]#
[Expert@R77-GW:0]# sar -B
Linux 2.6.18-92cp (R77-GW) 08/04/16
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 35/59
18/01/2021 Best Practices - Security Gateway Performance
16:10:01 pgpgin/s pgpgout/s fault/s majflt/s
16:20:01 0.00 34.64 4417.09 0.00
16:30:01 0.03 37.03 4506.64 0.00
16:40:01 0.01 35.28 4402.80 0.00
16:50:01 0.00 36.98 4462.80 0.00
17:00:01 0.00 36.63 4519.38 0.00
17:10:01 0.00 37.15 4489.80 0.00
17:20:01 0.00 35.27 4440.20 0.00
17:30:01 0.01 35.86 4487.54 0.00
17:40:01 0.01 35.87 4460.36 0.00
Average: 0.01 36.08 4464.99 0.00
[Expert@R77-GW:0]#
[Expert@R77-GW:0]# sar -W
Linux 2.6.18-92cp (R77-GW) 08/04/16
4. valgrind
Background:
Manual pages:
http://linux.die.net/man/1/valgrind
http://linux.die.net/HOWTO/Valgrind-HOWTO/index.html
Suite of tools for debugging and profiling programs
Check Point uses this tool mostly to detect memory leaks in User Space processes
Installation:
Note: This tool is for 32-bit OS - if running Gaia OS in 64-bit, then first you have to switch to 32-bit kernel and reboot.
A. Contact Check Point Support to get the 'valgrind' utility and relevant instructions.
B. Transfer the package to the problematic machine (into some directory, e.g., /some_path_to_valgrind/).
[Expert@HostName]# cd /some_path_to_valgrind/
[Expert@HostName]# cd valgrind_install_files
[Expert@HostName]# cp -r bin/* /usr/bin
[Expert@HostName]# cp -r lib/* /usr/lib
Important Notes:
A. After collecting the required information with the 'valgrind' tool (wait for the confirmation from Check Point Support), this tool has to be removed from the
machine for security reasons (because this tool is able to collect internal information from the processes).
B. When a command / daemon is started under 'valgrind', 'valgrind' loads all the relevant library files to read the relevant information from them (to know how to
collect the memory data). This process (loading of library files) takes time and might cause the CPU load to increase up to 100%.
After 'valgrind' loads all the library files, it does not cause the additional load on CPU.
C. Do NOT KILL the 'valgrind' - it will NOT be able to save the collected data.
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 36/59
18/01/2021 Best Practices - Security Gateway Performance
D. If VPND daemon has to be started under 'valgrind', then first you need to run this command (to prevent the VPND daemon from breaking the pipe to FWD
daemon used to send the PID of the VPND process back to FWD daemon for monitoring purposes):
Usage:
Analysis:
All the outputs will be analyzed by Check Point Support and R&D
ii. Note: If VPND daemon has to be started under 'valgrind', then first you need to run this command (to prevent the VPND daemon from breaking the
pipe to FWD daemon used to send the PID of the VPND process back to FWD daemon for monitoring purposes):
Note: Wait for several minutes for 'valgrind' to write its summary report.
/var/log/valgrind_output*
$FWDIR/log/fwm.el*
$CPDIR/log/cpwd.el*
Background:
Manual pages:
http://linux.die.net/man/1/slabtop
http://linux.die.net/man/5/slabinfo
http://linux.die.net/man/5/proc
and http://en.wikipedia.org/wiki/Slab_allocation
Displays kernel slab cache information in real time (caches of frequently used objects in the Linux kernel - buffer heads, inodes, dentries, etc.)
Instead of manually parsing the highly verbose /proc/slabinfo file manually, it is recommended to use the /usr/bin/slabtop program.
Usage:
Diagnostics:
Analysis:
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 37/59
18/01/2021 Best Practices - Security Gateway Performance
Provide the output(s) to Check Point Support (involvement of R&D is required)
The most interesting information is the amount of resources a certain kernel module is using (if this amount seems too high, then there may be something
wrong with this module)
Some of the more commonly used statistics from /proc/slabinfo file that are included in the output of /usr/bin/slabtop:
OBJS - The total number of objects (memory blocks), including those in use (allocated), and some spares not in use
ACTIVE - The number of objects (memory blocks) that are in use (allocated)
USE - Percentage of total objects that are active [(ACTIVE/OBJS)*100%]
OBJ SIZE - The size of the objects
SLABS - The total number of slabs
OBJ/SLAB - The number of objects that fit into a slab
CACHE SIZE - The cache size of the slab
NAME - The name of the slab
OBJS ACTIVE USE OBJ SIZE SLABS OBJ/SLAB CACHE SIZE NAME
85536 82456 96% 0.05K 1188 72 4752K buffer_head
12876 10385 80% 0.13K 444 29 1776K dentry_cache
9516 9498 99% 0.05K 122 78 488K selinux_inode_security
7571 6711 88% 0.03K 67 113 268K size-32
7524 6869 91% 0.09K 171 44 684K vm_area_struct
7056 7056 100% 0.48K 882 8 3528K ext3_inode_cache
5936 5703 96% 0.27K 424 14 1696K radix_tree_node
4524 4453 98% 0.05K 58 78 232K sysfs_dir_cache
Background:
Administrator can test the behaviour of the Security Gateway during a memory shortage by failing a certain percentage of all memory allocations
Usage:
Refer to sk100766 - Simulation of low memory resources on Security Gateway - random failing of memory allocations
Diagnostics:
Run this test to check how the Security Gateway is going to behave during a memory shortage
Analysis:
Monitor Security Gateway's resources utilization during this test - Memory, CPU, Interfaces, how traffic is passing, etc.
1. netstat -s
Background:
Diagnostics:
Collect this output continuously during the problem (usually, over some time period)
Analysis:
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 38/59
18/01/2021 Best Practices - Security Gateway Performance
In the "Ip" section, look at "incoming packets discarded"
In the "Icmp" section, look at "ICMP messages failed"
In the "Tcp" section, look at "bad segments received"
In the "Udp" section, look at "packet receive errors"
Search for lines with "error", "fail", "timeout", "loss", "lost"
Example:
Ip:
17862464 total packets received
0 forwarded
0 incoming packets discarded
948002 incoming packets delivered
788408 requests sent out
287 outgoing packets dropped
1 dropped because of missing route
Icmp:
297 ICMP messages received
0 input ICMP message failed.
......
IcmpMsg:
InType0: 7
InType3: 290
OutType3: 290
OutType8: 11
Tcp:
66034 active connections openings
11704 passive connection openings
23572 failed connection attempts
......
Udp:
15488 packets received
287 packets to unknown port received.
......
TcpExt:
1 packets pruned from receive queue because of socket buffer overrun
1142 TCP sockets finished time wait in fast timer
......
IpExt:
InMcastPkts: 420
InBcastPkts: 277064
2. ethtool -S name_of_interface
Background:
Diagnostics:
Collect this output continuously during the problem (usually, over some time period)
Analysis:
Example:
NIC statistics:
rx_packets: 21610536
tx_packets: 130262
rx_bytes: 1712923726
tx_bytes: 34001412
......
rx_errors: 0
tx_errors: 0
tx_dropped: 0
......
rx_length_errors: 0
rx_over_errors: 0
rx_crc_errors: 0
rx_frame_errors: 0
rx_no_buffer_count: 0
rx_missed_errors: 0
tx_aborted_errors: 0
tx_carrier_errors: 0
tx_fifo_errors: 0
......
Background:
Usage:
Refer to sk112734 - How to collect System Activity Report using the "sar" command
Diagnostics:
Analysis:
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 39/59
18/01/2021 Best Practices - Security Gateway Performance
Look at all the counters
Example:
19:12:36 IFACE rxerr/s txerr/s coll/s rxdrop/s txdrop/s txcarr/s rxfram/s rxfifo/s txfifo/s
19:12:37 lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
19:12:37 eth0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
19:12:37 eth1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
19:12:37 IFACE rxerr/s txerr/s coll/s rxdrop/s txdrop/s txcarr/s rxfram/s rxfifo/s txfifo/s
19:12:38 lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
19:12:38 eth0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
19:12:38 eth1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: IFACE rxerr/s txerr/s coll/s rxdrop/s txdrop/s txcarr/s rxfram/s rxfifo/s txfifo/s
Average: lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: eth0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: eth1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
[Expert@R77-GW:0]#
1. cpview
Background:
Displays the SecureXL status and statistics (and many other counters). Refer to sk101878 - CPView Utility.
Diagnostics:
Analysis:
Background:
Example output of 'fwaccel conns' command (all IP addresses were replaced by "X"):
Diagnostics:
Collect this information during the problem (Important Note: These commands might increase CPU and memory consumption)
Analysis:
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 40/59
18/01/2021 Best Practices - Security Gateway Performance
1. Check the total number of connections in SecureXL connections table:
[Expert@HostName]# fwaccel conns -s
2. Check the total number of F2F connections:
[Expert@HostName]# fwaccel conns | grep ' F' | grep -v 'Flags' | wc -l
To see why specific connections are Forwarded to Firewall, run the following kernel debug (debug will apply only to new connections):
3. fwaccel stats
Background:
Diagnostics:
Analysis:
Refer to Performance Pack Administration Guide (R70, R71, R75, R75.20, R75.40, R75.40VS) - Chapter 'Command Line' - fwaccel stats and fwaccel6 stats.
Refer to Performance Tuning Administration Guide (R76, R77) - Chapter 'Performance Pack' - Command Line - fwaccel stats and fwaccel6 stats.
Example:
Accelerated Path
------------------------------------------------------------------------------
accel packets 0 accel bytes 0
conns created 60665 conns deleted 60606
... ...
Medium Path
------------------------------------------------------------------------------
PXL packets 0 PXL async packets 0
PXL bytes 0 C PXL conns 0
C PXL templates 0
Firewall Path
------------------------------------------------------------------------------
F2F packets 14870123 F2F bytes 966432478
C F2F conns 59 TCP violations 0
C partial conns 0 C anticipated conns 0
port alloc f2f 0
General
------------------------------------------------------------------------------
memory used 0 free memory 0
C used templates 0 pxl tmpl conns 0
... ...
(*) Statistics marked with C refer to current value, others refer to total value
4. cat /proc/ppk/stats
Background:
Diagnostics:
Example:
5. cat /proc/ppk/conf
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 41/59
18/01/2021 Best Practices - Security Gateway Performance
Background:
Diagnostics:
Analysis:
For Flags line, refer to "(6-1-B) 'sim' command" section - 'sim if' command
For TmplQuota lines, refer to "(6-1-B) 'sim' command" section - 'sim tmplquota' command
For Debug flags section, refer to "(6-1-B) 'sim' command" section - 'sim dbg' command
(Note: the numbers in the left column correspond to order of debug modules in the output of 'sim dbg list' command)
Example:
Flags : 0x00009a16
Accounting Update Interval : 60
Conn Refresh Interval : 512
SA Sync Notification Interval : 0
UDP Encapsulation Port : 0
Min TCP MSS : 0
TCP Auto-Expire Timeout : 20
Connection Limit : 18446744073709551615
TmplQuota Enabled : 0
TmplQuota Quota (rate) : 512
TmplQuota Drop Dduration : 300
TmplQuota Monitor only : 0
TmplQuota Dropped pkts : 0
Debug flags :
0 : 0x0
1 : 0x0
2 : 0x0
3 : 0x0
4 : 0x0
5 : 0x0
6 : 0x0
7 : 0x0
8 : 0x0
9 : 0x0
10 : 0x0
11 : 0x0
12 : 0x0
13 : 0x0
14 : 0x0
15 : 0x0
6. cat /proc/ppk/ifs
Background:
Diagnostics:
Analysis:
Example:
7. cat /proc/ppk/affinity
Background:
Displays the status and the thresholds for New Affinity (feature will be activated only if there is no massive VPN traffic and the packets-per-second rate (cut-
through) is high enough to benefit from the new affinity; feature will be activated only if CPU strength is greater than 3 GHz)
Diagnostics:
Example:
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 42/59
18/01/2021 Best Practices - Security Gateway Performance
Max enc. bytes rate to act : 10000
Current accelerated PPS : 0
Current enc. bytes rate : 0
Currently new sim affinity set : no
8. cat /proc/ppk/cpls
Background:
Diagnostics:
Analysis:
The most important data in this output is the value of fwha_conf_flags - it should include the value of 0x1 (i.e., ACTIVE).
Example:
fwha_conf_flags: 0
fwha_df_type: 0
fwha_member_id: 255
fwha_port: 0
fwha_src_mac: 00 00 00 00 00 00
fwha_src_mac_mask: 00 00 00 00 00 00
udp_enc_port: 0
selection table size: 0
selection table:
00 00 00 00 00 00 00 00 00 00
9. cat /proc/ppk/statistics
Background:
Displays SecureXL statistics - the same output as from 'fwaccel stats -l' command
Diagnostics:
Example:
Background:
Diagnostics:
Example:
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 43/59
18/01/2021 Best Practices - Security Gateway Performance
F2F not allowed 0 hl - TCP viol 0
corrupted packet 0 hl - new conn 0
clr pkt on vpn 0 partial conn 0
encrypt failed 0 drop template 0
decrypt failed 0 outb - no conn 0
interface down 0 cluster error 0
XMT error 0 template quota 0
anti spoofing 0 Attack mitigation 0
local spoofing 0 sanity error 0
monitored spoofed 0 QXL decision 0
Background:
Diagnostics:
Example:
Background:
Diagnostics:
Example:
Background:
Diagnostics:
Example:
localhost:
dynamic, id 8158, attributes: keep, sync, aggressive aging, kbufs 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34, expires 25, refresh, , hashsize 1048576, unlimited
<00000001, ac1e295a, 0000b47d, 54279820, 00000050, 00000006; 00020001, 00046000, 49000000, 00000164, 00000000, 531e03e8, 00000000, 5a291eac, c0000000, ffffffff, ffffffff,
ffffffff, 00000001, 00000000, 00000000, 00008000, 49196800, 00000000, 00000000, 00000000, 00000000, 00000000, fb13c000, 00000000, 0f13d800, 00000000, 00000000, 00000000,
<00000000, ac1e7560, 0000008a, ac1effff, 0000008a, 00000011; 00010001, 00004000, 00000001, 0000018b, 00000106, 531e03da, 00000000, 5a291eac, c0000000, 00000001, ffffffff,
ffffffff, ffffffff, 02000000, 00000000, 00000000, 99163800, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 7a179800, 00000000, 00000000, 00000000,
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 44/59
18/01/2021 Best Practices - Security Gateway Performance
2. cat $FWDIR/conf/fwaffinity.conf
Background:
Diagnostics:
Analysis:
Example:
i eth0 1
n fwd 3
3. cat /etc/fw.boot/boot.conf
Background:
Diagnostics:
Collect this output to see the current status if CoreXL configuration is not saved correctly / does not survive reboot
Analysis:
Example:
CTL_IPFORWARDING 1
DEFAULT_FILTER_PATH /etc/fw.boot/default.bin
KERN_INSTANCE_NUM 3
COREXL_INSTALLED 1
KERN6_INSTANCE_NUM 2
IPV6_INSTALLED 0
4. cpview
Background:
Displays the CoreXL status and statistics (and many other counters). Refer to sk101878 - CPView Utility.
Diagnostics:
Analysis:
Command Description
fwaccel help Prints the general help message with available parameters
fwaccel ehelp Prints the extended help message with available parameters
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 45/59
18/01/2021 Best Practices - Security Gateway Performance
fwaccel <parameter> -h Prints the specific help message for given <parameter>
Returned strings:
The installed SecureXL device is not compatible with the installed firewall (version mismatch).
The SecureXL device is in the process of being stopped. Please try again later.
FW-1: SecureXL acceleration cannot be started while QoS is running in express mode.
Please disable FloodGate-1 express mode or SecureXL.
FW-1: SecureXL acceleration cannot be started while QoS is running with citrix printing rule.
Please remove the citrix printing rule to enable SecureXL.
FW-1: SecureXL acceleration cannot be started while QoS is running with UAS rule.
Please remove the UAS rule to enable SecureXL.
Returned strings:
fwaccel off [-a] [-q]
SecureXL device disabled
Example:
"-a" flag means to show SecureXL status for all Virtual Systems
Example:
Accelerator Status : on
Accept Templates : enabled
Drop Templates : disabled
NAT Templates : disabled by user
Returned strings:
Accelerator Status:
Accelerator Status : on
Accept Templates:
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 46/59
18/01/2021 Best Practices - Security Gateway Performance
Drop Templates : enabled
fwaccel stats Prints all acceleration statistics (output is divided into relevant sections)
fwaccel stats -h Prints the help message with available flags for 'stats' parameter
fwaccel stats -p Prints the acceleration statistics for SecureXL violations (F2F packets)
fwaccel stats -l Prints all acceleration statistics in Legacy mode (output is not divided into sections)
Note: Depending on the number of concurrent connections, might consume memory at very high level
Returned strings:
fwaccel conns -h Prints the help message with available flags for 'conns' parameter
fwaccel conns -m max_entries Prints the SecureXL Connections Table limited to the number of max_entries
Prints the SecureXL Connections Table entries based on <filter> (run 'fwaccel conns -h');
fwaccel conns -f <filter>
Filtering flag is a single letter (either capital, or small)
Note: Depending on the number of current templates, might consume memory at very high level
Returned strings:
fwaccel templates -h Prints the help message with available flags for 'templates' parameter
fwaccel templates -d Prints the summary of SecureXL Connections Templates for dropped packets
fwaccel templates -m max_entries Prints the SecureXL Connections Templates limited to the number of max_entries
fwaccel identities
Prints the SecureXL Identities Table ('cphwd_dev_identity_table')
Returned strings:
Notes:
Refer to Identity Awareness Administration Guide (R75, R75.20, R75.40, R75.40VS, R76, R77)
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 47/59
18/01/2021 Best Practices - Security Gateway Performance
Command is not available for IPv6
fwaccel identities -h Prints the help message with available flags for 'identities' parameter
fwaccel identities -s Prints the summary of SecureXL Identities Table (number of entries)
fwaccel identities -m max_entries Prints the SecureXL Identities Table limited to the number of max_entries
Returned strings:
fwaccel revoked_ips There are VALUE revoked IPs in SecureXL templates' revoked IPs table
...
Total number of templates' revoked IPs:: VALUE
Notes:
Refer to Identity Awareness Administration Guide (R75, R75.20, R75.40, R75.40VS, R76, R77)
Command is not available for IPv6
fwaccel revoked_ips -h Prints the help message with available flags for 'revoked_ips' parameter
fwaccel revoked_ips -s Prints the summary of SecureXL Revoked IPs Table (number of entries)
fwaccel revoked_ips -m max_entries Prints the SecureXL Revoked IPs Table limited to the number of max_entries
By default, debug messages will be printed to /var/log/messages file, therefore you must set the usual kernel debu
ging options with:
fwaccel dbg -h Prints the help message with available options, list of debug modules and their flags
fwaccel dbg list Prints all currently enabled debug flags for all modules
fwaccel dbg resetall Resets all debug flags for all modules to their default (none)
fwaccel dbg -m MODULE reset Resets all debug flags for specified module to their default (none)
fwaccel dbg -m MODULE all Enables all supported debug flags for specified module
fwaccel dbg -m MODULE + FLAG1 FLAG2 ... FLAGn Enables specified debug flags for specified module
fwaccel dbg -m MODULE - FLAG1 FLAG2 ... FLAGn Disables specified debug flags for specified module
Sets debugging filter - only the specified connection will be printed in the debug output
Notes:
Commands:
Commands:
Commands:
fwaccel dos config
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 48/59
18/01/2021 Best Practices - Security Gateway Performance
Commands:
Commands:
Note: Installing a new rate limiting policy with more than one rule will automatically enable the rate limiting feature. T
o manually disable the feature after this command, run:
In order to delete the current policy, simply install a new policy with zero rules.
Commands:
fwaccel dos stats
clear - Clear real-time statistics.
get - View real-time statistics.
Flags:
This whitelist overrides entries in the blacklist. Before using 3rd-party or automatic blacklists, add t
usted networks and hosts to the whitelist to avoid outages.
This whitelist also unblocks ip options and fragments from trusted sources when the --enable-drop
fwaccel dos whitelist opts or --enable-drop-frags features are active.
For whitelisting of rate limiting policy, refer to the bypass action for the fw samp_policy command. I
e.: "fw samp -a b ..."
To replace the current whitelist with the contents of a new file, use both the -F and -l (or -L) options
on the same command line.
The whitelist file should contain one entry per line in the format of the -a option. Lines beginning wi
h '#' and blank lines are ignored.
fwaccel dos whitelist -L is automatically run at boot time.
The file that the -L option loads, does not exist by default.
See also:
Command Description
sim help Prints the general help message with available parameters
sim if
Prints the list of interfaces used and seen by the SecureXL implementation (Performance Pack)
Configuration flags
(sum of the following values in the "F" column):
0x0001 - If set, the packet should be dropped at the end of the inbound processing, if the packet is "cut-throu
h" packet. In outbound, all the packets should ne forwarded to the network.
0x0002 - If set, and the SIM "tcp" feature is enabled (on), then an appropriate notification should be sent whe
ever a TCP state change occurs (connection established/teared down).
0x0004 - If set, then when encapsulating an encrypted packet (UDP encapsulation), the UDP header's checks
m field should be set correctly. If flag is not set, then the UDP header's checksum field should be set to zero.
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 49/59
18/01/2021 Best Practices - Security Gateway Performance
t is safe to ignore this flag if it is set to 0 (i.e., still calculate the checksum).
0x0008 - If set, then when the Connections Table has reached the specified limit, new connections that match
a template should not be created and the packet matching the template should be dropped. If flag is not set,
he packet should be forwarded to the firewall.
0x0010 - If set, then fragments should be forwarded to the firewall.
0x0020 - If set, then connection creation from templates should be disabled. Connection can still be offloaded
to the device. This flag disables only the creation of TCP templates.
0x0040 - Accelerated connections should periodically be refreshed in the firewall through the notification. Th
refreshing should be done only if this global flag is set.
0x0080 - If set, then connection creation from templates should be disabled. Connection can still be offloaded
to the device. This flag disables only the creation of non-TCP templates.
0x0100 - If set, then sequence verification violations should be allowed for connections that did not complete
he 3-way handshake process (instead of F2F-ing violating packets).
00x200 - If set, then sequence verification violations should be allowed for connections that completed the 3-
way handshake process (instead of F2F-ing violating packets).
0x0400 - If set, then RST TCP packets should be forwarded to firewall.
0x0800 - If set, then Path MTU Discovery should not be enforced for IP multicast packets.
0x1000 - If set, then SIM "drop_templates" feature should be disabled.
0x2000 - Indicates whether Link Selection Load Sharing feature was enabled by the user.
0x4000 - If set, then SecureXL asynchronic notification feature should be disabled.
0x8000 - Indicates that Firewall Connections Table capacity is unlimited.
Examples:
0x0001
0x0008
0x0010
0x0020
0x0002
0x0004
0x0010
00x200
0x0800
0x1000
0x8000
sim vpn <on | off> sim vpn on = enable acceleration of VPN traffic
sim vpn off = disable acceleration of VPN traffic
sim affinity -h Prints the help message with available options for 'affinity' parameter
sim affinity -s Sets the network interfaces' affinity in 'Static' ('Manual') mode
sim tmplquota -h Prints the help message with available options for 'tmplquota' parameter
sim tmplquota -e <1 | 0> sim tmplquota -e 1 = enable the template quota feature
sim tmplquota -e 0 = disable the template quota feature
sim tmplquota -q <quota> Sets maximum of connections per second per template (quota is allowed)
sim tmplquota -d <drop_duration> Sets drop duration (in seconds) for drop state
sim tmplquota -m <0 | 1> sim tmplquota -m 0 = disable monitor only mode (default)
sim tmplquota -m 1 = enable monitor only mode
sim tmplquota -r Resets SIM module template quota values to their defaults
sim tmplquota -d <file_name> Loads exclusion list of Source IP addresses / Source Subnets from the file
Prints only templates in drop state (output is printed into /var/log/messages files and into Linux kernel ring buffer (
sim tab -d templates
utput of 'dmesg' command))
Since R80.20 "sim dropcfg" is deprecated, replaced by "fw samp" (see sk112454)
sim dropcfg
Command is available only on Linux-based OS.
Feature is available in R75.40 and above.
sim dropcfg -h Prints the help message with available options for 'dropcfg' parameter
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 50/59
18/01/2021 Best Practices - Security Gateway Performance
sim dropcfg -f </path_to/file_name> Sets drop configuration file
Note: The drop rules configuration does not survive the reboot. Therefore, in order to apply the configured drop rules a
fter the reboot, use a startup script (e.g., /etc/rc.d/rc.local) to run the 'sim dropcfg -f </path_to/file_name
>' command automatically during each boot)
sim dbg -h Prints the help message with available options, list of debug modules and their flags
sim dbg list Prints all currently enabled debug flags for all modules
sim dbg resetall Resets all debug flags for all modules to their default (none)
sim dbg -m MODULE reset Resets all debug flags for specified module to their default (none)
sim dbg -m MODULE all Enables all supported debug flags for specified module
sim dbg -m MODULE + FLAG1 FLAG2 ... FLAGn Enables specified debug flags for specified module
sim dbg -m MODULE - FLAG1 FLAG2 ... FLAGn Disables specified debug flags for specified module
Sets debugging filter - only the specified connection will be printed in the debug output
Notes:
sim feature -h Prints the help message with available options for 'feature' parameter
anti_spoofing
delayed
drop_templates
dynamic_vpn
linksel
linksel_ls
mcast_route
sim feature <feature_name> <on | off>
mcast_route_v2
nac
qos
routing
streaming
tcp
vpn
wire
Command Description
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 51/59
18/01/2021 Best Practices - Security Gateway Performance
fw ctl multik Prints the general help message with available parameters
fw ctl multik stat Prints the summary table for CPU cores and CoreXL FW instances
fw ctl affinity <options> Controls CoreXL affinities of interfaces/processes/CoreXL FW instances to CPU cores
fw ctl affinity Prints the help message with available options
fw -d ctl affinity -corelicnum Prints the number of system CPU cores allowed by CoreXL license
Prints the current CoreXL affinities - output shows affinities of interfaces/processes/CoreXL FW instances to CPU core
fw ctl affinity -l
s
Prints the current CoreXL affinities in reverse order - output shows CPU cores and which interface/process/CoreXL FW
fw ctl affinity -l -r
instance is affined to each CPU core
Prints all current CoreXL affinities - output shows affinities of interfaces/processes/CoreXL FW instances to CPU core
fw ctl affinity -l -a
s, and also shows targets without specific affinity
Prints the current CoreXL affinities - verbose output shows affinities of interfaces/processes/CoreXL FW instances to
fw ctl affinity -l -v
CPU cores (targets are shown as 'Interface' (with IRQ), 'Kernel', 'Process'
Prints the current CoreXL affinities - output shows affinities of interfaces/processes/CoreXL FW instances to CPU core
fw ctl affinity -l -q
s, and suppresses errors
Prints the current CoreXL affinities - verbose output that combines all possible outputs (shows all targets in reverse o
fw ctl affinity -l -r -a -v
der)
fw ctl affinity -l -p PID [-r] [-a] [-v] Prints the current CoreXL affinity of the specified process (by PID) to CPU cores
fw ctl affinity -l -n Daemon_Name [-r] [-a] [-v] Prints the current CoreXL affinity of the specified process (by name [maximal length = 255 characters]) to CPU cores
fw ctl affinity -l -k Instance_ID [-r] [-a] [-v] Prints the current CoreXL affinity of the specified CoreXL FW instance to CPU cores
fw ctl affinity -l -i Interface_Name [-r] [-a] [-v] Prints the current CoreXL affinity of the specified interface to CPU cores
fw ctl affinity -s <target> { CPU_ID [ CPU_ID ... ] | all } Sets CoreXL Affinity
fw ctl affinity -s -p PID { CPU_ID [ CPU_ID ... ] | all } Sets CoreXL affinity of the specified process (by PID) to CPU cores
fw ctl affinity -s -n Daemon_Name { CPU_ID [ CPU_ID ... ] | all } Sets CoreXL affinity of the specified process (by name [maximal length = 255 characters]) to CPU cores
fw ctl affinity -s -k Instance_ID { CPU_ID [ CPU_ID ... ] | all } Sets CoreXL affinity of the specified CoreXL FW instance to CPU cores
fw ctl affinity -s -i Interface_Name { CPU_ID [ CPU_ID ... ] | all } Sets CoreXL affinity of the specified interface to CPU cores
Command Description
fw ctl multik stat Prints the summary table for CPU cores and CoreXL FW instances
fw ctl multik stat Prints the general help message with available parameters
fw ctl affinity <options> Controls CoreXL affinities of Virtual Devices/interfaces/processes/CoreXL FW instances to CPU cores
fw ctl affinity Prints the help message with available options
fw -d ctl affinity -corelicnum Prints the number of system CPU cores allowed by CoreXL license
fw ctl affinity -l -r Prints the current CoreXL affinities in reverse order
fw ctl affinity -l -v Prints the current CoreXL affinities - verbose output
fw ctl affinity -l -q Prints the current CoreXL affinities and suppresses errors
Prints the current CoreXL affinities - verbose output that combines all possible outputs (shows all targets in reverse o
fw ctl affinity -l -r -a -v
der)
fw ctl affinity -l -x [-vsid VSID_ranges] [-cpu CPU_ID_ranges] [-flags e|k|t|n|h] [-r] [-a] [- Prints the current CoreXL affinities - extended output
v] Notes:
If "-vsid" flag is omitted, the current context will be used (in which the command was issued)
The "-vsid" flag accepts either a single VSID (e.g., '-vsid 7'), or a range of VSID numbers (e.g., '-vsid 0-5
'), or a combination (e.g., '-vsid 0-2 4')
The "-cpu" flag accepts either a single CPU ID (e.g., '-cpu 7'), or a range of CPU ID numbers (e.g., '-cpu 0-
'), or a combination (e.g., '-cpu 0-2 4')
The "-flags" requires at least one of the following arguments (multiple arguments must be specified togeth
r):
e - do not print exception processes
k - do not print kernel threads
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 52/59
18/01/2021 Best Practices - Security Gateway Performance
t - print all process threads
n - print process name instead of /proc/<PID>/cmdline
h - print CPU mask in Hex format
o - print output into the '/tmp/affinity_list_output' file (VSX R77.10 and above)
fw ctl affinity -s -i Interface_Name CPU_IDs | all Sets affinities of the specified interface to CPU cores
fw ctl affinity -s -p PID CPU_IDs | all Sets affinities of the specified process (by PID) to CPU cores
If "-vsid" flag is omitted, the current context will be used (in which the command was issued)
fw ctl affinity -s -d -pname Daemon_Name [-vsid VSID_ranges] -cpu CPU_ID_ranges The "-vsid" flag accepts either a single VSID (e.g., '-vsid 7'), or a range of VSID numbers (e.g., '-vsid 0-5
'), or a combination (e.g., '-vsid 0-2 4')
The "-cpu" flag accepts either a single CPU ID (e.g., '-cpu 7'), or a range of CPU ID numbers (e.g., '-cpu 0-
'), or a combination (e.g., '-cpu 0-2 4')
If "-vsid" flag is omitted, the current context will be used (in which the command was issued)
fw ctl affinity -s -d [-vsid VSID_ranges] -cpu CPU_ID_ranges The "-vsid" flag accepts either a single VSID (e.g., '-vsid 7'), or a range of VSID numbers (e.g., '-vsid 0-5
'), or a combination (e.g., '-vsid 0-2 4')
The "-cpu" flag accepts either a single CPU ID (e.g., '-cpu 7'), or a range of CPU ID numbers (e.g., '-cpu 0-
'), or a combination (e.g., '-cpu 0-2 4')
The "-inst" flag accepts either a single FWK_ID (e.g., '-inst 7'), or a list of FWK_ID numbers (e.g., '-inst
fw ctl affinity -s -d -inst Instances_ranges -cpu CPU_ID_ranges
0 2 4')
The "-cpu" flag accepts either a single CPU ID (e.g., '-cpu 7'), or a range of CPU ID numbers (e.g., '-cpu 0-
'), or a combination (e.g., '-cpu 0-2 4')
fw ctl affinity -s -d -fwkall Number_of_CPUs Sets affinities of all FWK instances to CPU cores (where Number_of_CPUs is an integer number)
fw ctl affinity -vsx_factory_defaults Resets all VSX affinity settings (prompts the user) (VSX R77 and above)
fw ctl affinity -vsx_factory_defaults_no_prompt Resets all VSX affinity settings (does not prompt the user) (VSX R77 and above)
Command Description
Shows Multi-Queue status of all supported interfaces (those with enabled Multi-Queue and those with disabled Multi-
cpmq get -a
ueue)
cpmq get -v Shows Multi-Queue status of active supported interfaces with IRQ affinity information
cpmq get rx_num igb Shows the number of active RX queues for interfaces that use igb driver
cpmq get rx_num ixgbe Shows the number of active RX queues for interfaces that use ixgbe driver
cpmq set [-f] Enables/Disables Multi-Queue per interface (the "-f" flag forces the operation)
Sets the number of active RX queues to the number of CPU cores that run as CoreXL SND (CPU cores that are not use
cpmq set rx_num all default [-f] by CoreXL FW instances) - for all interfaces (those that use igb driver and those that use ixgbe driver)
Note: This is recommended configuration
Sets the number of active RX queues to the number of CPU cores, which are not used by CoreXL FW instances (recom
cpmq set rx_num igb default [-f]
mended) - for interfaces that use igb driver
Sets the number of active RX queues to the number of CPU cores, which are not used by CoreXL FW instances (recom
cpmq set rx_num ixgbe default [-f]
mended) - for interfaces that use ixgbe driver
Sets the number of active RX queues to the number between 2 and the number of CPU cores - for all interfaces (those
cpmq set rx_num all <number> [-f]
that use igb driver and those that use ixgbe driver)
Sets the number of active RX queues to the number between 2 and the number of CPU cores - for interfaces that use
cpmq set rx_num igb <number> [-f]
gb driver
Sets the number of active RX queues to the number between 2 and the number of CPU cores - for interfaces that use
cpmq set rx_num ixgbe <number> [-f]
xgbe driver
Sets the IRQ affinity for Multi-Queue interfaces after the following occurs (in the given order):
Run this command after the interface status is changed back to 'up' to reset the IRQ affinity for this interface.
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 53/59
18/01/2021 Best Practices - Security Gateway Performance
(7) Examples
Show / Hide example #1
1. Output of 'top' command shows that 'fw_worker_X' processes constantly consume the CPU at 100%:
2. Output of 'fwaccel stats -s' command shows very poor acceleration ratios and high percentage of packets that are passing through Medium path (PXL):
3. Output of 'fwaccel stat' command shows that 'Accept Templates' are disabled after specific rule:
4. Thorough analysis of Firewall's Connections Table (using 'connstat' utility from sk85780) during the issue (~99800 concurrent connections) showed that most matche
rules are lower than Rule #251 (after which SecureXL Accept Templates are disabled):
Top 10 Rules:
=============
Rule: 342 Hits: 71463
Rule: 343 Hits: 16732
Rule: 356 Hits: 4488
Rule: 354 Hits: 3126
Rule: 216 Hits: 2249
Rule: 361 Hits: 2003
Rule: 357 Hits: 1536
Rule: 51 Hits: 722
Rule: 25 Hits: 666
Rule: 362 Hits: 426
7. Output of 'fwaccel stats -s' command showed that 'Accept Templates' are now disabled after much lower rule:
8. The following steps were taken to decrease the percentage of packets that are passing through Medium path (PXL):
C. In the Application Control & URL Filtering policy, disabled the "Any - Any - Allow" rule.
D. In the Anti-Virus & Anti-Bot configuration, excluded networks, whose traffic does not have to be inspected per sk92515 - How to configure Anti-Virus
Exceptions.
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 54/59
18/01/2021 Best Practices - Security Gateway Performance
Relevant outputs were collected during a period of time from Security Gateway with the help of the shell script that runs relevant commands every 1 second. All outputs
were analyzed and correlated to each other.
Example:
2. Output of 'cat /proc/stat' command showed that CPU time is consumed by:
Example:
4. Output of 'ps auxwf' command correlated to the output of 'top' command showed that during the spikes of CPU load by 'fw', the CPD daemon calls the 'sim
affinity -c' command, which calls a series of Check Point shell script that calculate the current load by running various 'fw ctl' commands. These commands
process high amount of data - and this causes the spike in CPU load.
The CPD daemon calling the 'sim affinity -c' command shows that SIM Affinity is configured in Automatic mode (refer to sk63330 - Explanation about 'sim affinit
-c' , 'fwaffinity_used_cpus' , 'fw ctl affinity -l -v'):
root 15829 0.1 1.2 231704 25748 ? Ssl Jul23 49:45 \_ cpd
root 5153 0.0 0.0 2832 1088 ? S 12:19 0:00 | \_ sim affinity -c
root 5212 0.0 0.0 1236 564 ? S 12:19 0:00 | \_ sh -c $FWDIR/scripts/fwaffinity_used_cpus > /tmp/sim_fw_cpus.tmp
root 5213 0.0 0.0 1236 564 ? S 12:19 0:00 | \_ /bin/sh /opt/CPsuite-R75.20/fw1/scripts/fwaffinity_used_cpus
root 5214 0.0 0.0 1236 424 ? S 12:19 0:00 | \_ /bin/sh /opt/CPsuite-R75.20/fw1/scripts/fwaffinity_used_cpus
root 5215 0.0 0.0 1236 372 ? S 12:19 0:00 | \_ /bin/sh /opt/CPsuite-R75.20/fw1/scripts/fwaffinity_used_cpus
root 5216 0.0 0.8 55636 18080 ? S 12:19 0:00 | \_ fw ctl affinity -l -v
root 5226 0.0 0.0 1236 552 ? S 12:19 0:00 | | \_ sh -c /bin/netstat -n 2>&1
root 5227 0.0 0.0 1668 560 ? R 12:19 0:00 | | \_ /bin/netstat -n
root 5217 0.0 0.0 1644 476 ? S 12:19 0:00 | \_ grep -E -v ^Interface.*:
root 5218 0.0 0.0 2028 644 ? S 12:19 0:00 | \_ awk -F: {print $2}
root 5219 0.0 0.0 1628 464 ? S 12:19 0:00 | \_ sed -e s/CPU//
root 5220 0.0 0.0 1604 372 ? S 12:19 0:00 | \_ tr [:space:] \n
root 5221 0.0 0.0 1644 468 ? S 12:19 0:00 | \_ grep -v ^[:space:]*$
root 5222 0.0 0.0 35424 508 ? S 12:19 0:00 | \_ sort
root 5223 0.0 0.0 1592 384 ? S 12:19 0:00 | \_ uniq
6. To minimize the load caused by IO Waiting, Linux kernel was fine-tuned per sk60703 - IOWait consumes 100% CPU after Security policy installation.
CoreXL:
Firewall Administration Guide (R75, R75.20, R75.40, R75.40VS) - Chapter 'CoreXL Administration'.
Performance Tuning Administration Guide (R76, R77) - Chapter 'CoreXL Administration'.
sk61701 - CoreXL Known Limitations
Multi-Queue:
Gaia OS:
SecurePlatform OS:
Command Line Interface Reference Guide (R75, R75.20, R75.40, R75.40VS, R76, R77).
Performance:
sk35496 - How to detect a memory leak on Security Gateway with SecurePlatform OS / Gaia OS
sk100766 - Simulation of low memory resources on Security Gateway - random failing of memory allocations
sk116740 - "top" command on VSX Gateway shows that FWK process consumes CPU at more than 100%
sk42181 - How to increase sizes of buffer on SecurePlatform Gaia for Intel NIC and Broadcom NIC
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 56/59
18/01/2021 Best Practices - Security Gateway Performance
sk92372 - How to change the size of IPv6 Neighbors cache table
sk98711 - Virtual Memory consumption on Security Gateway increases when CPU is under high load
sk79300 - How to correlate a rule from SmartDashboard to its corresponding entry in kernel table to see the rule's Hit Count
SecureXL:
sk66402 - SecureXL Drop Templates are not supported in versions lower than R76
sk74520 - What is the SecureXL penalty box mechanism for offending IP addresses?
sk98229 - Enabling QoS support for acceleration technologies (SecureXL and CoreXL)
sk104679 - SecureXL does not accelerate traffic when ISP Redundancy is enabled
sk63330 - Explanation about 'sim affinity -c' , 'fwaffinity_used_cpus' , 'fw ctl affinity -l -v'
CoreXL:
sk98229 - Enabling QoS support for acceleration technologies (SecureXL and CoreXL)
sk63330 - Explanation about 'sim affinity -c' , 'fwaffinity_used_cpus' , 'fw ctl affinity -l -v'
sk65463 - 'Peak' number of connections - discrepancy between the output of 'fw tab -t connections -s' command and the output of 'fw ctl pstat' command whe
CoreXL is enabled
SMT (HyperThreading):
Multi-Queue:
VSX:
sk110351 - Traffic latency on VSX Gateway if MTU larger than 4096 (Jumbo Frames) is configured on an interface
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 57/59
18/01/2021 Best Practices - Security Gateway Performance
sk97443 - Support Debug Tools
How To:
Date Description
12 Sep 2017 Updated instructions for Valgrind tool (to get this tool, need to contact Check Point Support)
11 Jan 2016 Corrected the syntax for using the pstack script
02 Mar 2015 Updated the best practices for Application Control & URL Filtering optimization
14 Jan 2015 Corrected the the formula for calculating the maximum number of concurrent connections
20 Nov 2014 Corrected the best practices for Application Control & URL Filtering optimization
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 58/59
18/01/2021 Best Practices - Security Gateway Performance
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk98348&partition=General&product… 59/59