Tuning A FreeBSD Box For High Performance
flynn_nrg writes: "www.daemonnews.org has an interesting article explaining how to fine tune your FreeBSD for maximum performance. In it's default state, a FreeBSD box is tuned for stability and reliability, but more often that not you want to get the most out of you BSD box, specially web servers. Nice article if you ask me."
On modern (4.3+) FreeBSD systems, the tuning(7) manpage is chock-full of fascinating information about system tuning. This brief article seems to have gleamed the most important bits out of it and presented them in an executive summary form, however, if you are a real performance-squeaker, I recommend going through all of tuning(7).
In general, section 7 of the manpages is full of interesting reads. You can get a list of available section 7 pages with:
$ apropos 7 | egrep -v '^.+\([12345689]\)'
Read and enjoy!
"question = (to) ? be : !be;" --Shakespeare
I believe some of it is on by default now. For example, I think softupdates is on by default as of 4.3.
/etc/sysctl.conf. Here is mine:
;)
For the rest, I have
# Configure logging.
kern.logsigexit=0 # Do not log fatal signal exits (e.g. sig 11)
# Kernel performance tweaks.
kern.ipc.maxsockbuf=1048576
kern.ipc.somaxconn=4096
kern.maxfiles=65536
# Network performance tweaks.
net.inet.tcp.recvspace=65536
net.inet.tcp.sendspace=65536
# File system performance tweaks.
vfs.vmiodirenable=1
As a developer, I do not need to be reminded (kern.logsigexit) of all my programs crashing.
Well, while having some speed enhancements isn't bad, I like the fact that it's "stable" out of the box. Considering that I use it on large, beefy boxen, I'd prefer stability over mindboggling speed, only because I like things to always work, vs. having spectacular crashes or the like :)
I think it's better off left for individuals to tweak, since the average joe blow doesn't necessarily know how to and thusly won't hurt themselves with a stock system. FreeBSD is mostly a server class OS, and I like it that way; sometimes you sacrifice some speed for stability.
of course if you can get both, then it's best!
EOM
Hmmm, I started Freenix (my name for any free Unix-like implementation) with Slackware-96, so I've got you beat by one year :-)
But I learned computing on 4.1BSD UNIX. Using FreeBSD is like coming back home. It's simple, elegant but still complete and packed to the brim with everything you could possibly want.
p.s. Linus did now about 386BSD, and was interested in it (like most hackers a decade ago). Unfortunately that was during the time of the AT&T lawsuit, which was why Linus stayed away. No one new if it was going to be around the following week. Timing is everything in this business.
A Government Is a Body of People, Usually Notably Ungoverned