Supplement to FreeBSD 5 Optimization

Source: Internet
Author: User

1. Install sysinstall)

1. in distribution, select only minimal and customization. Add man. When a problem occurs, you can view the command parameters. After adding SRC, CVSup can speed up reading duplicate files.

2. In users, after adding a user, change/home/ABC in the user path to/usr/ABC. Because the/usr capacity is large. You can also increase the/home capacity, but it is troublesome.
Then, you need to change the shell to CSH for ease of use (also for the settings in Part 7 of this Article ).

Ii. Make. conf)

Note: to block a Boolean option, do not mark no or false! The whole line is deleted!

1. compiler options

Cputype = athlon-XP
# I use athlonxp 2500 +. For more information about CPU usage, see man make. conf.

Cflags + =-mfpmath = SSE-mmmx-MSSE-m3dnow-maccumulate-outgoing-ARGs
-Minline-all-stringops
##
Optimization of O2, O3, and OS is not recommended, because not all applications can work stably on O2, O3, and OS. In addition, only 7% of the additional performance can be obtained.
# The default cflags value is "-O1-pipe" and does not need to be overwritten. Therefore, + = is used.
# It is not recommended to use-f... series optimization because not all applications can work stably.

#-Mfpmath = SSE:
The pentiumiii compatible CPU can enable-mfpmath = SSE to replace the traditional i387 floating point operation to speed up. Refer to the CPU product manual to determine whether the CPU contains the SSE function.
#-Mfpmath = PNI: pentium4
Prescott compatible CPU can enable-mfpmath = PNI to replace the traditional i387 floating point operation to speed up. Refer to the CPU product manual to determine whether the CPU contains the PNI function.
#-Mmmx:
Open the MMX command to increase the code performance. Refer to the CPU product manual to determine whether the CPU contains the MMX function. Applicable to pentiummmx CPU compatibility.
#-MSSE:
Open the SSE command to increase code performance. Refer to the CPU product manual to determine whether the CPU contains the SSE function. Applicable to pentiumiii CPU compatibility.
#-Msse2:
Open the sse2 command to increase code performance. Refer to the CPU product manual to determine whether the CPU contains the sse2 function. Applicable to pentium4 CPU compatibility.
#-Mpni:
Open the PNI command to increase code performance. Refer to the CPU product manual to determine whether the CPU contains the PNI function. Applicable to pentium4
Prescott is compatible with CPU.
#-M3dnow:
Open 3 dnow! Command to increase code performance. Refer to the CPU product manual to determine whether the CPU contains 3 dnow! Function. Applicable to K6 and athlon compatible CPUs.

#-Maccumulate-outgoing-ARGs-minline-all-stringops
By reducing some actions to achieve acceleration, the author's experiment is relatively stable.

Cxxflags + =-fmemoize-lookups-fsave-memoized
# C ++ code optimization mentioned in make. conf.

2. System compilation options
Kernconf = (filename)
# Change the Kernel configuration file name (filename) to your own kernel file name.

Noinet6 = true
# Try not to use the IPv6 protocol.

Noatm = true
# Do not use ATM whenever possible. This option is only applicable to non-ADSL users.

No_sendmail = true
# Try not to use sendmail.

Nogames = true
# Do not install all games

No_i4b = true
# Do not use ISDN for BSD whenever possible.

No_ipfilter = true
# Try not to use IP Filter.

Batch = Yes
# Quiet compilation, skip all questions during compilation. Applicable to users who compile programs overnight.

3. X-window compilation options
Xfree86_version = 4
# Try to use the X-window version 4.3

With_setuid_luit = Yes
# If this item is not used, a luit error occurs when running xterm.

With_gtk2 = Yes
# Use gtk2 as the Runtime Library of the GTK application whenever possible

Use_mmx_asm = Yes
# When compiling xfree86, try to use MMX code, only applicable to pentiummmx compatible CPU.

Use_3dnow_asm = Yes
# When compiling xfree86, use the 3dnow code whenever possible. It is only applicable to K6 and athlon compatible CPUs.

Without_kde_menus = Yes
# When gnome is used, KDE programs are not added to the menu.

4. Multimedia encoding options

With_cdparanoia = Yes
With_aalib = Yes
With_esound = Yes
With_faad = Yes
With_flac = Yes
With_freetype = Yes
With_gdkpixbuf = Yes
With_gsm = Yes
With_hermes = Yes
With_jpeg = Yes
With_ladspa = Yes
With_lame = Yes
With_liba52 = Yes
With_libaudiofile = Yes
With_libcaca = Yes
With_libfame = Yes
With_libmikmod = Yes
With_libmp eg2 = Yes
With_libmusicbrainz = Yes
With_libshout = Yes
With_libsidplay = Yes
With_libsndfile = Yes
With_libtheora = Yes
With_mad = Yes
With_nas = Yes
With_pango = Yes
With_png = Yes
With_sdl = Yes
With_smoothwave = Yes
With_speex = Yes
With_swfdec = Yes
With_vorbis = Yes
With_vorbisidec = Yes
With_xine = Yes
With_xvid = Yes

# All the preceding multimedia options are only enabled when the application supports them.

4. Application compilation options
Want_huge_stack_size = Yes
# Provides a huge stack for Python code applications.

With_tpd = Yes
# Provide the link for some window managers.

Without_mailnews = Yes
# Cancel the mail news function of Mozilla to speed up compilation.

