Ubuntu performance tweaking guide

Posted 9 months, 2 weeks ago at 11:32 am. 0 comments

Lets start first with the kernel:

apt-get install build-essential libncurses-dev kernel-package
cd /usr/src
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.20.tar.bz2

This will download the latest sources available, in my case linux-2.6.20.tar.bz2

cd /usr/src
tar -xjf linux-2.6.20.tar.bz2
cd linux-2.6.20

Now lets apply the Con Kolivas patches, these are patches designed to improve system responsiveness with specific emphasis on the desktop, but suitable to any workload.

wget www.kernel.org/pub/linux/kernel/people/ck/patches/2.6/2.6.20/2.6.20-ck1/patch-2.6.20-ck1.bz2
bzcat patch-2.6.20-ck1.bz2 |patch -p1

Copy the current kernel config and configuring the kernel

cp /boot/config-`uname -r` .config
make menuconfig

In “General Setup” activate:
- Support for paging of anonymous memory (swap)
- Support for prefetching swapped memory

In “Processor type and features”:
- Processor family Choose the model of your processor.
- set Preemption Model to Voluntary Kernel Preemption (Desktop)
- High Memory Support
- off - if you have less than 1 GB of RAM
- 1GB Low Memory Support - if you have 1GB of RAM
- 4GB - if you have more than 1GB of RAM
- set Timer frequency to 1000 Hz

In “Kernel hacking” uncheck “Kernel debugging”.

Now exit and save the configuration.

Making the new kernel package:
make-kpkg -initrd –revision=LinuxMonitor1 kernel_image kernel_headers modules_image

Installing the new kernel
dpkg -i *.deb

HDParm

sudo gedit /etc/hdparm.conf

at the bottom add:

/dev/hda {
dma = on
io32_support = 1
}

/dev/cdroms/cdrom0 {
dma = on
interrupt_unmask = on
io32_support = 0
}

Concurrent Booting

Concurrent booting allows Ubuntu to take advantage of dual-core processors, as well as processors that hyperthread or multithread or what ever the different companies call it now.

sudo gedit /etc/init.d/rc

Look through the file and you will find CONCURRENCY=none.
You must change it to: CONCURRENCY=shell

Prelink

Disclaimer: Prelinking might break your system! Only consider for use if you can risk the chance that your install might mess up. Most of all make sure that it gets to run the whole thing through the first time you prelink. Stopping in the middle can lead to system failure. Prelinking is a powerful device and needs to be used with care.

Prelink is no longer necessary in Feisty. Feisty uses a new linking mechanism called DT_GNU_HASH which dramatically speeds up the linking process without the need for continuously running this prelink program. Again, prelink is NOT useful starting from Feisty

How to enable prelink

1. Activate Ubuntu universe sources
2. Put this command into terminal to install Prelink:

sudo apt-get install prelink

3. Now put this command into the terminal:

sudo gedit /etc/default/prelink

4. Change where it says “PRELINKING=unknown” from unknown to “yes”
5. Adjust the other options if you know what the heck you’re doing. If it looks foreign to you, the defaults work well.
6. To start the first prelink (the longest one!), put this in terminal:

sudo /etc/cron.daily/prelink

Automatic Prelinking After Program Are Installed

One problem with prelinking in that when you install new programs those programs are not prelinked. So to avoid this problem when installing programs with apt-get or synaptic, use the directions below.

1. Put this in terminal:

sudo gedit /etc/apt/apt.conf

2. When the file opens in Gedit, put this line at the end of the file and save (even if the file has no content before you add the line):

DPkg::Post-Invoke {”echo Running prelink, please wait…;/etc/cron.daily/prelink”;}

General Notes About Prelinking

In the future, prelink performs a quick prelink (a less-than-1-minute procedure on most systems) daily, usually at midnight. Every 14 days, or whatever you changed it to be, a full prelink will run.

If you just did a major apt-get upgrade that changed systemwide libraries (i.e. libc6, glibc, major gnome/X libs, etc etc etc) and experience cryptic errors about libs, rerun step 6.

To undo prelink, change step 4 from yes to no, then rerun step 6.

Prelinking will make the binaries it prelinks change, so it’s not appropriate if you have tripwire or another checksum-based IDS system, or if you do incremental or differential backups to save on space.

Services

*Note you might not have all these services on your box.

To enable/disable services go to System -> Administration -> Services

