How to improve CPM’s performance or overcome high memory consumption by creating a swap partition

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

    • Recommended instance sizes and volume types for CPM Server instances

      EC2 Instance sizing guidelines 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 ...
    • 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 ...
    • CPM RESTful API guide for CPM v2.6.0

      Attached to this article is the user guide for CPM RESTful API v1.3 (for CPM v2.6.0 and up). For CPM CLI information see here: https://support.n2ws.com/portal/kb/articles/cli-guide-and-software-download-for-cpm-v2-6-0 You can find the latest version ...
    • Release notes for the latest v2.7.x CPM release

      In order to upgrade to v2.7.x from any previous version, please see the instructions here: https://support.n2ws.com/portal/kb/articles/upgrade-instructions-for-v2-7-0 In order to upgrade to v2.7.x from v2.7.0 or newer only, you can use the patch file ...
    • CPM supports custom encryption keys for DR

      To support the usage of a custom encryption key for DR, you will need to perform the following: In the account where the custom key resides: Go to KMS and browse to the key you wish to share. Go to the "Other AWS accounts" at the bottom of the page ...