You can set swappiness while running: sysctl vm.swappiness=10
To retain the settings when rebooting: vi /etc/sysctl.conf and add or edit; vm.swappiness = 10
To query for the current swappiness setting: cat /proc/sys/vm/swappiness
The setting range is 0 to 100. The higher the number the sooner swap is used preserving RAM. A swappiness setting of zero means that the disk will be avoided unless absolutely necessary (you run out of memory), while a swappiness setting of 100 means that programs will be swapped to disk almost instantly.