1. acpi-support - leave it on.
2. acpid - The acpi daemon. These two are for power management, quite important for laptop and desktop computers, so leave them on.
3. alsa - If you use alsa sound subsystem, yes leave it on. But if you have the service below, its safe to be off. The default is off when alsa-utils is on.
4. alsa-utils - On my system, this service supercedes the alsa, so I turn off the alsa and turn this on at S level.
5. anacron - A cron subsystem that executes any cron jobs not being executed when the time is on. Most likely you’ve probably turned your computer off when a certain cron job time is ready. For example, updatedb is scheduled at 2am everyday, but at that moment, you computer is off, then if anacron service is on, it will try to catch up that updatedb cron.
6. apmd - If you computer is not that old which can’t even support acpi, then you may try to turn this off.
7. atd - like cron, a job scheduler. I turned it off.
8. binfmt-support - Kernel supports other format of binary files. I left it on.
9. bluez-utiles - I turned it off. I don’t have any bluetooth devices.
10. bootlogd - Leave it on.
11. cron - Leave it on.
12. cupsys - subsystem to manager your printer. I don’t have one so I turned it off, but if you do, just leave it on.
13. dbus - Message bus system. Very important, leave it on.
14. dns-clean - Mainly for cleaning up the dns info when using dial-up connection. I don’t use dial up, so I turn it off.
15. evms - Enterprise Volumn Management system. I turned it off.
16. fetchmail - A mail receving daemon. I turned it off.
17. gdm - The gnome desktop manager. I turned it off anyway since I get use to boot to console first. This is up to you if you want to boot directly to GUI.
18. gdomap - You can turn it off.
19. gpm - Mouse support for console. If you feel you’d better have a mouse on console, go turn it on.
20. halt - Don’t change it.
21. hdparm - tuning harddisk script, should be on.
22. hibernate - If your system support hibernate, leave it on. Otherwise, its useless for you.
23. hotkey-setup - This daemon setup some hotkey mappings for Laptop. Manufacturers supported are: HP, Acer, ASUS, Sony, Dell, and IBM. If you have a laptop in those brands, you can leave it on, otherwise, this might not have any benefits for you.
24. hotplug and hotplug-net - activating hotplug subsystems takes time. I’d consider to turn them off.
25. hplip - HP printing and Image subsystem. I turned it off.
26. ifrename - network interface rename script. Sounds pretty neat but I turned it off. Mainly for managing multiple network interfaces names. Since I have a wireless card and an ethernet card, they all assigned eth0 and ath0 from kernel, so its not really useful for me.
27. ifupdown and ifupdown-clean - Leave it on. They are network interfaces activation scripts for the boot time.
28. inetd or inetd.real - take a look your /etc/inetd.conf file and comment out any services that you don’t need.
29. klogd - Leave it on.
30. laptop-mode - A service to tweak the battery utilization when using laptops. You can leave it on.
31. linux-restricted-modules-common - You need to see if you really have any restricted modules loaded on your system. I’d leave it on.
32. lvm - I don’t use it so I turned it off. Leave it on if you *DO* have lvm.
33. makedev - Leave it on.
34. mdamd - Raid management tool. I don’t use it so I turned it off.
35. mdamd-raid - Raid tool. If you don’t have Raid devices, turn it off.
36. module-init-tools - Load extra modules from /etc/modules file. You can investigate your /etc/modules file and see if there is any modules that you don’t need. Normally, this is turned on.
37. mountvirtfs - mount virtual filesystems. Leave it on.
38. networking - bring up network interfaces and config dns info during boot time by scaning /etc/network/interfaces file. Leave it on.
39. ntpdate - Sync time with the ubuntu time server. Leave it on if you want.
40. nvidia-kernel - I compiled the nvidia driver by myself, so its useless for me now. If you use the ubuntu nvidia driver from the restrict modules, just leave it on. 41. pcmcia - pcmcia device - useless if you are using desktop which doesn’t have pcmcia card. So in that case, turn it off please.
42. portmap - daemon for managing services like nis, nfs, etc. If your laptop or desktop is a pure client, then turn it off.
43. powernowd - client to manage cpufreq. Mainly for laptops that support CPU speed stepping technology. Normally, you should leave it on if you are configuring a laptop, but for desktop, it might be useless.
44. ppp and ppp-dns - Useless to me. I don’t have dial-up.
45. readahead - It seems readahead is a kind of “preloader”. It loads at startup some libs on memory, so that some programs will start faster. But it increases startup time for about 3-4 seconds. So, you can keep it… or not. I tested and I just didn’t feel difference loading programs. So I decided to turn it off. If you have a reason to keep it on, please do so.
46. reboot - Don’t change it.
47. resolvconf - Automatically configuring DNS info according to your network status. I left it on.
48. rmnologin - Remove nologin if it finds it. It wouldn’t happen on my laptop, so I got rid of it.
49. rsync - rsync daemon. I don’t use it on my laptop, so turned it off.
50. sendsigs - send signals during reboot or shutdown. Leave it as it is.
51. single - Active single user mode. Leave it as it is.
52. ssh - ssh daemon. I need this so I turned it on.
53. stop-bootlogd - stop bootlogd from 2,3,4,5 runlevel. Leave it as it is.
54. sudo - check sudo stauts. I don’t see any good to run it everytime on a laptop or desktop client, so I turned it off.
55. sysklogd - Leave it as it is.
56. udev and udev-mab - Userspace dev filesystem. Good stuff, I left them on.
57. umountfs - Leave it as it is.
58. urandom - Random number generator. Might not useful but I left it on.
59. usplash - Well, if you really want to see the nice boot up screen, leave it as it is.
60. vbesave - video card BIOS configuration tool. Its able to save your video card status. I left it on.
61. xorg-common - setup X server ICE socket. Leave it as it is.
62. adjtimex - This is a kernel hw clock time adjusting too. Normally, you shouldn’t see this on your boot up list. In very rare case if you do see its on your boot up process, then there might be a reason why it is on, so better leave it that way. In my case, it is off.
63. dirmngr - A certification lists management tool. Work with gnupg. You will have to see if you need it or not. In my case, I turned it off.
64. hwtools - A tool to optimize irqs. Not sure what’s the benefits of turning it on. In my case, I turned it off.
65. libpam-devperm - A daemon to fix device files permissions after a system crash. Sounds pretty good, so I left it on.
66. lm-sensors - If you matherboard has builtin some sensor chips, it might be helpful to see hw status via userspace. I ran it and it said “No sensors found”, so I turned it off.
67. screen-cleanup - A script to cleanup the boot up screen. Well, turn on or off is up to you. In my case, I left it on.
68. xinetd - A inetd super daemon to manage other damons. In my system, the xinetd is managing chargen, daytime, echo and time (find them from /etc/xinetd.d dir), I care none of them, so I turned it off. If you do have some important services configured under xinetd, then leave it on.

via http://linuxmonitor.blogspot.com/2007/03/ultimate-ubuntu-performance-tweaking.html

相关日志:

从头开始对ubuntu进行优化 (ZT)
ubuntu 优化技巧

Popularity: 7% [?]

Tags:

提高 feisty 性能

Posted 9 months, 2 weeks ago at 11:32 am. 0 comments

原文来自 http://xlntsolution.blogspot.com/2007/03/feisty-performance-fly-like-butterfly.html