Without_composer = Yes
# Cancel the webpage editing function of Mozilla to speed up compilation.

Without_ldap = Yes
# Cancel the LDAP function of Mozilla to speed up compilation.

Without_chatzilla = Yes
# Cancel Mozilla's irc chat function to speed up compilation.

Without_xmlterm = Yes
# Cancel Mozilla's XML terminal function to speed up compilation.

# With_rtc = Yes
# Provides real-time clock support for some applications, but may cause instability of some multimedia programs.

With_glx = Yes
# Provide Glx accelerated plotting support for some applications.

With_ttf_bytecode_enabled = Yes
# Dubyte support for some applications.

With_optimized_cflags = Yes
With_optimized_cxxflags = Yes
With_optimize = Yes
# Use more advanced compilation optimization whenever possible

3. Make Kernel)

Options pq_hugecache
# CPU support for 1024k second-level cache

Options pq_largecache
# CPU support for K second-level cache

Options pq_mediumcache
# CPU support for K second-level cache

Options pq_smallcache
# CPU support for K second-level cache

Options cpu_athlon_sse_hack
Options cpu_enable_sse
# Provide SSE support for athlon series CPUs

Options cpu_susp_hlt
# Enable idle CPU and save energy.

Options cpu_upgrade_hw_cache
Options cpu_wt_alloc
Options no_memory_hole
# Amd series CPU Optimization

##
Some graphics cards can enable the DRM support to accelerate the display speed. For more information, see/usr/src/sys/CONF/notes and/usr/src/sys/i386/CONF/notes. This article is omitted.

4. Start optimization (loader. conf)

Autoboot_delay = "2"
# Set the startup wait time to 2 seconds.

HW. ata. atapi_dma = 1
# Enable DMA transmission on the hard disk of the ata33 or above interface to speed up access.

Kern. IPC. maxsockets = "16384"
# Increase the number of threads

Net. inet. tcp. tcbhashsize = "2048"
# Increase the number of TCP Control Blocks

Beastie_disable = "yes"
# Disable the image Startup Menu

V. System Preferences (RC. conf)

Background_dhclient = "yes"
# Accelerate the startup without waiting for completion of DHCP.

Keyrate = "fast"
# Maximize keyboard speed

Sendmail_enable = "NONE"
Sendmail_submit_enable = "no"
Sendmail_outbound_enable = "no"
Sendmail_msp_queue_enable = "no"
# Disable sendmail

Clear_tmp_enable = "yes"
# Clear/var/tmp files on time

Tcp_extensions = "yes"
# Extended TCP

Vi. system resource optimization (sysctl. conf)

Security. BSD. see_other_uids = 0
# Do not allow users to view all System Processes

Kern. IPC. maxsockbuf = 8388608
# Thread Socket buffer

Kern. IPC. shm_use_phys = 1
# Provide physical memory support only for threads and require more than 256 MB of memory.

Kern. IPC. shmmax = 67108864
# Maximum shared memory available for threads

Kern. IPC. Shmall = 32768
# Maximum number of threads

Kern. coredump = 0
# Not recorded during program crash

Net. Local. Stream. sendspace = 65536
Net. Local. Stream. recvspace = 65536
# Space for receiving and sending local data streams

. Net. Local. dgram. maxdgram = 16384
# Maximum number of local data packets

Net. Local. dgram. recvspace = 65536
# Space for receiving local data packets

Net. inet. tcp. rfc1644 = 1
Net. inet. tcp. rfc3042 = 1
Net. inet. tcp. rfc3390 = 1
# For some protocols that accelerate network performance, see RFC.

Net. inet. tcp. mssdflt = 1460
# The Data Segment Size of the data packet. The value of ADSL is 1452.

Net. inet. tcp. sendspace = 65536
Net. inet. tcp. recvspace = 1048576
# Network data receiving and sending Space

Net. inet. tcp. inflight_enable = 1
# Provide a buffer for network data connection

Net. inet. tcp. minmss = 1460
# Minimum value of the Data Segment of the data packet, ADSL is 1452.

Net. inet. Raw. maxdgram = 65536
# Maximum number of local data

Net. inet. Raw. recvspace = 65536
# Local data stream receiving space

VII. Environment Settings (. cshrc)
Alias LS-GF
# Colorized ls

Setenv editor EE
# The default editor is EE.

Setenv pager less
# The default page splitter is less, which is more convenient.

Set nobeep
Set prompt = '% N @ %/% #'
Set filec
Set autolist
##
I will not explain these settings, but I believe you will love it. I will study what it is. Especially the last line.

8. Compiled cache (ccache)
Ccache provides cache for program compilation. It reduces the number of times of repeated code compilation and accelerates the Compilation Time.

Installation Process:

Su
CD/usr/ports/devel/ccache/
Make install clean
CD/usr/
Mkdir ccache
CD/usr/sbin
Ln-S/usr/local/bin/ccache gcc
Ln-S/usr/local/bin/ccache CC
Ln-S/usr/local/bin/ccache C ++
Ln-S/usr/local/bin/ccache g ++
Ln-S/usr/local/bin/ccache CPP
Echo "setenv ccache_dir/usr/ccache">/root/. cshrc
Rehash
Exit

Finally, you can view the current compilation status by running ccache-s.
Now we can use the CVSup system code and the ports tree. Are you sure you want to compile your FreeBSD 5?

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.