12.07.2015 Views

download

download

download

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

System Configuration—Tuning PerformanceCFLAGS and COPTFLAGSThe CFLAGS variable specifies any additional compiler options that you want to passto the compilers. These additional settings mostly deal with the performance of thecompiling process or that of the output binary code. A typical CFLAGS variable wouldlook like this:CFLAGS=-O2 -pipeIn the above example, two parameters are passed to the compiler. The -O2 flagsets the optimization-level to 2, which is acceptable for most applications. Anotheroptimization flag that you will use is -Os that optimizes the output binary forsmaller size.It is advisable not to use the -O3 option (the highest level of gcc binaryoptimization) as it is likely to break the output binary code.Ports system also respects the variables you set in the /etc/make.conf file.However, some of the ports need to have the WITH_OPTIMIZED_CFLAGS variable setin order to enable optimization during compile process.Another important variable that you may want to set in your make.conf isWITHOUT_DEBUG variable. Some ports build with the debug information, unless thisvariable is set. It is recommended that you set this variable in your make.conf inorder to ensure that these ports are not compiled with debug information:WITHOUT_DEBUG = yesThe /boot/loader.conf fileSome variables cannot be modified during the system run time and consequentlyin the sysctl.conf file. These variables can either be compiled in a kernel or setfrom the /boot/loader.conf file. A list of such variables is listed in the /boot/defaults/loader.conf file.Do not modify the /boot/defaults/loader.conf file. This filecontains some default values. You may modify the /boot/loader.conf file instead.A good example of these variables is the kern.maxusers variable. Setting thisvariable magically scales up some other kernel variables, including the number ofmaximum open files, sizing of network buffers, and so on.[ 98 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!