Linux Basic Optimization Guide

Source: Internet
Author: User
Tags aliases

When someone sees this headline, they must be whispering, "does Linux need to be optimized?". Before answering this question, let me ask you a question, "What is optimization?" ", my philosophy is that there is no optimal, suitable for their own is better, the desktop background to the color of their favorite, is not calculated optimization?

I don't think I need to answer either of the above questions, but if you're interested, you can go ahead and watch.

Here to say the optimization, mainly refers to the performance. Optimization is done for your own hardware and for your own needs, so there is no optimization method for everyone. Take my machine for example, combined with Ubuntu to tell.

Faster start-up speed

If you often use a large number of peripherals, such as infrared, Bluetooth, printers, scanners, and so on, this section can be skipped, because this will remove these things in the boot system when the load, to improve the boot speed.

Ubuntu, like most other distributions, will load a lot of things you don't need, HP printers, Lvm,raid, and even blind users when booting. These things can generally be removed, even if you occasionally
Need to be used, can be started manually, does not affect your use, this is similar to the Windows Self-launcher program, the number of Ubuntu self-launcher is amazing.

Although it is possible to control everything directly through the command line, it is not intuitive or safe for beginners, so use 3rd-party tools, but be assured that the tool is free.

Install this tool, and run:

sudo apt-get install sysv-rc-conf
sudo sysv-rc-conf


What is needed and what is not needed can be searched by Google, and here are some examples that most people can consider removing.

EVMS,CRON,ANACRON,APMD,ATD,MDAMD,LVM If you don't know what it is, you can safely remove it.
Bluez-utiles bluetooth, if you want to use every time, then keep it anyway.
BOOTLOGD If you have a hobby of viewing logs, keep it.
Cupsys If you use a printer, keep it.
Dns-clean if it's dial-up internet, keep it.
Fetchmail If you don't know what you're doing, you can get rid of it.
Hdparm if it's a SATA hard drive, remove it.
Hotkey-setup only notebook may need, you can try to remove, have side effect to change back
HotPlug Most people can get rid of, some hardware may need, such as a rare variety of sound card
Hplip you have an HP printer, keep it.
It's no harm to klogd.
Networking in the Jiaotong University dormitory can safely remove
Ntp-server time synchronization, generally can be removed
PCMCIA Legendary device I've never seen it, so I've removed it.
Powernowd if the CPU supports frequency conversion, you can save power and remove it.
PPP Dial-up access is switched off.
Ppp-dns Ibid.
ReadAhead off.
Rmnologin Remove
rsync If you don't know what to do, remove it.
Screen-cleanup Remove
STOP-BOOTLOGD Remove
SYSKLOGD, you can do whatever you're getting rid of.
It's no harm to urandom.
USplash The Yellow splash screen, get rid of it.
BitTorrent remove
The rest of the service, you may wish to ponder

Running the boot script in parallel

/etc/init.d/The following are startup scripts, which are started sequentially by default, and in fact, if you are using a SATA or SCSI interface, you can start these scripts in parallel to speed up the boot process.

Using VI to edit sudo vi/etc/init.d/rc, put:

Concurrency=none
Revision changed to
Concurrency=shell

Disable IPV6

At present, IPV6 has not come, Ubuntu this advanced function can temporarily block out, in order to speed up.

Edit sudo vim/etc/modprobe.d/aliases, put:

Alias Net-pf-10 IPv6
Revision changed to
Alias net-pf-10 off #ipv6

But did not find/etc/modprobe.d/aliases file, have said with grub settings. can also only close the Firefox IPv6, we want only the speed of the page, do not have to disable the global _

Open Firefox, enter about:config in the Address bar, return
Enter NETWORK.DNS.DISABLEIPV6 in the search field (just enter V6 to search, and the variable is the string on the left).
Change the value of this variable from false to True

Alias localhost as host name

It is said that this method can improve the use of Ubuntu after a period of time to start the application in GNOME slow problem.

Edit sudo gedit/etc/hosts, put:

127.0.0.1 localhost
127.0.1.1 Ubuntu
Add the hostname to the end of the first line, which is the name of the second row.
127.0.0.1 localhost Ubuntu
127.0.1.1 Ubuntu

Disable Pango

Pango is a library that focuses on internationalization for output and text rendering, but this library may cause some programs such as Firefox to take up too much CPU, so we can disable it. This can be a good way to reduce the CPU utilization.

Edit sudo gedit/etc/environment, add:

moz_disable_pango= "1"

Disable Gettys

Open sudo gedit/etc/event.d/tty3 and comment out all lines starting with start with #.

installing preload

Some commonly used LIB libraries and applications can be preloaded into memory to increase program startup speed.

sudo apt-get install preload

Set swappiness

Reducing the system's frequent write to swap will speed up switching between applications and help improve system performance.

The system defaults to 60 and you can modify it to 10:

sudo sysctl vm.swappiness=10

If you want it to boot automatically, edit the sudo gedit/etc/sysctl.conf file to add:

vm.swappiness=10

Linux Basic Optimization Guide

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.