I was wondering if it is possible to increase the size of swap partition. If yes the how can I increase it?
Thanks!
I was wondering if it is possible to increase the size of swap partition. If yes the how can I increase it?
Thanks!
I found the solution. No need to reply this thread.
Open SSH and run below commands:
dd if=/dev/zero of=/usr/swap-file bs=1024 count=2048000
mkswap /usr/swap-file
swapon /usr/swap-file
swapon -s
Now add the following to the /etc/fstab and you are done.
/usr/swap-file swap swap defaults 0 0
I found this from Blogs | eth0.us - Server admin info for cPanel, plesk, ensim and linux!
Thanks!
That is one way to do it. Swap is really good at spreading the load across the system. So if you give swap 1 gig on 4 drives it'll equal out the load. It's a real neat feature, I donate a gig to swap on each hardware device in hopes of speeding things up over all.
Most of the time, if I'm swapping something is either really wrong, or it's time to get more ram.![]()
Also don't forget that swap is basically RAM but on the hard drive, so it is a lot slower. If you are starting to swap a lot your IOwait is probably going to very quickly increase which is going to bog down your server pretty quickly. You probably should look at optimizing or adding in some more RAM if you need more swap constantly.
John W
www.eth0.us
To use a RAID Drive is also a better option to decrease number of Disk I/O.
AccuWebHosting.Com | CPanel Hosting Provider Since 2003
₪ Cloud Powered Hosting | CPanel VPS
₪ Trusted by 20,000+ Clients Worldwide
John W
www.eth0.us
It is always not recommended to increase the swap to high values.