[默认] Ubuntu 效能調校備忘

Nov 19th, 2008

转载本站文章请注明,转载自:扶凯[http://www.php-oa.com]

本文链接: http://www.php-oa.com/2008/11/19/ubuntu-optimize.html

转一个台湾朋友的文章:http://cha.homeip.net/blog/archives/2008/11/ubuntu.html#more

 

  • 建立開機索引 (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-allhosts

echo "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

自行編譯 Kernel (編譯 Kernel 需留意的選)

加速 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 1024×768)

以 root 身份操作:

apt-get install nvidia-xconfig

nvidia-xconfig

vi /etc/X11/xorg.conf

Section "Monitor"

VertRefresh    50.0 – 75.0 (垂直更新頻率最大值改成監視器所適用的頻率值)

EndSection

Section "Device"

Driver    "nv" (把原來的 "nvidia" 改成 "nv")

EndSection

Section "Screen"

DefaultDepth    16 (原 24bit 改成 16bit 顏色減輕系統負擔)
SubSection        "Display"
        Depth        16
        Modes        "1024×768" "800×600" "640×480"
EndSubSection

EndSection

 

Del.icio.us Google书签 Digg Live Bookmark Technorati Furl Yahoo书签 Facebook 百度搜藏 新浪 ViVi 365Key 网摘 天极网摘 和讯网摘 博拉网 POCO 网摘 饭否 QQ 书签 Digbuzz 我挖网 Mister Wong
Tags:
  1. xi2008wang
    Nov 19th, 2008 at 18:10
    Reply | Quote | #1

    oh, my god

    一堆堆黄色, 在LCD上看不清楚