love~ruby+rails 发表于 2013-1-29 23:11:24

Make Linux faster and lighter<1>

With just a few tweaks, your Linux box can be lighter, sprightlierand quicker than ever before. Read on for the best ways to speed upyour boot sequence, optimise KDE and Gnome, and get betterperformance from your favourite apps. We've also got some top tips from our favourite free software gurus...
Gone are the days when you could make a cup of tea and drink it inthe time it takes your computer's operating system to boot (with onenotable exception). On that basis, you might think that your Linuxmachines are already performing at the fastest possible speed, right?
Sadly, this is not always the case. Communities developingmainstream Linux distributions have to appeal to the widest possibleaudience and ensure compatibility with the widest range of hardware.This means that someone running a mainstream distro on a netbook or alow-end PC may well be using many of the same settings as someone witha high-end gaming machine. But it doesn't have to be this way!
With just a few tweaks and some experimentation, your Linux systemcan realise your machine's untapped potential. Do you have a dual-coreprocessor? Take advantage of this by running boot processes inparallel. Do you have more memory than you know what to do with? Youcould try caching data in memory rather than swapping space for fasteraccess.
The great strength of everyone's favourite free OS is that it can becustomised from the ground up, so Linux is the ideal tool to tailor toyour needs. But once you have an ultrafast system, how can you becomemore productive? We've consulted prominent members of the free softwarecommunity for their favourite tips that make their systems moreproductive - and they could do the same for you.
 
Make Linux boot faster

Any productive machine needs to be up and running as soon aspossible, and a sluggish boot can hinder your efforts – which is whyboot times were the first thing we thought about improving. One word ofwarning before you begin: we recommend that you make a backup beforeyou make these alterations, as a bug in your bootloader can render yourLinux box unbootable!
Remove the timeout

You may notice that each time you boot there's a small count-downfrom three to zero, which is great if you regularly select a differentOS or Linux kernel at boot time, but useless if you always boot intothe same distro. Fortunately, it's easy to remove by opening /boot/grub/menu.lst in a text editor with root permissions and finding the line showing:
timeout=3Once you've found it, change the value to zero. Save and exit thenreboot and you should notice you have just knocked three seconds offyour boot time.
Improve disk performance

If you have a DMA-compatible (Direct Memory Access) hard drive, youcan increase data throughput threefold with a simple tweak. This willimprove boot times because read times will be reduced, and overallperformance will increase whenever the hard disk is accessed.
Start by installing hdparm through your package manager, then fire up a root terminal and type: hdparm -d1 /dev/hda1 replacing /dev/hda1with the location of your boot partition to increase startup times orthe root partition to increase general performance. Gnome users canhave this run automatically each startup by heading to System > Administration > Services. You can then add this line as an entry with gksudo at the start to ensure it runs with root permissions without requiring additional authentication.
Run boot processes in parallel

Parallelism can lead to big performance boosts, because running twoprocesses at once will take half the time of running them sequentially(at least in theory). You can take advantage of this technique in Grubby firing up /etc/init.d/rc in a text editor with root permissions and finding the following line:
CONCURRENCY=noneYou would then replace none with shellbefore saving and closing your text editor. When you reboot you shouldsee a noticeable decrease in your boot times (around one or two secondsin most cases). If you don't see an increase, this is because thistweak is aimed primarily at systems with multi-core processors. If youhave a solo-core processor you could actually increase your boot timeif you use this tweak, which was the case with our test system where wesaw a 2.4-second increase.
<div class="image">http://www.tuxradar.com/files/power_up_1.jpgYou could edit a text file and restart your machine to profile your system, or just click a few buttons in Grub.
页: [1]
查看完整版本: Make Linux faster and lighter<1>