特殊:Badtitle/NS100:AA1/Using:修订间差异

来自Ubuntu中文
跳到导航跳到搜索
Wikibot留言 | 贡献
无编辑摘要
Wikibot留言 | 贡献
无编辑摘要
 
第5行: 第5行:
== Optimizing SSD Performance ==
== Optimizing SSD Performance ==
'''Note: Skip this step if you have the hard disk Acer Aspire One.'''
'''Note: Skip this step if you have the hard disk Acer Aspire One.'''
'''Important:''' if you run Karmic on an Aspire One with SSD, you may experience various problems: much longer boot times, frequent ATA failures, Gnome Panel errors etc. If this is the case, please check the [[AA1/Fixes|Fixes]] page.
'''Important:''' if you run Karmic on an Aspire One with SSD, you may experience various problems: much longer boot times, frequent ATA failures, Gnome Panel errors etc. If this is the case, please check the [[UbuntuHelp:AA1/Fixes|Fixes]] page.
The performance of the SSD drive can be significantly improved by a few tweaks described in [[http://blogs.zdnet.com/perlow/?p=9190|an article by Jason Perlow]] (But ignore Tweak #1, which does not apply). The most important of these are described here.
The performance of the SSD drive can be significantly improved by a few tweaks described in [http://blogs.zdnet.com/perlow/?p=9190 an article by Jason Perlow] (But ignore Tweak #1, which does not apply). The most important of these are described here.
=== Change the file system mount options on SSDs to "noatime" ===
=== Change the file system mount options on SSDs to "noatime" ===
Edit /etc/fstab (gksudo gedit /etc/fstab) and change the the option "relatime" to “noatime”. The line for the root partition should then be something like:
Edit /etc/fstab (gksudo gedit /etc/fstab) and change the the option "relatime" to “noatime”. The line for the root partition should then be something like:
第51行: 第51行:
tmpfs      /var/tmp        tmpfs        defaults          0    0
tmpfs      /var/tmp        tmpfs        defaults          0    0
</nowiki></pre>
</nowiki></pre>
There is currently a bug in sysklogd where it cannot handle booting with an empty /var/log directory (bug [[https://bugs.launchpad.net/ubuntu/+source/sysklogd/+bug/290127|#290127]]). This can be fixed by modifying /etc/init.d/sysklogd:
There is currently a bug in sysklogd where it cannot handle booting with an empty /var/log directory (bug [https://bugs.launchpad.net/ubuntu/+source/sysklogd/+bug/290127 #290127]). This can be fixed by modifying /etc/init.d/sysklogd:
Find this function:
Find this function:
<pre><nowiki>
<pre><nowiki>
fix_log_ownership()
fix_log_ownership()
for l in `syslogd-listfiles -a`
        for l in `syslogd-listfiles -a`
do
        do
chown ${USER}:adm $l
                chown ${USER}:adm $l
done
        done
}
}
</nowiki></pre>
</nowiki></pre>
第65行: 第65行:
fix_log_ownership()
fix_log_ownership()
{
{
for l in `syslogd-listfiles -a --news`
        for l in `syslogd-listfiles -a --news`
do
        do
# Create directory for logfile if required
                # Create directory for logfile if required
ldir=$(echo ${l} | sed  's/[^\/]*$//g')
                ldir=$(echo ${l} | sed  's/[^\/]*$//g')
if [ ! -e $ldir ] ; then
                if [ ! -e $ldir ] ; then
mkdir -p $ldir
                        mkdir -p $ldir
fi
                fi
# Touch logfile and chown
                # Touch logfile and chown
touch $l && chown ${USER}:adm $l
                touch $l && chown ${USER}:adm $l
done
        done
}
}
</nowiki></pre>
</nowiki></pre>
第102行: 第102行:
Section "Device"
Section "Device"
(...)
(...)
Option "MonitorLayout" "LVDS,VGA"
        Option "MonitorLayout" "LVDS,VGA"
Option "Clone" "true"
        Option "Clone" "true"
Option "AccelMethod" "EXA"
        Option "AccelMethod" "EXA"
Option "MigrationHeuristic" "greedy"
        Option "MigrationHeuristic" "greedy"
VideoRam      229376
        VideoRam      229376
Option "CacheLines" "1980"
        Option "CacheLines" "1980"
EndSection
EndSection
</nowiki></pre>
</nowiki></pre>
第137行: 第137行:
with
with
CONCURRENCY=shell
CONCURRENCY=shell
'''Important:''' In Karmic concurrency bootup reportedly ([[http://bugs.launchpad.net/ubuntu/+source/grub2/+bug/447725|#447725]], [[http://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/497299|#497299]]) causes a number of side effects:
'''Important:''' In Karmic concurrency bootup reportedly ([http://bugs.launchpad.net/ubuntu/+source/grub2/+bug/447725 #447725], [http://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/497299 #497299]) causes a number of side effects:
* GRUB2 menu is always shown upon boot, and waits for user interaction.
* GRUB2 menu is always shown upon boot, and waits for user interaction.
* Some init-scripts are not started.
* Some init-scripts are not started.
第148行: 第148行:
sysctl -w vm.swappiness=1              # Strongly discourage swapping
sysctl -w vm.swappiness=1              # Strongly discourage swapping
sysctl -w vm.vfs_cache_pressure=50      # Don't shrink the inode cache aggressively
sysctl -w vm.vfs_cache_pressure=50      # Don't shrink the inode cache aggressively
# As in the rc.last.ctrl of Linpus
# As in the rc.last.ctrl of Linpus
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo ondemand > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo ondemand > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
cat /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate_max > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate
cat /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate_max > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate
echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
echo 20 > /proc/sys/vm/dirty_ratio
echo 20 > /proc/sys/vm/dirty_ratio
echo 10 > /proc/sys/vm/dirty_background_ratio
echo 10 > /proc/sys/vm/dirty_background_ratio
echo 1 > /sys/devices/system/cpu/sched_smt_power_savings
echo 1 > /sys/devices/system/cpu/sched_smt_power_savings
echo 10 > /sys/module/snd_hda_intel/parameters/power_save
echo 10 > /sys/module/snd_hda_intel/parameters/power_save
echo 5 > /proc/sys/vm/laptop_mode
echo 5 > /proc/sys/vm/laptop_mode
#Decrease power usage of USB while idle
#Decrease power usage of USB while idle
[ -w /sys/bus/usb/devices/1-5/power/level ] && echo auto > /sys/bus/usb/devices/1-5/power/level
[ -w /sys/bus/usb/devices/1-5/power/level ] && echo auto > /sys/bus/usb/devices/1-5/power/level

2010年5月19日 (三) 17:14的最新版本

{{#ifexist: :AA1/Using/zh | | {{#ifexist: AA1/Using/zh | | {{#ifeq: {{#titleparts:AA1/Using|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:AA1/Using|1|-1|}} | zh | | }}

<<Include(AA1/Header)>> This page lists tweaks and usability suggestions for the Aspire One.

Optimizing SSD Performance

Note: Skip this step if you have the hard disk Acer Aspire One. Important: if you run Karmic on an Aspire One with SSD, you may experience various problems: much longer boot times, frequent ATA failures, Gnome Panel errors etc. If this is the case, please check the Fixes page. The performance of the SSD drive can be significantly improved by a few tweaks described in an article by Jason Perlow (But ignore Tweak #1, which does not apply). The most important of these are described here.

Change the file system mount options on SSDs to "noatime"

Edit /etc/fstab (gksudo gedit /etc/fstab) and change the the option "relatime" to “noatime”. The line for the root partition should then be something like:

UUID=f0ae2c59-83d2-42e7-81c4-2e870b6b255d / ext2 noatime,errors=remount-ro 0 1

Use the "noop" I/O scheduler

An elevator is a mechanism built into the kernel which, when engaged, orders disk I/O so that to minimize HDD head seek runs. In case of an SSD drive, though, it barely makes sense. So, we turn it off. Note: It seems Karmic will include 'elevator=noop' option by default if a machine has SSD disk. If it isn't the case then follow the below instructions.

GRUB (versions prior to GRUB2)

Edit /boot/grub/menu.lst using your favorite editor, and add "elevator=noop" as an option. The default kernel configuration, found in the last part of the file should be something like:

title		Ubuntu 8.04.1, kernel 2.6.24-19-generic
root		(hd0,0)
kernel		/boot/vmlinuz-2.6.24-19-generic root=UUID=f0ae2c59-83d2-42e7-81c4-2e870b6b255d ro quiet splash elevator=noop
initrd		/boot/initrd.img-2.6.24-19-generic
quiet

In order for the changes to remain when updating the kernel, also in menu.lst, find the line

# defoptions=quiet splash

and add "elevator=noop" as an option:

# defoptions=elevator=noop quiet splash

GRUB2

Edit /etc/default/grub using your favorite editor, and add "elevator=noop" to the list of GRUB_CMDLINE_LINUX_DEFAULT values. The corresponding line will then look like:

GRUB_CMDLINE_LINUX_DEFAULT="elevator=noop quiet splash"

Then rebuild GRUB2 configuration files:

$ sudo update-grub

Reduce SSD Wear

Note: Skip this step if you have the hard disk Acer Aspire One. Frequent writes to the SSD will cause failure eventually. We can reduce the number of writes to the SSD by moving our logs to a temporary filesystem in RAM that gets destroyed at ever reboot. Now this means your logs will not be persistent across reboots making debugging difficult in some cases. This step is optional of course, so if you need the logs for an extended period of time do not follow these steps. Open your fstab again, and add the following lines:

gksudo gedit /etc/fstab
tmpfs      /var/log        tmpfs        defaults           0    0
tmpfs      /tmp            tmpfs        defaults           0    0
tmpfs      /var/tmp        tmpfs        defaults           0    0

There is currently a bug in sysklogd where it cannot handle booting with an empty /var/log directory (bug #290127). This can be fixed by modifying /etc/init.d/sysklogd: Find this function:

fix_log_ownership()
        for l in `syslogd-listfiles -a`
        do
                chown ${USER}:adm $l
        done
}

..and replace it with this:

fix_log_ownership()
{
        for l in `syslogd-listfiles -a --news`
        do
                # Create directory for logfile if required
                ldir=$(echo ${l} | sed  's/[^\/]*$//g')
                if [ ! -e $ldir ] ; then
                        mkdir -p $ldir
                fi
                # Touch logfile and chown
                touch $l && chown ${USER}:adm $l
        done
}

Warning: This will cause some packages to fail mysteriously when they cannot access the log directories that were installed with the packages and then disappeared at reboot. To rebuild the rest of the directory structure inside /var/log on each reboot, add these lines to /etc/rc.local above the 'exit 0' line:

for dir in apparmor apt cups dist-upgrade fsck gdm installer samba unattended-upgrades ; do
	if [ ! -e /var/log/$dir ] ; then
		mkdir /var/log/$dir
	fi
done

Note: Discovered ATA 40-wire cable misdetection after resume (currently 2.6.27), causing hdparm down from 40MB/s to 25MB/s: filed http://bugzilla.kernel.org/show_bug.cgi?id=11879 for this issue. -AndiM

Disable Scrollkeeper

Note: Skip this step if you have the hard disk Acer Aspire One. ScrollKeeper is a cataloging system for documentation on open systems. It creates a lot of writes every time you install a package. Disable it and your installs will fly! Finally, add a diversion to stop dpkg from overwriting your changes.

sudo mv /usr/bin/scrollkeeper-update /usr/bin/scrollkeeper-update.real
sudo ln -s /bin/true /usr/bin/scrollkeeper-update
sudo find /var/lib/scrollkeeper/ -name \*.xml -type f -exec rm -f '{}' \;
sudo dpkg-divert --local --divert /usr/bin/scrollkeeper-update.real --add /usr/bin/scrollkeeper-update

Video & 3D Performance

Out of the box, the graphics card (Intel GMA 950) is well detected. However, you can tweak /etc/X11/xorg.conf to achieve better graphic card performance:

Section "Device"
(...)
        Option "MonitorLayout" "LVDS,VGA"
        Option "Clone" "true"
        Option "AccelMethod" "EXA"
        Option "MigrationHeuristic" "greedy"
        VideoRam       229376
        Option "CacheLines" "1980"
EndSection

The "Clone" option is especially useful if you want to capture video or photos. Without it, you will get a black screen in applications like cheese. Also, add this to your /etc/profile:

export INTEL_BATCH=1

Note: 'export INTEL_BATCH=1' appears to causes graphics faults (artifacts) within 'ume-launcher' (even with Compiz fully disabled). Reboot and you will have a more responsive system, with better 3D FPS, and improved video performance.

Screen

There are various methods that will help you make better use of the Aspire One's small screen. One of the most important is being able to move windows that are too large to fit on the screen at once. To move a hidden part of the window into view, click and drag with the left mouse button on any part of the window while holding down the ALT key. However, you won't be able to drag windows so the top of the window is above the top of the screen. To fix that, enter the following in a terminal window: gconftool-2 --set /apps/compiz/plugins/move/allscreens/options/constrain_y --type bool 0 Since the Aspire One's screen has almost twice as much resolution horizontally as vertically, having panels on both the top and bottom is not ideal. You may want to remove the top or bottom panels, make them smaller, or move them so that they are vertical, on the left and right side, instead of horizontal on top and bottom.

Touchpad

The AAO touchpad is quite easy to bump whilst typing. The best fix is to disable all scroll and tap commands for 1 second after each keystroke. Go to Preferences and select "Sessions". Click the add button and add an entry:

Name: Syndaemon
Command: syndaemon -d -t -i 1
Comment: Disable trackpad while typing

The '1' can be changed to any decimal number, and defines the amount of time to lock the trackpad after each keystroke. See the Syndaemon man page for full details.

Speed Up Boot Process

To decrease boot time, activate concurrency bootup: gksudo gedit /etc/init.d/rc and replace the line: CONCURRENCY=none with CONCURRENCY=shell Important: In Karmic concurrency bootup reportedly (#447725, #497299) causes a number of side effects:

  • GRUB2 menu is always shown upon boot, and waits for user interaction.
  • Some init-scripts are not started.
  • /etc/rc.local is not run on bootup.

Therefore I would discourage you from using that in Karmic. -- Dark Knight

Increase Battery Life

Add the following to the /etc/rc.local file:

# Economize the SSD
sysctl -w vm.swappiness=1               # Strongly discourage swapping
sysctl -w vm.vfs_cache_pressure=50      # Don't shrink the inode cache aggressively

# As in the rc.last.ctrl of Linpus
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo ondemand > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
cat /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate_max > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate

echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
echo 20 > /proc/sys/vm/dirty_ratio
echo 10 > /proc/sys/vm/dirty_background_ratio

echo 1 > /sys/devices/system/cpu/sched_smt_power_savings
echo 10 > /sys/module/snd_hda_intel/parameters/power_save
echo 5 > /proc/sys/vm/laptop_mode

#Decrease power usage of USB while idle
[ -w /sys/bus/usb/devices/1-5/power/level ] && echo auto > /sys/bus/usb/devices/1-5/power/level
[ -w /sys/bus/usb/devices/5-5/power/level ] && echo auto > /sys/bus/usb/devices/5-5/power/level

On some Aspire Ones, usually AOA110, the #Decrease power usage of USB while idle part of the script might cause the screen to shutdown abruptly on battery power and freeze the system. If your AA1 produces the problem described here: https://answers.launchpad.net/ubuntu/+question/83062 then perhaps, if you have applied the "Increase Battery" script here, you should comment the USB-idle power usage part.