เนื่องจากผมรัน vmware player แล้วรู้สึกว่าช้ามากจึงไปเช็คที่ Gnome System Monitor ในตอนแรกมองข้ามไป ว่า vmware ไม่ได้กิน resource อะไรเลย แต่ก็งงว่า ที่ตัว process ของ vmware นั้นบอกว่าใช้ memory กว่า 400 MB แต่ทำไม ram ของเราถูกใช้ไปแค่ 400 MB เช่นกัน หงุดหงิด กับสปีดของ vmware อยู่นาน ก็เพิ่งจะได้สังเกตดว่า จริงๆ แล้ว ram ที่ตัว vmware เราใช้นั้นไปอยู่บน swap ซะหมดเลย (มิน่าหละ ทำไมทำอะไรแต่ละที Hard disk ทำงานหนักเหลือเกิน)
จึงทำการหาวิธีการจัดการกับ swap จนไปพบว่าเราสามารถปรับแต่โอกาสในที่จะให้เจ้า Ubuntu ของเราไปวาง memory ไว้บน swap ได้ ด้วยค่า swappiness นี่เอง ซึ่งปกติจะตั้งไว้ที่ 60 แต่จริงๆ เค้าแนะนำไว้ที่ 10 (ยกเว้น งาน server ที่เค้าบอกว่าน่าจะ 60) ตามนี้เลย
ถ้าต้องการตรวจสอบค่า swappiness
cat /proc/sys/vm/swappiness
ถ้าต้องการเปลี่ยนค่า swappiness ชั่วคราว
echo 10 > /proc/sys/vm/swappiness
ถ้าต้องการเปลี่ยนค่า swappiness ถาวรเปลี่ยนค่าที่ไฟล์นี้
gksudo gedit /etc/sysctl.conf
โดยเพิ่มบรรทัดนี้ เข้าไป
vm.swappiness=10
แล้วทำการ reboot
จาก Performance tuning with ''swappiness''
ปล. พบว่าถึงแม้ว่าจะตั้งค่าเป็น 0 ในบางโอกาส OS ก็ยังไปใช้ swap อยู่ดี
Friday, September 5, 2008
Subscribe to:
Posts (Atom)
Collectd PostgreSQL Plugin
I couldn't find this link when searching with google https://www.collectd.org/documentation/manpages/collectd.conf.html#plugin-postgresql
-
Put your cursor on the text box of the post/comment you want to indent Go to the menubar at the top of the screen Edit > Emoji & ...
-
sudo su postgres supply your Mac password modify /Library/PostgreSQL/9.x/data/pg_hba.conf from local all all md5 to local all all ...
-
I have to tell you that this is my method. I'm not sure is there any better workaround to handle this. I'm on Ubuntu Intrepid Ibex. ...