Accelerate your Ubuntu to reduce CPU usage

Source: Internet
Author: User
The method comes from FeistyPerformance-"FlyLikeAButterfly" in this article. The author summarizes many methods for 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. Disabling IPv6 is not yet available

The method comes from Feisty Performance-"Fly Like A Butterfly" (Chinese translation) in this article. The author summarizes many methods for 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, you 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. However, this library may cause some programs such as Firefox to occupy too much 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

Reducing frequent swap writes will 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 an option called profile, which is an index of all the files to be read when the system starts. This speeds up system searching and reading these files.

Press esc when the grub screen is started, find the kernel to be started, press e, edit the startup parameters, add the profile, 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 it is disabled, the display speed of firefox is obviously faster, but the display format has also changed, suchThe black text of the webpage title can be reflected now, but it also feels that the font rendering is slightly "Blurred.

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. Note that prelink is useless since Feisty 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.

Now we should be using Release versions later than 6.10Edgy. For 486 machines, please use 386 kernel; for machines later than P4, including AMD for the same period, please use the generic kernel; select the linux-server kernel for the server, which will improve the performance slightly, maybe. Refer to Difference between 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.