Configuring Additional Swap Space on ZENworks Appliance

over 5 years ago

On the appliance server, by default the swap file system is configured with 2 GB. If the server configuration is of 8 GB RAM or above, it is good to have swap space that should be the same or double the RAM size of the device. It is recommended to double the swap space for better performance.

For example, if the server in the zone is a configuration server that has a dedicated role in a larger environment, where all the requests are coming from managed devices for configuration data, the memory consumption of the ZENServer process will go beyond the allocated heap space and the server might not respond. This will cause the kernel to crash the service due to lesser swap space.

In this scenario, you might not be able to change the existing swap partition on the appliance, but you can configure additional swap to the server.


  • Appliance server should be up and running.

  • The above steps should be performed on the server that has a dedicated Configuration role.

To Configure Swap File on the Appliance Server:

  • Check the swap space used by the system, launch the terminal and execute the free –k

  • The following dd command creates the “<myswapfile>” swap file in the /vastorage directory with a size of 4096 MB (4 GB). You can rename the <myswapfile> swap file.
    If you do not have additional hard disks on the device, you can create a file on your filesystem, and use that file for swap space.

# dd if=/dev/zero of=/vastorage/myswapfile bs=1M count=4096
4096 0 records in
4096 0 records out
# ls -l /vastorage/myswapfile
rw-r--r--    1 root     root     4294967296 Aug 14 23:47

Note: Since the root file system will be of lesser size, it is recommended to have the swap file created under /vastorage that is created after adding the second disk to the appliance server.

  • Change the permission of the swap file to ensure only root user can access it

 chmod 600 /vastorage/myswapfile

  • Make the as a swap file by executing the below command

 mkswap /vastorage/myswapfile
Setting up swapspace version 1, size = 1073737 kB

  • Enable the file by executing the below command:

swapon /vastorage/myswapfile

  • Make the swap file available as a swap area even after the reboot, by appending the following line to the /etc/fstab file:

 cat /etc/fstab
/vastorage/myswapfile      swap   swap    defaults        0 0

  • Verify whether the new swap area is available for use by executing below command:

#swapon -s

Filename    Type      Size         Used  Priority

/dev/sda2    partition 4192956        0      -1

/vastorage/myswapfile   file 4192956  0      -2

#free -k
total  used       free     shared    buffers     cached
Mem:   3082356    3022364   59992      0      52056    2646472

-/ buffers/cache:     323836    2758520

Swap:      5241524          0    5241524

  • Reboot the appliance server to use the new swap file.



How To-Best Practice
Comment List
Related Discussions