Practical Tips: Linux OS Optimization Methods

Source: Internet
Author: User

How can we optimize your system? The following is a simple and small method, but the optimization and adjustment of a system is far more than that. The performance needs to be adjusted according to actual needs. There is no way to meet all system requirements.

1. Check your gcc version:Note that your gcc version must be later than 3.0.

# Gcc -- version

2. obtain your cpu model:

Cat/proc/cpuinfo

3. Create the make. conf file under/etc/and write different contents according to the cpu model.

◆ I386 (Intel ):

CHOST = \ "i386-pc-linux-gnu \"

CFLAGS = \ "-march = i386-O3-pipe-fomit-frame-pointer \"

CXXFLAGS = \ "-march = i386-O3-pipe-fomit-frame-pointer \"

Isung (Intel ):

CHOST = \ "i486-pc-linux-gnu \"

CFLAGS = \ "-march = isung-O3-pipe-fomit-frame-pointer \"

CXXFLAGS = \ "-march = isung-O3-pipe-fomit-frame-pointer \"

Pentium 1 (Intel)

CHOST = \ "i586-pc-linux-gnu \"

CFLAGS = \ "-march = pentium-O3-pipe-fomit-frame-pointer \"

CXXFLAGS = \ "-march = pentium-O3-pipe-fomit-frame-pointer \"

Pentium MMX (Intel)

CHOST = \ "i586-pc-linux-gnu \"

CFLAGS = \ "-march = pentium-mmx-O3-pipe-fomit-frame-pointer \"

CXXFLAGS = \ "-march = pentium-mmx-O3-pipe-fomit-frame-pointer \"

Pentium PRO (Intel)

CHOST = \ "i686-pc-linux-gnu \"

CFLAGS = \ "-march = pentiumpro-O3-pipe-fomit-frame-pointer \"

CXXFLAGS = \ "-march = pentiumpro-O3-pipe-fomit-frame-pointer \"

Pentium II (Intel)

CHOST = \ "i686-pc-linux-gnu \"

CFLAGS = \ "-march = pentium2-O3-pipe-fomit-frame-pointer \"

CXXFLAGS = \ "-march = pentium2-O3-pipe-fomit-frame-pointer \"

Celon (Mendocino), aka Celeron1 (Intel)

CHOST = \ "i686-pc-linux-gnu \"

CFLAGS = \ "-march = pentium2-O3-pipe-fomit-frame-pointer \"

CXXFLAGS = \ "-march = pentium2-O3-pipe-fomit-frame-pointer \"

Pentium III (Intel)

CHOST = \ "i686-pc-linux-gnu \"

CFLAGS = \ "-march = pentium3-O3-pipe-fomit-frame-pointer \"

CXXFLAGS = \ "-march = pentium3-O3-pipe-fomit-frame-pointer \"

Celon (Coppermine) aka Celeron2 (Intel)

CHOST = \ "i686-pc-linux-gnu \"

CFLAGS = \ "-march = pentium3-O3-pipe-fomit-frame-pointer \"

CXXFLAGS = \ "-march = pentium3-O3-pipe-fomit-frame-pointer \"

Celon (Willamette ?) (Intel)

CHOST = \ "i686-pc-linux-gnu \"

CFLAGS = \ "-march = pentium4-O3-pipe-fomit-frame-pointer \"

CXXFLAGS = \ "-march = pentium4-O3-pipe-fomit-frame-pointer \"

Pentium 4 (Intel)

CHOST = \ "i686-pc-linux-gnu \"

CFLAGS = \ "-march = pentium4-O3-pipe-fomit-frame-pointer \"

CXXFLAGS = \ "-march = pentium4-O3-pipe-fomit-frame-pointer \"

Eden C3/Ezra ()

CHOST = \ "i586-pc-linux-gnu \"

CFLAGS = \ "-march = i586-m3dnow-O3-pipe-fomit-frame-pointer \"

CXXFLAGS = \ "-march = i586-m3dnow-O3-pipe-fomit-frame-pointer \"

K6 (AMD)

CHOST = \ "i586-pc-linux-gnu \"

CFLAGS = \ "-march = k6-O3-pipe-fomit-frame-pointer \"

CXXFLAGS = \ "-march = k6-O3-pipe-fomit-frame-pointer \"

AMD (K6-2)

CHOST = \ "i586-pc-linux-gnu \"

CFLAGS = \ "-march = k6-2-O3-pipe-fomit-frame-pointer \"

CXXFLAGS = \ "-march = k6-2-O3-pipe-fomit-frame-pointer \"

AMD (K6-3)

CHOST = \ "i586-pc-linux-gnu \"

CFLAGS = \ "-march = k6-3-O3-pipe-fomit-frame-pointer \"

CXXFLAGS = \ "-march = k6-3-O3-pipe-fomit-frame-pointer \"

Athlon (AMD)

CHOST = \ "i686-pc-linux-gnu \"

CFLAGS = \ "-march = athlon-O3-pipe-fomit-frame-pointer \"

