Tuesday, April 8, 2014

การเพิ่มแรม Swap ให้ Ubuntu

Posted by Mr.911 on 3:14 AM with 1 comment

เมื่อ vps ของเราใช้แรมมากขึ้น คงไม่ดีแน่หากปล่อยทิ่งไว้โดยไม่ทำอะไรเลย สิ่งที่ตามมาคงไม่พ้นอาการค้างและระบบอาจจะ reboot ขึ้นมาใหม่ ดังนั้นเรามาเพิ่ม แรม Swap ให้ Ubuntu กันเถอะครับ

ตรวจสอบแรม Swap ในระบบมีอยู่หรือไม่
sudo swapon -s

หากไม่มีข้อความใดๆขึ้นเลยแสดงว่า vps ของเรายังไม่มีแรม swap
Filename    Type  Size Used Priority
คำสั่งเพิ่มแรม Swap
sudo dd if=/dev/zero of=/swapfile bs=1024 count=256k
พิมคำสั่ง
sudo mkswap /swapfile
พิมคำสั่ง
sudo swapon /swapfile
พิมคำสั่ง
swapon -s
พิมคำสั่ง
sudo nano /etc/fstab
เพิ่มคำสั่งไว้ด้านล่างสุด
/swapfile       none    swap    sw      0       0
พิมคำสั่งที่ละบรรทัด
echo 10 | sudo tee /proc/sys/vm/swappiness 
echo vm.swappiness = 10 | sudo tee -a /etc/sysctl.conf 
พิมคำสั่งที่ละบรรทัด
sudo chown root:root /swapfile 
sudo chmod 0600 /swapfile 
เสร็จเรียบร้อยครับ ^ ^
Categories:

1 comment :

  1. Did you realize there's a 12 word phrase you can speak to your man... that will trigger intense emotions of love and instinctual attractiveness to you deep within his heart?

    That's because deep inside these 12 words is a "secret signal" that triggers a man's impulse to love, look after and protect you with his entire heart...

    12 Words Who Fuel A Man's Desire Response

    This impulse is so hardwired into a man's brain that it will make him work better than before to make your relationship as strong as it can be.

    Matter of fact, fueling this powerful impulse is absolutely essential to getting the best possible relationship with your man that the second you send your man a "Secret Signal"...

    ...You'll immediately notice him expose his soul and mind to you in such a way he's never experienced before and he'll identify you as the one and only woman in the galaxy who has ever truly appealed to him.

    ReplyDelete