FortiSOAR Knowledge Base
FortiSOAR: Security Orchestration and Response software provides innovative case management, automation, and orchestration. It pulls together all of an organization's tools, helps unify operations, and reduce alert fatigue, context switching, and the mean time to respond to incidents.
sramanujam
Staff
Staff
Article Id 276620
Description

Swap memory is usually where the kernel moves inactive or less frequently used data from RAM to free up physical RAM for more critical FortiSOAR processes. There might be a case where, at times, even the savior swap memory can become full.

 

Generally, it is possible to address this issue by either identifying and terminating resource-intensive processes or, more easily, by increasing the swap space.

 

This article describes how to quickly increase swap space on a FortiSOAR instance.

Scope FortiSOAR v6.x v7.x.
Solution
  1. Let’s check the system’s current swap space configuration using the free command:

 

$ free -gh
total used free shared buff/cache available
Mem: 4.7Gi 796Mi 3.0Gi 25Mi 884Mi 3.7Gi
Swap: 2.9Gi 1.8Gi 1.1Gi

 

  1. Create the swap file using the fallocate command:

 

$ sudo fallocate -l 1G /swapfile_extend_1GB

 

Then, secure the swap file by restricting permissions on it. Like that, only root can access it.

 

$ sudo chmod 600 /swapfile_extend_1GB
$ ls -l /swapfile_extend_1GB
-rw------- 1 root root 1073741824 Aug 28 17:21 /swapfile_extend_1GB

 

  1. Now that the file has been created, use it for swap, and set appropriate permissions on it. the newly created file is formatted as a swap.

 

$ sudo mkswap /swapfile_extend_1GB
Setting up swapspace version 1, size = 1024 MiB (1073737728 bytes)
no label, UUID=9d28d839-2f4f-4173-9bba-576539fce7b6

 

After formatting the file as a swap file, enable it to activate the new swap file.

 

$ sudo swapon /swapfile_extend_1GB

 

  1. To preserve the newly created swap file even after a reboot, add an entry to the /etc/fstab file.

 

$ sudo vi /etc/fstab

/swapfile_extend_1GB none swap sw 0 0

We can use the grep command to confirm the configuration for the newly added swap file.

$ grep swap /etc/fstab
/swapfile none swap sw 0 0
/swapfile_extend_1GB none swap sw 0 0

 

  1. Subsequently, it is possible to examine whether the swap file is active using the free command.

 

$ free -gh
total used free shared buff/cache available
Mem: 4.7Gi 796Mi 3.0Gi 25Mi 884Mi 3.7Gi
Swap: 3.9Gi 1.9Gi 2.0Gi

 

A swap file has been successfully created and the system has now additional space, which can help to improve the performance when RAM usage is high.

 

Contributors