Tuesday, February 3, 2015

Reswap Revision

A while ago I wrote about turning off swap if you have enough RAM, for performance reasons. I realized that the original script I posted did not work very well. So, here is a simplified, effective way to empty your swap, thus gaining some system performance (because RAM is so much faster than hard disks).


    #!/bin/bash
    ##Reswap-- place in your $path as reswap
    ##to quickly empty your swap and gain some performance.
    ##
    set -e
    echo "Killing swap."
    swapoff -a
    echo "Success. Reenabling..."
    swapon -a
    echo "Done"
    exit

No comments:

Post a Comment