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."
Maybe in the next release we can ask them to do: /kreskin/ && message =~ /bsd is dying/) {
if (message =~
drop_message_into_flaming_pit();
}
the world would be a better place.
"question = (to) ? be : !be;" --Shakespeare
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
If people more often than not want a speedy system than a stable one, why not just tune it for speed? or find a nice in between?
There isn't much like the scent of a fresh harddisk
Yup....
/. articles. Anyways.....
As a person who's first love was Linux, I feel qualified to commment on the reasons to migrate away from Linux. I started with Slackware in 97 from a cd in the back of my html book, basically a cheap way to get apache running without having to own an expensive risc machine. Anyways, I've toiled with linux thru the early hacker/academic days, thru the hype-days from 98 to 99, and still every-now-and-then install it for a friend in need. I've probably install Redhat over 100+ times at the Linux Users Group here in Dallas, and have installed Slackware upwards of 50+ times, Deb/suse/others upwards of 20+ each. Inversly, I've probably installed FreeBSD only a few times since I toned-down my OS-install fever. It gets old, really fast installing linux for the install project. Anyways.... as a seasoned Finux vet, I think that FreeBSD is better in many ways, except the userbase, and application base. There are more Finux users, and more Finux developers by several orders of magnitude compared to all the BSD distro's combined.
What I have noticed from this large group of Finux users is the fact that they are overtly insecure about their feelings of "elite-ness". In other words they tend to feel threatened by people who donn't join their band-wagon.... of finux evangelism. In fact, such a large majority of Finux userrs started using Finux simply because they percieve that Microsoft is a Monopoly, and or in some way they have negative feelings about microsoft. Other time sI find that they had feelings of inadiqatcies in their microsoft envrironment, and seeked an area where they are different.... again thsi goes back into the elitism aspect, and the need thereof to be elite, and/or different. In this wway they can justify putting Microsoft users down, by advertising that they are now Finux users.
The above being said, leads this very specific class of Finux users feelings insecure when they hear about an even more elite group of people, a smaller comunity, of more-often ex-finux users..... using something called BSD. The typical reactio is that they are not with us, therefor against us... type reaction... and the hostility, and missunderstandings ensue.
Most anti-BSD rehtoric posted on Slashdot is from the narrow minded Group of finux users taht simply feel threatened by something they simply don't understand. My Favorite argument to shootdown first is the hords of Finux folks, and windows folks that say Unix is 20 years old! Ha... 20 years ago unix was entirly different, and FreeBSD, compared to some old Unix systems of the 80's is like HUGE in all the different ways. Most of the time people have read this in some website, from an un-educated reporter. In reality, unix has had many huge changes over the years, as have os design and implementation over the years.... a direct result of CS students striving to push the limits. The word micro-kernel comes to mind, yes.. we now have modulare kernels too.... oh my... and don't forget about ever popular virtual memory idea... geeze... Unix sure is darn different that it was 20 years ago.
The fact is, and I can do a google search I find the Linus quote of how he would nto have ever created the Linux kernel if he had know about the Berkly System Dist. He was only aware of the Car-mellon like Minux system. Yup, he has said it, and you can find the quote on google, and past
I find taht most of the FreeBSD folsk are people tired of all the Linux hype.... I mean... we have tried all the distro's, played with all the various package systems, recompiled the finux kernel a time or two... doen some programming, etc, etc, etc..... Then, its liek FreeBSd is sitting right there, simple, eligant, beutiful. The first thing that most linux converts claim got them is the FreeBSD ports system. Really it is such a simple idea that we are suprised it hasn't caught on in the Finux world originally. Basically you have a cvs tree of all the software taht has been ported to the FreeBSD OS. To get updated versions of software, it is simple to just cvsup the entire ports collections, and then travel to the the software you want...say apache, and run "make install". Simpel as that... the latest, greated Apache with all the freebsd patches, and optimisatiosn are applied. No toiling with rpms, and the dreaded hunt for dependencies. The porsts systems checks for dependencies, downloading the latest version of Gmake if needed, or whatnot.
Other nice fetures about FreeBSD, and the other bsd's is taht the stability is paramount... a recent comparison of Unixes on sys admin magazine ranked FreeBSD the lowest of "out-of-the-box" installs for performance. Thsi is nto suprising since FreeBSD is build for stability (out-of the box), and many Finux distro's are optimised at the time of burnign the distro to CDROm, is highly optimised, and unstable.... so little tweaks are needed out of the box to make the system unstable... in other worlds the Finux systsm typically are more prone to instability under heavy loads that freeBSD. I won't bore you with teh technical details, as the lay-man won't get the jist of what I'm sayigng.
That being said... I'd advise the person who wrote the high-performance tuning guide, linked inthe article, to tone down a bit his kernel conf. It appeas to lean on the unstable side, especially with the extreamly high buffs lines under the useers line in the kern conf. oh well... it will push things to the extream limit.
It isn't a lie if you belive it.
BSD is NOT dying!
;)
Mr. Praline : 'Ello. I wish to register a complaint.
(The owner has his back to the register and does not respond.)
Mr. Praline : 'Ello, Miss?
Owner : (turning around, very angry) What do you mean, "miss"?
Mr. Praline : I'm sorry, I have a cold.
(The owner nods, understanding.)
Mr. Praline : I wish to make a complaint!
Owner : (hurriedly) Sorry, we're closin' for lunch...!
Mr. Praline : Never mind that, my lad. I wish to complain about this OS, what I purchased not half an hour ago from this very boutique.
Owner : Oh yes, the, ah, the FreeBSD... What's, ah... W-what's wrong with it?
Mr. Praline : I'll tell you what's wrong with it, my lad. It's dead, that's what's wrong with it.
Owner : No, no, 'e's ah... he's resting.
Mr. Praline : Look, matey, I know a dead OS when I see one, and I'm looking at one right now.
Owner : No no, h-he's not dead, he's, he's restin'!
Mr. Praline : Restin'?
Owner : Y-yeah, restin.' Remarkable OS, the FreeBSD, isn't it, eh? Beautiful command line!
Mr. Praline : The command line don't enter into it. It's stone dead!
Owner : Nononono, no, no! 'E's resting!
Mr. Praline : All right then, if he's resting, I'll wake him up!
(shouting at the system tower)
'Ello, Demon! Mister Demon OS! I've got a lovely fresh OC-3 for you if you wake up, Mr. Demon OS...
(owner hits the monitor)
Owner : There, he moved!
Mr. Praline : No, he didn't, that was you pushing the monitor!
Owner : I never!!
Mr. Praline : Yes, you did!
Owner : I never, never....
(He pulls the hard disk out of the box and screams into it.)
Mr. Praline : 'ELLO DEEEEEEMMMOOONN BEEE-ESSSSS-DEEEEE! DEMON OS! WAKE UP!
(He bangs the disk against the store counter, horribly hard.)
TESTIIIING! TESTIIIING! THIS IS YOUR NINE-O' CLOCK ALARM CALL!
(He does it again, harder.)
BEEE-ESSSSS-DEEEEE!
(He tosses it up in the air and watches it plummet to the floor. Longish pause.)
Now that's what I call a dead OS.
Owner : No, no.... No, he's stunned.
Mr. Praline : STUNNED?
Owner : Yeah! You stunned him, just as he was wakin' up! FreeBSDs stun easily, major.
Mr. Praline : Look my lad, I've had just about enough of this. That OS is definitely deceased, and when I bought it not half an hour ago, you assured me that its total lack of market share was due to it being tired and shagged out after a long download.
Owner : Well, he's... he's, ah... probably pining for the fjords.
(Praline looks angrily back and forth, stuttering.)
Mr. Praline : PININ' for the FJORDS? What kind of talk is that? Look, why did he fall flat on his back the moment I got 'im home?
Owner : The FreeBSD prefers kippin' on its back! Remarkable OS, isn't it, guv, eh? Lovely command line!
Mr. Praline : (coldly) Look, I took the liberty of examining that OS when I got it home, and I discovered the only reason that it had been sitting on the hard disk in the first place was that it had been WRITE PROTECTED there.
(pause)
Owner : Well, of course it was write protected there! If I hadn't write protected that OS down, it would have nuzzled up to the ethernet card, hacked its way out with its little trident, and VOOM!
Mr. Praline : "VOOM?"
(Praline puts the system down and take the hard disk into his hands.)
Mr. Praline : Look matey, this OS wouldn't "voom" if you put four thousand volts through it! It's bleedin' demised!
Owner : It's not! I-It's pining!
Mr. Praline : It's not pinin,' it's passed on! This OS is no more! It has ceased to be! It's expired and gone to meet its maker! This is a late OS! It's a stiff! Bereft of life, it rests in peace! If you hadn't write protected him to the disk he would be pushing up the daisies! Its active processes are of interest only to historians! It's hopped the twig! It's shuffled off this mortal coil! It's run down the curtain and joined the choir invisible! This.... is an EX-OS!
(pause)
Owner : Well, I'd better replace it, then.
-------------
Sorry folks. Couldn't resist!
Conformity is the jailer of freedom and enemy of growth. -JFK