blogspt 似乎再次封掉了,:( 我是通过这个代理看到的

部分内容如下:

sudo gedit /etc/hosts

你会看到类似

127.0.0.1 localhost
127.0.1.1 guoshuang-laptop

这样的内容,在 localost 后面加上你的主机名,如guoshuang-laptop

127.0.0.1 localhost guoshuang-laptop
127.0.1.1 guoshuang-laptop

1. Disable IPv6
At least I dont need IPv6 yet so this is what I do to disable it.
sudo kate /etc/modprobe.d/aliases
And change the line:
alias net-pf-10 ipv6
to:
alias net-pf-10 off #ipv6
This will disable IPv6 on all network interfaces. You need to reboot.

2. Run boot processes in parallel
This will make upstart to run the boot processes in parallel and speed up the boot process.
sudo kate /etc/init.d/rc
Find and change the line:
CONCURRENCY=none
to:
CONCURRENCY=shell

3. Aliasing hostname to localhost
Right or wrong, you decide. But I picked this up in the Ubuntu forums the other day and it does improve the startup of some apps.
sudo kate /etc/hosts
and add you hostname to the first line after localhost like this:
127.0.0.1 localhost yourhost
127.0.1.1 yourhost

4. Disable pango
I know that this is already taken care of in firefox but it still makes a good performance boost to thunderbird and some other apps.
sudo kate /etc/environment
and add:
MOZ_DISABLE_PANGO=”1″

5. Preload
It does what you think. It preloads most common used libs and files = faster startup times on your applications.
sudo apt-get install preload

What about prelink?
Prelink is no longer necessary in feisty. Feisty uses a new linking mechanism called DT_GNU_HASH which speeds up the linking process without the need for continuously running prelink.

6. Swappiness
The default value for vm.swappiness is 60 in Ubuntu Feisty whic is a good default value but if you want to tweak the performance a little bit more you can change this value to a lower value to reduce the load of the swap. If you run the follwing command:
sysctl -q vm.swappiness
You will se that the value is set to 60. And by running:
sudo sysctl vm.swappiness=10
You will change the value from 60 to 10 which will make your system write to swap a lot less and I would recommend this to everyone that has 512 mb of memory or more. If you find that you have very little use of swap set the value to 0. This will not disable the swap but it will make your system write to the swap as little as possible and keep as much as possible in memory. This makes a huge improvment when switching between applications since they are now likley to be in physical ram instead of on the swap partition.

To set your value permanent you need to change the sysctl.conf file:
sudo kate /etc/sysctl.conf
Add the line
vm.swappiness=10
To the end of the file. This way it will be set upon boot.

I’ve found that the value of 5 works very good for my use and I have 1 GB of memory.

7. Profile grub
There is a option to grub called profile which will profile your startup. What it does is that it kind of indexing all the files read during boot/startup and later on it will find and read those files quicker.

Hit the escape button when booting to get to the grub menu.
Select your default boot kernel and hit the e button.
Go down to the second line and hit the e button again.
Add profile to the end of the line and press enter.
Hit the b button to boot with your new option.

The first time it will take a little bit longer to boot because it has to build the index (or whatever they want to call it) but every boot after this will be a lot smoother.
You need to do this every time you update your kernel or have made other huge changes to your system that might affect the files needed during boot.

The following could cause your system to be unstable or even unable to boot so please use them care…

8. sysv-rc-conf
Install sysv-rc-conf and disable the services you don’t need at startup.
As an example. On my computer I don’t have bluetooth so I don’t need to start it at boot time.
So simply disable what ever you don’t have or use.

sudo apt-get install sysv-rc-conf
and then run:
sudo sysv-rc-conf

9. Kernel hacking
Even thought the new kernel in feisty is very good and already tuned a bit there still are some things you can do to the kernel the will make your system snappier and boot up even faster.

Use this thread from the ubuntu forums as a guide on how to compile your own kernel.
master kernel thread

What I do is that I make sure to add my file systems I use to the kernel instead of loading them as modules. Take out whatever I don’t have or use and then compile my new and hopefully improved kernel ;)
10. Filesystem setup
The choice and use of the file system is a big issue when dealing with performance. Depending on your usage of your system you might need to configure your filesystem different.

For my usage I like to use the following setup (which I think is a good desktop setup)

Mountpoint

filesystem

Size

/boot

ext2

100 MB

/root

LVM, VG=system, xfs

6 GB

/swap

LVM, VG=system, swap

The size of RAM in your computer. Making it smaller and you will not be able to hibernate.

/home

LVM, VG=system, xfs

1 GB, or the rest of the space in that VG

/data

LVM, VG=data, xfs

The rest of the free space

Using the following options in fstab for all my xfs partitions:
noatime,nodiratime,logbufs=8

Using LVM can really speed up the disk performance. And you get a lot of other good stuff with it as well. Read more about LVM here.
I choose to have /root and /home on one VolumeGroup and /data on another simply because I can then split them up on diffrent physical disks and have them spanning over multiple physical disks witch really speeds up the reads and writes.

At the moment this is pretty much it but I will update this as soon as I discover more performance tunings…

Tuning applications

Not so much to add here but this what I like to do.

1. Firefox
Use swiftfox instead. It’s optimized for your CPU.
Install the fasterfox add-on
If it’s not already set, disable IPv6. In the url enter about:config and find the ipv6 entry and disable it.
Install adblock plus add-on
to disable ad’s it helps a lot :)
2. openoffice
If you don’t need that extras that java JRE provides then simply disable it openoffice. That’s what I do.

Once Feisty is released I will have a script done that all you brave people can run that will do most of this in one go :)
I will also write down the kernel options that I use to compile my kernel for those who are interested.

But until then, use this and enjoy a much faster and smoother running Feisty.

Popularity: 40% [?]

Tags: , , , , , , , , , , ,

从头开始对ubuntu进行优化 (ZT)

