Increase swap size



  • I recently had to do a clean install of pfsense 2.4.5 since I made the mistake of updating packages before the pfsense update to 2.4.5 :/

    Side note (No, I shouldn't have done that, but in my own defense updating packages is not something I normally hesitate doing. This whole you must update pfsense before the packages thing isn't fool proof and I'm not going to remember this months from now. Hint, suggesting something should be done for idiots like me from killing the system. A big red warning message in the package update tab telling me not to update packages when there is a pfsense update available or something please. It might also help you guys get less support issues on here during an update.)

    On to the real question. During the fresh install, I forgot to adjust the swap size. Last time I used the recommend twice the ram size for my swap. I have plenty of space on my SSD for it. Since I forgot to do it during the install, is there another way to adjust it? I couldn't find anything in the book or on this forum about that. It's not important, but just wondering more than anything. I'm going to leave it alone otherwise.

    Thanks,
    Raffi


  • Rebel Alliance Developer Netgate

    You'll have to reinstall to change the size of the disk partitions. Even if you could adjust it with a bunch of different commands, the process would be long and prone to error. You can take a backup, reinstall with the right options, and be back up in minutes.


  • Netgate Administrator

    Generally speaking you should not be using SWAP so the size is not that important. If you are using SWAP space it's probably because you don't have enough RAM for what you're trying to do or something is misconfigured.

    Steve



  • Thanks for the replies guys. Thanks for confirming that I would have to reinstall the system. I figured that was the case. The system never really uses swap so I'm not concerned about making that change. If I ever have to reinstall for any reason, I would deal with it then. Maybe I'll do it at the next major update. I only once had a case with swap being used and that was due to some kind of memory leak since it kept creeping up. So to me, swap is the emergency limp mode. If it's being used I have to correct the issue anyway. I guess having more swap would give me more time before the entire system comes to a halt while in that limp mode in the case of a memory leak that keeps going up.



  • @Raffi_

    I also wonder why you'd need more swap on a router. However, in the Linux world, it's possible to create a swap file, which serves the same function as a swap partition. Perhaps the same is possible with FreeBSD.



  • @JKnott said in Increase swap size:

    @Raffi_

    I also wonder why you'd need more swap on a router. However, in the Linux world, it's possible to create a swap file, which serves the same function as a swap partition. Perhaps the same is possible with FreeBSD.

    Thanks, that's a good point. I will not spend any time looking into ways to do it even if it is possible. It was just something I was curious about more than something I needed. If for example it was a single command I could have run and it was fool proof, I would have gone for that. But being that in the case of pfsense it would be a partition adjustment. There is no way I'm doing that. Especially, for something that really isn't necessary as you point out.


Log in to reply