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.

Chapter 6If you are curious to know what a specific variable is, you can use sysctl with -dargument and sysctl will show a short description for the variable as follows:# sysctl -d net.inet.ip.forwardingnet.inet.ip.forwarding: Enable IP forwarding between interfacesAnd finally, to modify a variable run the following command:# sysctl net.inet.ip.forwarding=1net.inet.ip.forwarding: 0 -> 1You may want to modify a few variables permanently. To achieve this, you shouldadd variable definitions to the /etc/sysctl.conf file, and the system will load yourvariables upon boot up process.It is recommended that you do not play with sysctl variables on aproduction system. Applying inappropriate modifications may renderyour system unstable or pave the way for other unprecedented behaviors.Use this utility with caution. Always try your changes on a test machinebefore rolling out the actual changes on a production server.There are a few variables that cannot be set during system run time. A good exampleof this is kern.maxusers variable:# sysctl kern.maxusers=512sysctl: oid 'kern.maxusers' is a read only tunablesysctl: Tunable values are set in /boot/loader.confAdding this variable to the /etc/sysctl.conf file also won't help. These types ofvariables should either be added to the /boot/loader.conf file or hardcoded in thekernel configuration file.Later is this chapter, only a few of the important sysctl that would be useful intweaking your system's performance variables are introduced. You may use thecombination of grep and sysctl to find many interesting variables that may helpyou get more information about your system or identify change in its behavior.KernelAs discussed in Chapter 2, you can recompile the systems kernel from source to addor remove certain features. Beside adding or removing modules, you can optimizeyour kernel performance in several ways.[ 89 ]

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

Saved successfully!

Ooh no, something went wrong!