Posted 9 months, 2 weeks ago at 11:31 am. 0 comments

转载:http://blog.scylzx.net/

在安装Linux系统之初,就应该考虑怎样使linux系统得到最好的性能。linux本身也设计成可以良好扩展的形态,比如在Linux系统中,我们可以随心所欲地组织磁盘分区,有些朋友喜欢一个/,一个swap就搞定,其实这个不是非常科学的选择,本人在多次重装后,总结一些经验,与各位朋友分享,如果有不对的地方,请务必提出批评。

第一部分 仅有一张硬盘的电脑安装linux

我在论坛上的优化初步一文中提过, linux也是有磁盘碎片的,所以为了减少碎片,应将内容经常改变的目录放在单独的分区。一个优化的分区策略,可以很好地改进Linux系统的性能,减少磁盘碎片,提高磁盘I/O能力。从方便备份数据的角度考虑,因为很多备份工具对整个分区进行备份的效率很高,所以我们应将Linux系统的几个主要的目录作为单独的文件系统,为它们各自分配一个区。
这里简单介绍下,几个重要的目录,这几个目录在ubuntu安装的硬盘分区时,可选择性的特别分区,进行挂载。
/usr 文件系统中一般不改变的文件,如库,程序。
/var 文件系统包含会改变的文件。
/home 文件系统包含用户家目录,即系统上的所有实际数据。
/tmp 临时文件。
/usr/local 这是提供给一般用户的/usr目录,在这安装软件最适合。
/srv 一些服务起动以后,需要的数据放在这里。
/opt 一些大型程序,安装在这里,方便管理。
/ 根目录,没啥说的。
我的建议是以上所有目录都单独在硬盘上分区,如果要问为什么,我可以举个例子。
比如LumaQQ,这个软件,我们可以把他安装在/opt下面,这样我们如果需要重新安装系统的话,可以选择不格式化/opt,并且把~/.lumaqq 这个文件夹备份下,这样当我们重新装好系统,再次把/opt挂载好,只需要把.lumaqq这个文件夹放在~下,配置好java,运行一个命令:
代码:
sudo ln -s /opt/LumaQQ/lumaqq /usr/bin/lumaqq

就可以再次使用lumaqq了,而且聊天记录等一系列lumaqq相关的设置都不会消失,避免了下载的麻烦,也少了安装的麻烦。
从磁盘碎片的角度上来讲,/tmp、/var和/home都是活动最频繁的分区了,如果我们把它们直接放在根目录下必然引起处理的麻烦,到时候有了磁盘碎片影响整个磁盘的性能。
因此,我推荐把以上的目录全部单独分区,单独挂载。
在分区的时候也是有一定的机巧的,根据磁盘的特点,我们知道越是靠磁盘外部的柱面,旋转越快,而且每次旋转时,磁盘读写头可以覆盖较多的区域,也就意味着靠外部的柱面可以得到较好的性能。所以在分区时,我们应该考虑将访问频率高的,对系统性能影响相对较大的分区置于磁盘的靠外部分。最好的方案从外到内应该是:
/boot->swap->/home->/var->/tmp->/srv->/opt->/usr->/usr/local->/
当然,也完全没必要死守这个规则而对硬盘进行大规模的修改,可以根据目前已有的分区进行调整。
另外要说的是,分完以上的区后,千万别把所有空间都用上,应该留下几个空的分区作为备份用,比如本人的硬盘最后的分区是一个高达30g的备份分区,上面储存了我上网下载的各种文件,自己作的某些东西,而且除了这个分区以外,我还有一个10g大的分区,并没有储存任何东西,仅仅是为了整理磁盘碎片用。

第二部分 有多张硬盘的电脑安装linux

这里我们主要采取的方法就是RAID。
首先最好的情况下是使用硬件RAID,性能最强,而且也没有任何复杂的部分,只要在主板的bios上设置好了,那么一切ok。
在不得已而求其次的状况下,我们使用软件RAID,那么我们最好有两个或者更多一样大的硬盘分区,硬盘的转速、缓存等性能也最好相同,这样的话,我们就可以得到软件RAID的最佳性能。
具体的方法,这里只介绍安装时的部分,在硬盘分区的时候划分两个或多个一样大的分区,文件格式选择为RAID。然后选择软件RAID设置,创建MD设备,然后在创建好的MD设备上进行新的分区,原则同第一部分。
当然在现实中,很可能我们的硬件并没有提供我们可以施展RAID的环境,这个时候我们还有最后的方法,就是swap这个分区,我们知道虚拟内存是很重要的,因此我们可以在两块硬盘上分别划出swap区,然后使用让他们优先级相同的技巧增强系统性能。
在/etc/fstab这个文件中,写有swap分区的那一行,options的部分这样写:
代码:
sw,pri=5

这样可以使两个swap同时运行,对系统性能应当有所补益。

第三部分 对于IDE硬盘的安装后优化

这里主要谈谈谈关于hdparm的使用,hdparm的某些功能可以通过编译内核来完成,在论坛上jaquar00是这样说的,当然我觉得使用这个软件更加方便,具体的使用方法如下:
首先进行测试:
代码:
sudo hdparm -tT 设备(一般是/dev/hda如果有两块硬盘第二块就是/dev/hdab)

然后进行设置:
代码:

sudo hdparm [-icdmXTt]
-i 这个参数 提供一些信息是由系统的驱动程序判断出硬盘的性能而得出的
它不一定准确,但是能为我们提供一点帮助。
-c 设定 32-bit 存取模式。这个 32-bit 存取模式指的是在硬件于pc界面 之间的传输模式,而影碟本是依照 16-bit 在运转
-d 设定是否启用DMA模式 -d1 启动 -d0 关闭
-m 设定同步读取多个 sector 的模式。一般来说,设定此模式,可降低因为 读取磁碟而损失的效能,16/32为最佳化,具体数字请根据 -i 得出的 信息中MaxMultSect来设定。
-X 设定 UtraDMA 的模式。一般来说,UDMA 的模式值加64就可以了。但是现 在的电脑普遍性能强劲,在这里请参考自己的电脑配置。
33 MHz DMA mode 0~2 (X64~X66)
66 MHz DMA mode 3~4 (X67~X68)
100 MHz DMA mode 5 (X69)
如果你的硬盘上面显示的UATA 100以上的,那么 X69 也许不错
-T 测试暂存区的存取效能。
-t 测试影碟实际的存取效能。

