Hi all

I want to change the swappiness of my linux server.Its running nginx as front alongside with cpanel
Based from tutorials i added vm.swappiness=90(to change default value from 60 to 90) in sysctl.conf and i reboot the server

However when after reboot is done i did cat /proc/sys/vm/swappinessand the value is STILL 60

My server is a VPS

Need urgent help

Besides sysctl.conf you have to edit /proc/sys/vm/swappiness, just replace with 90. Then you can use sudo swapoff -a and sudo swapon -a to load the new value without rebooting.

Thanks cereal bro

But i get permission denied when i tried to edit /proc/sys/vm/swappiness

I am login as root user , i tried both by ssh and ftp

That can happen if you run a command like this one:

sudo echo "90" > /proc/sys/vm/swappiness

So, try this:

echo "90" | sudo tee /proc/sys/vm/swappiness

If you still get an error then check file permission, user and group:

ls -l /proc/sys/vm/swappiness

and post back here, maybe someone else will give you a better support. Bye!

Permission
-rw-r--r-- 1 root root 0 Jul 31 18:07 /proc/sys/vm/swappiness

Hope someone will be able to help me out

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.