Linux Tuning Tricks?
Milo_Mindbender writes: "Over the weekend I was attempting to improve my CD ripping performance and discovered RedHat 7.2 was running my Ultra/ATA 100 hard drive in a very slow non-DMA mode. After a fair amount of searching for how to fix this, a trivial change (look here) improved drive performance from 3MBs to 38MBs! FSCK on my 40gb partition went from over 5 minutes to under 1! This issue wasn't documented in RedHat's manuals but it effected a number of boxes in our office so I'm betting many other people in the world have the same problem. This made me wonder how many other common Linux tuning snafus there might be that a lot of people are probably missing. Do you know of any?"
On RedHat, you can use ksysv, the init editor, to turn off boot-time system services that are not needed. Candidates are daemons for GPM, USB, SCSI, LPD, APM, which are all enabled by default, and which may not be needed.
s/effected/affected/
Not trying to be a prick, just trying to let you know for future use! I see this mistake a lot, so...
"Effect" is a noun, whereas "affect" is a verb.
When you change something, you affect it. When something you did caused a change, you say the thing you did "had an effect".
(Effect can also be a verb meaning "to cause", but it's rarely used that way. i.e. "I effected a change.")
Sorry for the grammar nazi post!
I had to read this story's subject three times before I realized it did not say "Linux Turning Tricks."
My only gripe with LJ articles is that, even if you put them in print mode, they still run off the end of my paper when I print them.
The truth is, that even on "leading desktop OS" called with a name that reminds sheet of glass between frame, has not UDMA/66 and higher mode turned on by default.
Problem is, that it breaks compatibility with older hardware... eg. you will put an old harddisk on your comp. and it will "blow up" becouse your fancy OS will think it can take faster transfer speeds... etc.
* Origin: XBase BBS (2:490/4100) Well the good old days may not return and rocks might melt and sea may burn.
We recently built a machine around an Abit VP6 with 5 hard disks on it (three on the main IDE controller, 2 on the HighPoint 370 secondary controller). After a few days I noticed we were getting bad blocks on the drives on the HighPoint controller. Running badblocks on the disks gave random errors all over the place.
I then noticed that the Ethernet card was being given the same IRQ as the IDE controller and got suspicious. I swapped the ether card into different PCI slots until it got its own IRQ, then ran the badblocks check again. Everything ran clean.
It's also entertaining to use lmbench to test your hardware: it can plot pretty graphs showing how the IO speed changes across the disk surface so you can decide where to put your partitions, if that's important to you.
Main point though: if at all possible tune your hardware and then test using badblocks, lmbench and such before you put the machine into production (or when you've got a solid backup). As the article says, problems with your disk subsystem can loose lots of information quickly.
This way when I upgrade I don't end up with issues like this guy.
I guess I am supprised as I would have though that this would be something you'd see on Linux.com not slash.
It is a good idea to make sure that before you go mucking with hdparm that you do so knowing that if you make mistakes you can really screw up your harddrive.
Only 'flamers' flame!
If you are going to be playing with hdparm, take my advice and make a backup first! Some interfaces aren't fully supported by the kernel yet, and trying to run drives off of them in certain modes could break in a bad way. In my experience, this then means massive filesystem corruption and a complete reinstall.
Of course I'm not saying *don't* play with hdparm; just be sensible and only try it on a system you have backed up and can afford to lose for a little while as you're rebuilding it.
It's only software!
Life is made more difficult because there is buggy and/or broken hardware out there. I don't blame Redhat for accomodating this hardware, but by doing so they are making their distribution more complicated and less useful for those "in the know".
Redhat also, of course, distributes the non-kernel binaries optimized for Intel 80386 CPU's when the vast vast majority of installs are going on Pentium-class or better machines. And it doesn't help any that Redhat is using and distributing a very nonstandard version of GCC; see what the GCC developers say about such branches and what application developers say about this branch.
To actually learn a lot about Linux and all the associated tools that make it work, I highly recommend the Linux From Scratch method: build everything from source! You can optimize the build to your machine and end up with not only better performance, but a vastly superior knowledge of everything that used to be "under the hood".
Spelling grammar correctly would help your case. :)
Another thing I recently noticed which jumped out at me from my kernel messages during boot: the kernel was assuming a 33Mhz system bus speed for PIO. This was fixed by passing "idebus=66" as a kernel boot parameter. See ide.txt in the kernel documentation sources for more info.
GCC 2.96-RH fails with C code in one and only one condition: when it's not ANSI-conformant C. GCC 2.96-RH is much more restrictive than GCC 2.95.
GCC 2.96-RH is worlds better than 2.95 when it comes to generating C++ code. With GCC 2.96-RH and STLport-4.5.3, I was happy as a clam. GCC 2.95's C++ support was anemic, nonstandards-compliant, and just generally sucked for any sort of very serious usage.
When I was recompiling tons of applications to work with GCC 2.96-RH, every "compiler error" that I found-- every single one --was the result of a programmer doing something that wasn't ANSI/ISO and made an assumption that "well, since GCC 2.95 didn't complain about this, it's okay." I don't blame GCC 2.96-RH for being more standards-conformant; I blame developers for playing fast and loose with the language spec.
You would expect the hit rate to be at least 50%, but it seems like people almost always use the wrong one.
Why is Grand Theft Auto a much more serious crime than Reckless Driving?
You may try to use Powertweak to alter settings to improve performance.
Then there is tweaking settings via /proc. I used to have a link to some excellent documentation on it but, alas, I can't seem to find it. You could try reading the various bits of info in the Documentation tree of the Linux source but it is pretty spartan.
I agree that wide tables are annoying, but HTML viewers (and printers) nicely re-wrap plain text to fit.
Sooooo much easier than tables is just to use preformatted text.
Just a side comment from someone who has always written his web page in vi.
Bob-
The Ludwig von Mises Institute. The reasoning individuals economics
> Funny, the Ultra/100 drive in my Redhat 7.2 box is using DMA by default:
I built a box and it worked fine too... until I changed out the motherboard, and then I had to go discover the stuff the author is talking about. It was very clearly enabled in the BIOS of the new m.b.; it just wasn't automatically picked up by Linux like it had been on the original m.b.
Sheesh, evil *and* a jerk. -- Jade
Of course there are hundreds, possibly thousands, of little tuning tweaks to make Linux perform better. But practically speaking, this is the main one. The other is shutting down services you don't need.
In an effort to get a working system on every possible computer, Redhat defaults to no hard drive DMA and everything but the kitchen sink running in the background. Fix these two little things, and you're 99% there.
Lots of nice little Linux tidbits can be found on The Linux Pimp. Can't think of a site more ontopic for this post. The intro is pretty funny too.
The same mode change fixes "jerky" movement when playing DVDs (for obvious reason). Observed on ogle and BDV-212B, (non-region-locked, firmware) drive.
Contrary to the popular belief, there indeed is no God.