看清以上参数后,设置的具体方法我用例子说明,在我的电脑上我是这样作的:
代码:
sudo hdparm -X69 -d1 -u1 -m16 -c3 /dev/hda

完成后,再次测试。最后如果效果有所提升,那么就使用一下命令进行保存:
代码:
sudo hdparm -k1 设备

论坛上的jaquar00朋友,帮我补充了用
代码:
lspci -v | grep ‘IDE’

这条命令查询你的硬盘支持那种方式,但是非常奇怪,该命令在我的电脑上什么都看不出来,全是unknow,不过也许对其他朋友能有所帮助。

第四部分 对于磁盘碎片的处理方法
关于磁盘碎片的问题,我已经查找了很多资料,可以确定的是,linux的文件系统非常优秀,碎片化问题很小,而且linux内核本身具备了相应的预防措施,即空间足够大的情况下,对已有文件块不再进行写操作等,这使linux产生了越用越整齐的说法,但是无法得知这样的说法究竟是否属实,所以我这里介绍另外一种比较麻烦的方法,即格式化重写法。
在使用这样的方法时,必须要有一个空间足够容纳要整理的硬盘的文件的空闲分区,
在需要格式化的时候,将所有要整理硬盘的文件移到这个分区,然后将原有硬盘格式化,再把所有文件移回去,这种方法看似疯狂,但是连续的写可以避免磁盘碎片,也许某天一些朋友会考虑使用这种方法。

第五部分 对于不同处理器的优化
intel处理器请使用i686内核
代码:
sudo apt-get install linux-i686

amd处理器请使用k7内核
代码:
sudo apt-get install linux-k7

第六部分 对于笔记本、台式机等非服务器的系统服务优化
linux的各大发行版,都有些不必要的服务被默认开启了,针对ubuntu,我们可以采用选择性关闭的方法加速起动,提高系统性能。
这里我们安装一个软件:
代码:
sudo apt-get install sysv-rc-conf

然后这样起动:
代码:
sudo sysv-rc-conf

在这个软件里,可以用键盘的方向键移动,用空格选取,也可以直接用鼠标选取,最后用q保存退出,一下列出服务的名称和基本的解释。
代码:

acpi-support 这个是关于电源支持的默认是1,2,3,4,5下启动,我认为你可以把它调整到s级别。
acpid acpi的守护程序,默认是2-5开启,我认为可以不用管。
alsa alsa声音子系统,应该不用开启它。
alsa-utils 这个服务似乎取代了alsa,所以开启这个就可以了,我在S级别开启它。
anacron 这是一个用于执行到时间没有执行的程序的服务,我认为它无所谓,所以关了它,这个可以随便。
apmd 也是一种电源管理,我认为电脑如果不是很老,它就没有开启的必要了。
atd 和anacron类似,我把它关了。
bluez-utiles 传说中的蓝牙服务,然后遗憾我没有,所以关了。
bootlogd 似乎使用来写log的,安全期间开着他也许比较好。
cron 指定时间运行程序的服务,所以开着比较好的。
cupsys 打印机服务,所以如果你有,就开启吧。
dbus 消息总线系统,非常重要,一定要开。
dns-clean 拨号连接用的,如果不用,就关了它。
evms 企业卷管理系统,由于我并不明白什么叫做企业卷,所以我关了它。
fetchmail 用于邮件守护,我关了它。
gdm gnome桌面管理器,我关了它,然后用startx启动gnome。
halt 关机用的,不要更改
hdparm 这个我刚才有讲,如果没有ide硬盘也就不用开启它了。
hotkey-setup 这个是给某些品牌笔记本设计的热键映射,台式机用户请关了它
hotplug 这个是用于热插拔的,我已经测试过了,在某些电脑上关闭它会使声卡无效,请在S级别开启它。
hplip hp打印机专用的,应该可以关了它。
ifrename 网络接口重命名,好像没用,关了。
ifupdown 这个使用来打开网络的,开着它。
ifupdown-clean 同上。
klogd linux守护程序,接受来自内核和发送信息到syslogd的记录,并记录为一个文件,所以请开着它。
linux-restricted-modules-common 这个使用来使用受限制的模块的,你可以从/lib/linux-restricted-modules下查看,如果没有什么,你可以关掉它。
lvm 逻辑卷管理器,如果你没有请关了它。
makedev 用来创建设备到/dev/请不要动他。
mdamd 管理raid用,如果你没有请关闭它。
module-init-tools 从/etc/modules 加在扩展模块的,这个一般开着。
networking 增加网络接口和配置dns用,将它开启。
ntp-server 与ubuntu时间服务器进行同步的,关了。
pcmcia 激活pcmica设备,遗憾我有生以来都没有见过这样的设备,关了它。
powernowd 用于管理cpu的客户端程序,如果有变频功能,比如amd的quite’ cool 那么就开启它吧。
ppp 拨号用的,我关了它。
ppp-dns 一样,也关了。
readahead 预加载服务,让我想起了win的预读,当然他们不同,它会使启动变慢3-4妙,所以我关了它。
reboot 重启用的,不要动。
rmnologin 如果发现nologin,就去除它,在笔记本上不用开启。
rsync rsync协议守护,请视情况而定。
screen-cleanup 一个清除开机屏幕的脚本,随便。
sendsigs 重启和关机时向所有进程发送消息。所以不要管它。
single 激活但用户模式,不用管它。
stop-bootlogd 从2,3,4,5级别停止bootlogd,不用管它。
sudo 这个不用说吧,不用管它。
sysklogd 用于记录系统日志信息,不用管它。
udev 用户空间dev文件系统,不用管它。
udev-mab 同上。
umountfs 用来卸载文件卷的,不用管它。
urandom 生成随即数的,不知道怎么用,不用管它。
usplash 那个漂亮的启动画面,但是我关了它,它也存在,所以想关他需要把内核起动参数中的splash一句删掉。
vbesave 显卡bios配置工具,不用管它。
xorg-common 设置x服务ice socket。不用管它。