CXXFLAGS = \ "-march = athlon-O3-pipe-fomit-frame-pointer \"

Athlon-tbird, aka K7 (AMD)

CHOST = \ "i686-pc-linux-gnu \"

CFLAGS = \ "-march = athlon-tbird-O3-pipe-fomit-frame-pointer \"

CXXFLAGS = \ "-march = athlon-tbird-O3-pipe-fomit-frame-pointer \"

Athlon-tbird XP (AMD)

CHOST = \ "i686-pc-linux-gnu \"

CFLAGS = \ "-march = athlon-xp-O3-pipe-fomit-frame-pointer \"

CXXFLAGS = \ "-march = athlon-xp-O3-pipe-fomit-frame-pointer \"

Athlon 4 (AMD)

CHOST = \ "i686-pc-linux-gnu \"

CFLAGS = \ "-march = athlon-4-O3-pipe-fomit-frame-pointer \"

CXXFLAGS = \ "-march = athlon-4-O3-pipe-fomit-frame-pointer \"

Athlon XP (AMD)

CHOST = \ "i686-pc-linux-gnu \"

CFLAGS = \ "-march = athlon-xp-O3-pipe-fomit-frame-pointer \"

CXXFLAGS = \ "-march = athlon-xp-O3-pipe-fomit-frame-pointer \"

Athlon MP (AMD)

CHOST = \ "i686-pc-linux-gnu \"

CFLAGS = \ "-march = athlon-mp-O3-pipe-fomit-frame-pointer \"

CXXFLAGS = \ "-march = athlon-mp-O3-pipe-fomit-frame-pointer \"

603 (PowerPC)

CHOST = \ "powerpc-unknown-linux-gnu \"

CFLAGS = \ "-O3-pipe-fsigned-char \"

CXXFLAGS = \ "-O3-pipe-fsigned-char \"

603e (PowerPC)

CHOST = \ "powerpc-unknown-linux-gnu \"

CFLAGS = \ "-O3-pipe-fsigned-char \"

CXXFLAGS = \ "-O3-pipe-fsigned-char \"

604 (PowerPC)

CHOST = \ "powerpc-unknown-linux-gnu \"

CFLAGS = \ "-O3-pipe-fsigned-char \"

CXXFLAGS = \ "-O3-pipe-fsigned-char \"

604e (PowerPC)

CHOST = \ "powerpc-unknown-linux-gnu \"

CFLAGS = \ "-O3-pipe-fsigned-char \"

CXXFLAGS = \ "-O3-pipe-fsigned-char \"

750 aka as G3 (PowerPC)

CHOST = \ "powerpc-unknown-linux-gnu \"

CFLAGS = \ "-mcpu = 750-O3-pipe-fsigned-char-mpowerpc-gfxopt \"

CXXFLAGS = \ "-mcpu = 750-O3-pipe-fsigned-char-mpowerpc-gfxopt \"

7400, aka G4 (PowerPC)

CHOST = \ "powerpc-unknown-linux-gnu \"

CFLAGS = \ "-mcpu = 7400-O2-pipe-fsigned-char-maltivec

-Mabi = altivec-mpowerpc-gfxopt \"

CXXFLAGS = \ "-mcpu = 7400-O2-pipe-fsigned-char-maltivec

-Mabi = altivec-mpowerpc-gfxopt \"

-Fsigned-char-maltivec-mabi = altivec-mpowerpc-gfxopt \"

7450, aka G4 second generation (PowerPC)

CHOST = \ "powerpc-unknown-linux-gnu \"

CFLAGS = \ "-mcpu = 7450-O2-pipe-fsigned-char

-Maltivec-mabi = altivec-mpowerpc-gfxopt \"

CXXFLAGS = \ "-mcpu = 7450-O2-pipe-fsigned-char

-Maltivec-mabi = altivec-mpowerpc-gfxopt \"

PowerPC (If you don \'t know which one)

CHOST = \ "powerpc-unknown-linux-gnu \"

CFLAGS = \ "-O3-pipe-fsigned-char-mpowerpc-gfxopt \"

CXXFLAGS = \ "-O3-pipe-fsigned-char-mpowerpc-gfxopt \"

ISCSI

CHOST = \ "iSCSI-unknown-linux-gnu \"

CFLAGS = \ "-O3-pipe-fomit-frame-pointer \"

CXXFLAGS = \ "-O3-pipe-fomit-frame-pointer \"

64

CHOST = \ "sparc64-unknown-linux-gnu \"

CFLAGS = \ "-O3-pipe-fomit-frame-pointer \"

CXXFLAGS = \ "-O3-pipe-fomit-frame-pointer \"

After compilation, the program running efficiency will be much higher than before! As long as you have time, you can put your system such as redhat linux 9.0 source code suffix. src. rpm) re-compile all the files once, and you will find that your Redhat Linux system will be much faster than the original one!

Related Articles]

  • Notes on adjusting Kernel Parameters of FreeBSD system optimization
  • Experience in Optimizing and maintaining the heavy load Telnet BBS system
  • Disk System Optimization

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.