How to improve CPM’s performance or overcome high memory consumption by creating a swap partition
***IMPORTANT***
Please
make sure your CPM complies with the recommended instance sizes regardless of
creating the swap file.
In
certain environments, CPM may suffer from performance issues or high memory
consumption even though the recommended instance sizes are followed.
In
such cases it is advised to create a swap partition.
Please
follow the below steps:
- Login to cpm via ssh using cpmuser and your private key
Create a swap file with the
desired size:
sudo fallocate -l 4G
/swapfile
This
example will create a 4G swap file named swapfile under the root directory.
Generally, an amount equal to or double the
amount of RAM on your system is a good starting point.
Restrict the file permissions
to read/write only for the root user:
sudo chmod 600
/swapfile
sudo
chown root:root /swapfile
- Verify that the correct
permissions are applied:
ls -lh /swapfile - Create the swap file.
sudo mkswap /swapfile
- Tell the system to set up
the swap space by typing:
sudo swapon /swapfile - Verify that procedure was successful by typing:
sudo swapon -s
Output should look like the below:
Filename Type Size Used Priority
/swapfile file 4194300 0 -1
- Make the swap file permanent (it will retain after reboot):
sudo vim /etc/fstab
At the bottom of the file, you need to add a line that will tell the operating system to automatically use the file you created:
/swapfile none swap sw 0 0
Save and exit.
Please
note- currently, this setting will not be retained when upgrading the CPM via
ami.
If
you upgrade using ami, you will have to follow this KB again after the upgrade
Link
to Release Notes and the latest patch –
Related Articles
What steps can you take to mitigate crashes due to performance issues on the CPM Instance.
Background The following contains steps that customers can enact to help performance issues like excess memory or CPU or crashes. This KB article assumes that the CPM instance is sized correctly and has the correct volume type as per the Recommended ...
Recommended instance sizes and volume types for CPM Server instances
EC2 Instance sizing Here are the recommended instance sizes for CPM Server instances: Up to 200 instances - t3.medium Up to 500 instances - m5.large, c5.large, R5.large, C6i.large, R6i.large, M6i.large, C7i.large, M7i.large Up to 1000 instances - ...
CPM may generate an error in the logs when creating snapshots with tags that begin with “aws:”
When CPM creates snapshots, some snapshots may have tags that begin with “aws:”. These tags are AWS’s tags and are only allowed to be used by AWS. Therefore, when CPM will create a snapshot of an EC2 resource with such a tag, the snapshot will ...
Cross-account instance recovery with CPM_CLI may not retain instance’s attached volumes
When performing cross-account instance recovery of an instance with more than one volume, using CPM CLI, CPM may fail to recover the instance’s attached volumes . The instance will get created only with its root volume and no error message will ...
Release notes for the latest v2.6.x CPM release
In order to upgrade to v2.6.x from any version, please use the AMI upgrade method . The upgrade instructions are in the chapter 1.3.5 "Upgrading the N2WS Server Instance" at https://n2ws.com/support/documentation/introduction-to-cpm#13 In order to ...