第七部分 对于桌面环境的优化
在上次的文章中,我把gnome叫做wm,这显然是一个错误,谢谢jaquar00的提醒,那么这次我称它为桌面环境,它是影响性能的大户,某些朋友的电脑不够强劲,也许需要对它作出调整。
首先推荐使用轻量级的桌面环境xfce4,或者一些wm,比如fvwm、iceWM。关于这三个软件的使用论坛其他桌面版面有置顶贴详细说明请参考:
xfce4:http://forum.ubuntu.org.cn/viewtopic.php?t=1160
fvmw: http://forum.ubuntu.org.cn/viewtopic.php?t=1662
iceWM:http://forum.ubuntu.org.cn/viewtopic.php?t=1159
然后对于想使用gnome,而对美化要求比较低的朋友,我又一些建议:
1 不使用屏幕保护程序
无论有没有使用,屏幕保护程序都会耗费cpu资源,因为后台的计时器会一直检查系统是否空闲,并对屏幕保护程序激活的时间进行倒计时。如果要暂时离开座位,请使用锁住屏幕。
2 降低颜色设定
出于健康的目的,分辨率请达到1024*768,刷新率如果不是LCD显示器,请务必使用85Hz,而颜色如果没有太高的要求,请使用16位增强色。
3 去除墙纸
如果对美化没有任何要求,完全可以这样作。
4 清理桌面
清理桌面图表可以减少屏幕需要不断刷新的颜色。把不需要的图表删除,一些常用链接全部移动到自己创建的某个文件夹里。
5 关闭gnome的预览行为
在文件管理首选里,预览的默认行为是仅本地,如果认为没有必要请关掉它。
6 关于主题
前不久我自己编译安装了新的gtk和cairo,它非常漂亮,但同时非常慢,所以各位朋友要小心利用。

相关日志:

Ubuntu performance tweaking guide
ubuntu 系统清理(一)
ubuntu 系统清理(二)
从头开始对ubuntu进行优化 (ZT)
ubuntu 优化技巧

Popularity: 16% [?]

Tags: , , , , , , , , , ,

ubuntu 10大软件和工具

Posted 9 months, 2 weeks ago at 11:30 am. 0 comments

原文来自 Top 10 Ubuntu apps and tweaks

1.Automatix 最著名的 ubuntu 安装脚本文件。

2.Beagle 类似google desktop 的本地搜索工具。

3.Gnome Deskbar Applet 桌面工具。

4.VLC 多媒体播放器。

How to install Multimedia Player (VLC) with plug-in for Mozilla Firefox

5.firefox

6.amaroK 多媒体播放管理器

7.CheckGmail gmail 邮件提醒

8.NTFS 读写支持 HOWTO: NTFS with read/write support using ntfs-3g (easy method)

9.关掉系统报警声

rmmod pcspkr

打开

modprobe pcspkr

10. XGL/Compiz 3D操作系统,这里有段效果演示的视频。我用过几天,很玄但华而不实,而且不太好卸载。

相关资料:
Ubuntu10大应用程序和改进

Popularity: 13% [?]

Tags: , , , , , ,

linux 桌面系统加速方法

Posted 9 months, 2 weeks ago at 11:30 am. 0 comments

7 Ways to Speed Up Your Linux Desktop 提到下面这些项目

1. Use a Minimalistic Window Manager/Desktop Environment
使用小型的窗口/桌面环境,作者推荐 EnlightenmentFluxbox

2. Customizing GNOME, KDE, or Xfce
定制你的 GNOME,KDE或者 Xfce

3. Get More RAM
加内存条

4. Kill Unneeded Processes
关掉无用的进程。top -u 察看进程;killall 杀死进程

5. Remove Virtual Terminals
删除多余的虚拟终端。ubuntu 默认6个 tty(虚拟终端),用不了这么多啊。

/etc/inittab, and find these lines:

3:23:respawn:/sbin/getty 38400 tty3
4:23:respawn:/sbin/getty 38400 tty4
5:23:respawn:/sbin/getty 38400 tty5
6:23:respawn:/sbin/getty 38400 tty6

Comment them out like this:

#3:23:respawn:/sbin/getty 38400 tty3 #4:23:respawn:/sbin/getty 38400 tty4 #5:23:respawn:/sbin/getty 38400 tty5 #6:23:respawn:/sbin/getty 38400 tty6

Press Ctrl + X to quit, and press “Y” to save. If you don’t have permissions, try sudo nano /etc/inittab. I don’t know much about virtual terminals on other distros, just on Ubuntu.

6. Use “Small” Applications
使用”小型”软件。作者推荐 dillo 替代firefox;evolution 替代Thunderbird。

7, Remove Start-Up Services
关掉多余的系统服务
ubuntu Speed up boot 中文版本-> 加速Ubuntu开机过程

HOWTO run Ubuntu on low RAM computers
低配置电脑如何运行 Ubuntu
===========================

Ubuntu requires 256MB RAM to perform happily out of the box. It will run with 128MB of RAM, but with continuous swapping of memory to disk. If you have less than 256MB of RAM you can significantly improve Ubuntu performance by doing the following, in order of importance:

