SWAP usage is more common on Layer 7 gateway 10.1 than 9.x
search cancel

SWAP usage is more common on Layer 7 gateway 10.1 than 9.x

book

Article ID: 277202

calendar_today

Updated On:

Products

CA API Gateway

Issue/Introduction

Multiple customers reported concerns on swap usage on gateway 10.1

Cause

The inactive memory is swaped out only when the kernel cannot find enough free memory. But, depends on the setting, it can choose between reclaiming the buffers/cache memory, or swap out the inactive memory.

1.

On appliance gateway 10.1, the swappiness is set to 60, which is the default swappiness value on most Linux distributions. But this value is quite agressive, ie. when there is no free memory, the kernel will intend to use swap rather than reclaim the buffers/cache.

2.

On the other hand, from 10.1, the gateway set init heap size the same as max heap size which means the max heap memory is allocated when the gateway start up, this is for performance purpose, but if the heap is not fully used,  the gateway will occupy some memory which won't be used for long time -- that means there will be some inactive memory.

(you can check the gc log to see the heap usage)

(the gateway 9.x only set the max heap size, so the heap memory is allocated by time, which means there is no much inactive memory to swap out)

 

Base on above 2 reasons, the 10.1 will likely use more swap than 9.x.

Resolution

This should not really impact the gateway (unless you really run out of memory), so you can just ignore it.

But if you don't like swap usage, you may set swappingness to 0,  then the kernel will try not to use swap, but reclaim buffers/cache -- actually this is recommended for most of database server.

To do so, run following command after login command console,

# sysctl vm.swappiness=0

To change it permenently, add one line in /etc/sysctl.conf

vm.swappiness=0

 

To show the current swappiness,

# sysctl vm.swappiness

Additional Information

https://linuxize.com/post/how-to-change-the-swappiness-value-in-linux/

https://access.redhat.com/solutions/103833

https://www.kernel.org/doc/gorman/html/understand/understand013.html