« Synergy - 多台電腦共用一套鍵盤滑鼠 | 首頁 | PHP 程式: ldapsearch 輸出內容 (LDIF) 轉 UTF-8 編碼 »
2008年11月17日
Ubuntu 效能調校備忘
- 建立開機索引 (profile)
- 以 dash 取代 sh 增進開機效能
- 並行啟動程序, 加速開機
- 降低 SWAP 寫入機會
- 減少文字模式終端機數量
- 暫存區使用 ramdisk
- 使用 Prelink、Preload 節省應用程式啟動時間
- 停用 IPv6
- 使用 sysv-rc-conf 管理系統服務
- GNOME 作業階段
- 使用 Real Time (CONFIG_HZ=1000) 版本的 Kernel
以下未提及執行身份的指令均以 root 身份執行
建立開機索引
於 GRUB 選單按 [ e ] → 編輯 kernel /vmlinuz-2.6... 這行, 於最後加上 profile
profile 參數係建立開機索引用, 不需存入 menu.lst
於更新 kernel 版本後再執行 profile 即可
停用開機畫面
vi /boot/grub/menu.lst
刪除所有 splash 參數
以 dash 取代 sh 增進開機效能
dpkg-reconfigure dash
並行啟動程序, 加速開機
vi /etc/init.d/rc
CONCURRENCY=shell
降低 SWAP 寫入機會
echo "vm.swappiness = 10" >> /etc/sysctl.conf
sysctl -p
減少文字模式終端機數量
cd /etc/event.d
rename 's/$/\.bak/' tty[3-6]
暫存區使用 ramdisk (依實體記憶體大小斟酌使用)
vi /etc/fstab
tmpfs /tmp tmpfs size=100m,mode=1777 0 0
使用 Prelink、Preload 節省應用程式啟動時間
apt-get install prelink preload
vi /etc/default/prelink
PRELINKING=yes
/etc/cron.daily/prelink
vi /etc/apt/apt.conf
DPkg::Post-Invoke {"echo Running prelink, please wait...;/etc/cron.daily/prelink";}
停用 IPv6
vi /etc/modprobe.d/aliases
alias net-pf-10 off #ipv6
vi /etc/hosts
# The following lines are desirable for IPv6 capable hosts
#::1 ip6-localhost ip6-loopback
#fe00::0 ip6-localnet
#ff00::0 ip6-mcastprefix
#ff02::1 ip6-allnodes
#ff02::2 ip6-allrouters
#ff02::3 ip6-allhostsecho "alias net-pf-10 off" >> /etc/modprobe.d/bad_list
使用 sysv-rc-conf 管理系統服務
apt-get install sysv-rc-conf
sysv-rc-conf (停用不需要的系統服務, 預設 runlevel 為 2)
GNOME 作業階段 (登入圖形介面後自動執行的程序)
gnome-session-properties (以 X 登入者身份執行, 停用不需要的程序)
使用 Real Time (CONFIG_HZ=1000) 版本的 Kernel
(不建議使用於電池供電的機器)
apt-get install linux-rt
加速 ssh 連線登入
vi /etc/ssh/ssh_config
#GSSAPIAuthentication yes
#GSSAPIDelegateCredentials no
附錄: 老舊 nVidia 系列顯卡 (RIVA TNT2) 之 xorg.conf 設定備忘
環境: Ubuntu 8.10, nVidia RIVA TNT2 vga card, 15" LCD Monitor (max 1024x768)
以 root 身份操作:
apt-get install nvidia-xconfig
nvidia-xconfig
vi /etc/X11/xorg.conf
#刪除整個 ( Section "File" ) 區塊
Section "File"
RgbPath "/usr/X11R6/lib/X11/rgb"
EndSectionSection "Monitor"
VertRefresh 50.0 - 75.0 (垂直更新頻率最大值改成監視器所適用的頻率值)
EndSectionSection "Device"
Driver "nv" (把原來的 "nvidia" 改成 "nv")
EndSectionSection "Screen"
DefaultDepth 16 (原 24bit 改成 16bit 顏色減輕系統負擔)
SubSection "Display"
Depth 16
Modes "1024x768" "800x600" "640x480"
EndSubSectionEndSection
Posted by Jamyy at 2008年11月17日 15:45