This is an automated email from the ASF dual-hosted git repository.

paul_a pushed a commit to branch 41120-memory
in repository https://gitbox.apache.org/repos/asf/cloudstack.git

commit 7a5b167f90cd22b8953ff78434e476449be338b0
Author: Paul Angus <paul.an...@shapeblue.com>
AuthorDate: Tue Nov 27 17:28:38 2018 +0000

    further tweaks - add vm.min_free_kbytes=20480
---
 systemvm/debian/etc/sysctl.conf                        | 3 +++
 systemvm/debian/opt/cloud/bin/setup/cloud-early-config | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/systemvm/debian/etc/sysctl.conf b/systemvm/debian/etc/sysctl.conf
index e07a345..5dd1ae4 100644
--- a/systemvm/debian/etc/sysctl.conf
+++ b/systemvm/debian/etc/sysctl.conf
@@ -66,3 +66,6 @@ vm.swappiness=1
 
 # make the kernel more aggressive in reclaiming RAM from the disk and swap 
caches
 vm.vfs_cache_pressure = 200
+
+# try to maintain 'free' memory thereby reducing the size of disk cache, hence 
reducing swapping.
+vm.min_free_kbytes = 20480
diff --git a/systemvm/debian/opt/cloud/bin/setup/cloud-early-config 
b/systemvm/debian/opt/cloud/bin/setup/cloud-early-config
index a73300b..27ec749 100755
--- a/systemvm/debian/opt/cloud/bin/setup/cloud-early-config
+++ b/systemvm/debian/opt/cloud/bin/setup/cloud-early-config
@@ -206,10 +206,10 @@ patch() {
   physmem=$(free|awk '/^Mem:/{print $2}')
   case $physmem in
     [1-4095999])
-      sysctl -w vm.vfs_cache_pressure=200
+      sed  -i "/^vm.vfs_cache_pressure/ c\vm.vfs_cache_pressure = 200" 
/etc/sysctl.conf
       ;;
     *)
-      sysctl -w vm.vfs_cache_pressure=100
+      sed  -i "/^vm.vfs_cache_pressure/ c\vm.vfs_cache_pressure = 100" 
/etc/sysctl.conf
       ;;
   esac
 

Reply via email to