Accelerating Ubuntu to reduce CPU usage

Source: Internet
Author: User
Tags high cpu usage
From this article feisty performance-"fly like a butterfly "(
(Chinese translation), the author summarizes a lot of questions about optimizing and accelerating feisty.
. Follow the methods below to check whether there is any practical effect. You have to try it. At least after I use it, I find that the startup speed has greatly improved.
Note: If the following steps are modified incorrectly, the system may fail to be started, so be careful.
1. Disable Ipv6
IPv6 is not yet available yet. The advanced Ubuntu feature can be blocked for the moment to speed up.
Edit sudo gedit/etc/modprobe. d/aliases and set:
Alias net-pf-10 IPv6
Change
Alias net-pf-10 off # IPv6
2. Run the boot script in parallel
/Etc/init. d/
The following are all startup scripts. By default, these scripts are started in order. In fact, if you are using
SATA or SCSI interfaces can start these script programs in parallel to accelerate the startup process.
Run the following command to edit sudo VI/etc/init. d/RC:
Concurrency = none
Change
Concurrency = Shell
3. Use localhost as the host name.
It is said that this method can improve the problem of slow startup of applications in GNOME after using ubuntu.
Edit sudo gedit/etc/hosts and set:
127.0.0.1 localhost
127.0.1.1 Ubuntu
Add the host name at the end of the first line, that is, the name of the second line.
127.0.0.1 localhost Ubuntu
127.0.1.1 Ubuntu
4. Disable pango
Pango is a library that focuses on internationalization and is used for output and text rendering, but this library may cause
Some programs such as Firefox occupy too high
CPU, so we can disable it. This can reduce the CPU usage.
Edit sudo gedit/etc/environment and add:
Pai_disable_pango = "1"
5. Disable Gettys.
Open sudo gedit/etc/event. d/tty3 and comment out all rows starting with start.
6. Install Preload
You can pre-load some commonly used lib libraries and applications to the memory to increase the startup speed of the program.
Sudo apt-Get install Preload
7. Set swappiness
Reduce System for swap
Frequent writes speed up switching between applications and improve system performance.
The default value is 60. You can change it to 10:
Sudo sysctl VM. swappiness = 10
If you want it to be automatically set upon startup, edit the sudo gedit/etc/sysctl. conf file and add:
VM. swappiness = 10
8. Use the profile option of grub
Grub has a profile
It is an index of all the files to be read when the system starts, so that the system can find and read these files more quickly.
Press ESC when the grub screen is started, find the kernel to be started, and press E
Key, edit the startup parameter, add profile to the end, and then press B
. After setting, you need to create an index for the first boot, so the boot speed will be slower. This is required for each kernel update in the future.
9. Use sysv-RC-conf to disable unnecessary services.
For details, refer to here.
######################################## ##### 3
Change localhost to the Host Name, edit the hosts file, and write 127.0.0.1 to the same line as localhost and local name, for example:
127.0.0.1 localhost
127.0.1.1 fwolf_pcname
==> Change
127.0.0.1 localhost fwolf_pcname
Disable Ipv6 and edit/etc/modprobe. d/aliases:
Alias net-pf-10 IPv6
==>
Alias net-pf-10 off # IPv6
Run the boot script in parallel and edit/etc/init. d/RC:
Concurrency = none
==>
Concurrency = Shell
However, it is said that this method may cause startup problems and should be used with caution. We recommend that you use the multi-core CPU.
Disable pango output and text rendering, mainly for Mozilla and Firefox, which may cause high CPU usage. Edit/etc/environment and add a row:
Pai_disable_pango = "1"
After the feature is disabled, the display speed of Firefox becomes faster, but the display format has also changed. For example, <TH> and the blacklist of the webpage title can now be reflected, but I also feel that the font rendering is slightly "fuzzy.
Install preload, which can pre-load some frequently used library files to the memory, and use part of the memory space in exchange for application startup speed improvement. Also note that prelink from feisty
It's useless since 7.04:
Sudo apt-Get install Preload
Disable redundant virtual terminals, edit/etc/inittab, and leave only one Getty part:
1: 2345: respawn:/sbin/Getty 38400 tty1
#2: 23: respawn:/sbin/Getty 38400 tty2
#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
CTRL + ALT + F2-F6 there is nothing, F1 is our reserved terminal, for emergency treatment, F7 is a normal graphical environment.
Note: In some cases, it may not work. You need to edit/etc/event. d/tty2: comment out the two lines starting with start. 3456 is processed as the same method and only 1 is retained. Then, the hot key is switched to an empty prompt.
Adjust the hdparm hard drive and edit/etc/hdparm. conf as follows:
/Dev/SDA {
DMA = on
Io32_support = 1
Mult_sect_io = 32
}
To reduce swap usage for machines with sufficient memory, edit/etc/sysctl. conf and add:
VM. swappiness = 10
The default value of this value is 60. The smaller the value, the smaller the number of swap writes. Some netizens say that it is best to adjust 1 GB memory to 5. We recommend that you adjust this value at least MB of memory, if it is set to 0, it is almost no practical swap.
LVM is used, but no further information is provided.
Use bootchart to optimize the system startup process and time-consuming processes.
Use bum to shut down unwanted services. We recommend that you do not use sysv-RC-conf because bum provides detailed explanations for services and processes.
If an external disk is attached to the fstab instance, you can set pass to 0 (the last column in fstab ). If you select a more reasonable Partition Scheme and partition type (such as XFS) when installing the system, the effect is better.
6.10 should be used now
Edgy is released later. If it is 486 machines, use the 386 kernel. If it is later than P4 machines, including AMD for the same period, use the generic kernel. If the server is Linux-
Server kernel, there will be a little performance improvement, maybe. See difference
Linux-generic, linux-386.
Use deborphan to delete unnecessary library files:
Sudo deborphan | xargs sudo apt-get-y remove -- purge

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.