Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
We had a problem on one of the servers which I help administer. Every now and again RAM usage would max out and SWAP would then be used – this would sometimes max out and bye bye server, normally this happened for only a few seconds and all was fine – however if it lasted more then when SWAP ran out – the server ground to a halt and needed a manual restart.
The server in question is quite busy – but only had 512Meg of RAM (this has since been rectified) historically as it wasn’t that busy at first several years ago has slowly grown as websites on it have grown in popularity and databases have grown.
So an immediate fix was required – it had a swap partition – couldn’t create a new one, it would mean downtime as we are using the hard-drives!
So added a swap file – here’s how to do it:
At the end of this if yo do the following “cat /proc/swaps” to see your swapspace. It’s now larger by a lot and hey presto. Of course a long-term fix has to be more ram if possible or tweak your setups! (or a new server!)
This doesn’t get setup to activate on boot – mainly because I didn’t need this – a temporary fix and therefore didn’t want todo this as the RAM would be upgraded soon, but if you need more memory – and don’t mind it being slow for stability then this is a possible solution.