1) use a different window manager. Metacity (the default) is very memory intensive. Try icewm or fluxbox instead. To do that first ensure you have “universe” sources enabled and then “apt-get install fluxbox icewm”. When you next login at the login screen click the Session button and choose either icewm or fluxbox as your default window manager.

2) remove unnecessary services. By default Ubuntu loads quite a number of services, assuming you will be using it like a server. I would hesitate to guess that 90% of Ubuntu users would rarely, if ever use such services. They all consume RAM. The easiest way to do this is to install “Boot-up Manager”: “apt-get install bum”. The run “bum” and unclick the following services: rsync, atd, apmd, acpi-support, dbus-1, mdadm, fetchmail, postfix - but first read what these services do and decide if you really need them. They can be rebooted if removing them break anything on your system. Others listed can also be removed in some circumstances. You will need to do a bit of research beforehand.

3) use low-RAM-requirement applications. Here are some suggestions:
browser: dillo or opera or lynx
email: sylpheed or mutt or pine
word processing: abiword
newsgroups: pan or slrn
file manager: mc
editor: vim
terminal: aterm or rxvt
pdf reader: xpdf
programming IDE: motor

4) remove gdm (the Gnome display manager) using bum. This consumes significant RAM. Before doing this choose the window manager you are happy with, make it your default and then next time you boot up you will login in a text mode terminal and then type “startx”.

5) remove unnecessary virtual terminals. By default Ubuntu provides you with 6 virtual terminals. These are the login terminals you can get to by typing Ctrl-Alt-F2, Ctrl-Alt-F3 etc. Normally you only need one spare terminal in case of emergencies. To disable the others and free up even more RAM “gedit /etc/inittab” and comment out the lines below as shown:

#3:23:respawn:/sbin/getty 38400 tty3
#4:23:respawn:/sbin/getty 38400 tty4
#5:23:respawn:/sbin/getty 38400 tty5
#6:23:respawn:/sbin/getty 38400 tty6

6) be continuously aware of all running processes and the RAM that your applications are consuming. You can see the processes with “ps aux”. Check out the RSS column which is the total memory consumed by a process. You can also check your memory situation with “free”. The important value is the second row number under the free column. This is the total available free memory including memory which has cached applications.

7) free up video RAM (especially for those using onboard video chips which share memory). Edit the etc/X11/xorg.conf file and comment out the following lines:
# Load “record”
# Load “dbe”
# Load “dri”
# Load “glx”
# Load “xtrap”
# Load “type1″

The most important module you’re not loading is dri which is for graphics acceleration. You will need to test this; it might not work with all graphics cards and will break graphics intense apps.
8) if you have 128MB of RAM or less Ubuntu is the wrong Linux distro for you (IMHO). I can highly recommend VectorLinux (http://www.vectorlinux.com). This is an incredibly fast Linux distro which can run with 64MB of RAM - and using the tweaks above can be made to run with just 32MB of RAM!

via HOWTO run Ubuntu on low RAM computers

Popularity: 15% [?]

Tags: , , , , , , , , , , ,

ubuntu 优化技巧

Posted 9 months, 2 weeks ago at 11:30 am. 0 comments

Use InitNG as a replacement for standard Init.
使用 InitNG(启动提速软件)替代标准启动模式。传统的sysvinit启动模式最大问题是硬件初始化时逐一检测(probe),一个成功後才往下一个检测,浪费时间。InitNG的模式就是将要硬件初始化并行进行,从而达到加快启动的目标。目前没源,只有 .deb 文件。

安装后修改 grub 启动菜单,大致为

title linux-initng
kernel (hd0,1)/vmlinuz root=/dev/hda6 init=/sbin/initng

Speed up Firefox
firefox 加速

Custom compile a new kernel. You can also use this tutorial.
定制自己的linux 内核,参考 How To Compile the new 2.6.16 kernel from kernel.org

Make sure DMA is enabled.
确认 DMA 打开,参考此文

附 DMA 资料

以下为引用内容:

DMA为Direct Memory Access的缩写,中文一般翻译成「直接存取存储器」。一般的IDE装置(例如硬盘)的存取通常是透过CPU来协调控制存取,所以会占用CPU不少的资源,而DMA则是让IDE装置可以直接存取存储器,不需再去耗用CPU的资源,使CPU有更多的资源来处理其他的工作。

Use Prelink to make applications start faster.
用 Prelink 使应用程序打开 更快

Pick the kernel that’s right for your processor.
选择适合你CPU的内核

Disable uneeded services from starting.
关闭不需要的服务

Use Swiftfox, a faster Firefox for Intel and AMD processors.
用 Swiftfox 替代 firefox

Tweak your ext3/reisers filesystem for enhanced performance.
调整 ext3 文件系统性能

Clean up unnecessary files
删除不需要的文件

Install preload “sudo apt-get install preload.”
安装 preload 预加载

Use the latest drivers for your video card.
使用最新的声卡驱动

Use XFCE as your Desktop Enviroment.
使用 XFCE 桌面环境(比GNOME,KDE省资源)

Use Abiword instead of Open Office
使用 Abiword 替代 Open Office

via http://ubuntuforums.org/showthread.php?t=189192

相关日志:

Ubuntu performance tweaking guide
从头开始对ubuntu进行优化 (ZT)

Popularity: 13% [?]

Tags: , , , , , , , , , ,

ubuntu 技巧

Posted 9 months, 2 weeks ago at 11:30 am. 0 comments

原文来自Prepping Ubuntu for Everyday Use

部分摘翻如下:

Installation won’t work on my computer!
安装有问题?

These tips are useless if you can’t even install Ubuntu. This release of Ubuntu comes with a fancy but brilliant new graphical installer that makes life easier for everyone. This seems to work fine for most people but there are almost certainly going to be incompatibilities for a minority. If you find it just won’t work, switch back to the old text-mode installer. To do this, you’ll have to download a different ISO image and burn it to CD-ROM. Visit http://releases.ubuntu.com/6.06/ and download the Alternate Install CD. Then boot from it and install.
Dapper LTS是图形化安装界面,如果有问题,你可以下载 Alternate Install 光盘,那个是文字模式。

Setting up multiverse and universe repositories
打开 multiverse 和 universe源

Ubuntu has two fantastic software repositories available to it by default—Main (aka Officially Supported) and Restricted (aka Restricted Copyright). The former contains software that’s licensed under the GPL (or a compatible) license. The latter contains a small selection of software under prohibitive (usually proprietary) licenses that some Ubuntu users need. Examples include some wifi drivers.
There are two more “official” repositories, however—Universe (aka Community Maintained) and Multiverse (aka non-free). The former contains a ton of software from the Debian archives and the latter is yet more software that’s available under licenses not 100% compatible with the GPL (although that doesn’t necessarily mean it’s proprietary).
Universe and Multiverse aren’t setup by default, and it’s a good idea for you to add them because it gives you the broadest choice of software.
Open Synaptic Package Manager (System -> Administration -> Synaptic Package Manager) and then click Settings -> Repositories within Synaptic. Look for the heading that reads Ubuntu 6.06 LTS (Binary); it should be the first in the list. Select it and click Edit. Then ensure there’s a check in the Community Maintained and Non-Free boxes. Click OK, then Close, and then click the Reload button the main Synaptic program window. You should now have access to the extra repositories.
可以获得更多非免费或者有专利软件的下载

多媒体回放需要下面几个解码器

w32codecs
mplayer
mozilla-mplayer
libdvdcss2

当然,前提是源里有,要么自己单独下载。

安装Nvidia 显卡驱动

Open Synaptic and search for and install nvidia-glx. When installation has finished, open a shell window and type sudo nvidia-xconfig. Then reboot.
Test your new 3D configuration, after reboot, by selecting one of the OpenGL screensavers (System -> Preferences -> Screensavers). AntSpotlight is pretty cool. If it runs smoothly then everything has worked.

从新立得安装 nvidia-glx,打开一个终端, sudo nvidia-xconfig,配置并重启。用系统-首选项-屏幕保护中的 AntSpotlight(openGL)来测试。如果动画流畅,证明显卡驱动OK。

Setup a Windows partition for permanent access
设置windows分区可访问

My Windows XP partition wasn’t automatically made available under Ubuntu. The solution was the following: type sudo mkdir /windows at the command prompt. Type sudo fdisk -l and look for the line that ends HPFS/NTFS, and then look at the beginning of the line and write down what’s there (ie /dev/hda1). Then load the following file in a text editor using sudo: /etc/fstab. Add a new line at the end of the file that reads:

/dev/hda1 /windows ntfs nls=utf8,umask=0222 0 0

Replace the /dev/hda1 part with what you wrote down earlier. Save the file and then type sudo mount /windows to make your Windows partition available immediately (browse to /windows to see the contents). You’ll find it available all the time, even after you reboot. Remember: the Windows NTFS partition is read only. You can’t write files there.
sudo mkdir /windows
新建一个windows目录

sudo fdisk -l
查找以 HTFS/NTFS 结尾的行,察看前面的 /dev/hdan
a块硬盘
n个分区

sudo gedit /etc/fstab
编辑 fstab 文件,修改为类似下面的形式

/dev/hdan /windows ntfs nls=utf8,umask=0222 0 0

sudo mount /windows
手工挂接

Add Windows fonts
加入Windows字体

My notebook dual-boots between Linux and Windows and I like to add all my Windows fonts to my Ubuntu setup, so that certain web pages look like they should and also so Word docs from colleagues read OK.
To install the fonts, follow the step above to make your Windows partition available if it isn’t already. Type the following at the command prompt to open the Windows font directory in Nautilus: nautilus /windows/WINDOWS/Fonts/ (this assumes that your Windows partition is mounted in /windows, as described in the tip above). Click View -> View As List, and then click the Type heading so that the files are arranged via file extension. Scroll down to the TTF files and select all of them (click the first, hold down Shift and then click the last). Then right-click one of the selected files and click Copy, so that they’re copied ready for pasting somewhere else. Click Go -> Location and, in the box, type fonts://. In the new file listing that appears, right-click a blank spot and select Paste. Your Windows fonts should now be available to all Ubuntu applications, including OpenOffice.org.
嗯!不错!这样也可以….

Use one, rather than two, desktop panels
使用一个而不是两个(上下)面板(我一直就是这么做地…)

For some reason Ubuntu likes you to have two screen-hogging panels—one at the top of the screen, and one at the bottom. Some people like this, some hate it.
To quickly combine them into one panel at the bottom (that’s “quickly” as in “quick and dirty”), right-click a blank spot on the top panel and select Add To Panel. In the dialog box that appears, look under the Desktop & Windows heading and select Window List. Then click the Add button and then close. Click and drag the Window List handle to move it closer to the quick-launch icons. Then delete the bottom panel by right-clicking in a blank spot on it, and selecting Delete Panel. Then, to shift the top panel to the bottom of the screen, click and hold in a blank spot and simply drag it to the bottom.

Fine-tune Ubuntu’s font display/rendering
调整字体显示效果

I’m a stickler when it comes font rendering and have to tweak, tweak, tweak until I’m happy. Ubuntu has two possible font-rendering modes: using bytecode hinting, which it refers to as “Native” rendering, and using auto-hinting. In addition, you can turn sub-pixel rendering on and off. I think turning it off makes the fonts look cleaner.
To configure all of this, open a command-prompt and type sudo dpkg-reconfigire fontconfig. Then work through the options. Don’t forget that you’ll need to restart the X server to see the results (Ctrl+Alt+Backspace)

Popularity: 20% [?]

Tags: , , , , , , , , , , , , , , , ,

ad 468x60