

Linux Tuning Tricks? 71
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?"
disable system services on startup (Score:3, Informative)
Re:disable system services on startup (Score:3, Informative)
-- aside -- you CAN move them to anything other than S##xxxx, but i normally stick with the standard and use K##xxxx
Re:disable system services on startup (Score:2, Informative)
I always preferred what my predecessor used of renaming S##xxxx to _S##xxxx. This keeps things clear as to what the system *used* to do.
Re:disable system services on startup (Score:1)
true, but if you do this you have to make sure that they dont get started in any other runlevel. (runlevel 2, etc...). this is why i stuck to using the recommended K##xxxx. and if the /etc/init.d scripts are written properly, killing them off isnt much of an issue as there should be pid files in /var/run (or whatever is applicable per your OS).
Re:disable system services on startup (Score:2, Informative)
I usually move the scripts from S* to s*. This way I can tell quite easily what I've disabled by hand.
Re:disable system services on startup (Score:1)
Re:disable system services on startup (Score:2)
Actually, in the rc.? directories they are links to the scripts. You could actually delete them to keep them from starting without hurting your system at all (don't try this in the init.d directory). Changing them from S to K (as suggested in a later post) won't prevent the services from being started at run-level 2, unless they are changed in rc.2
As an aside, if you're running a RedHat based distro, try 'man chkconfig'. It might be useful;)
Just a tip. (Score:2, Informative)
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!
Mod this up! Everybody gets this wrong! (Score:2)
You would expect the hit rate to be at least 50%, but it seems like people almost always use the wrong one.
Re:Just a tip. (Score:2, Informative)
For now, though, this helfpul tip from Merriam-Webster [m-w.com] is pretty informative (and interesting):
"The confusion of the verbs affect and effect is not only quite common but has a long history. Effect was used in place of 3affect as early as 1494 and in place of 2affect as early as 1652. If you think you want to use the verb effect but are not certain, check the definitions in this dictionary. The noun affect is sometimes mistakenly used for effect. Except when your topic is psychology, you will seldom need the noun affect." -- From the "effect" entry in Merriam-Webster's online Collegiate Dictionary.
Prostitute Penguin (Score:4, Funny)
Re:Prostitute Penguin (Score:1)
Same here (Score:1)
Considered linking to that Penny Arcade strip of the User Friendly characters turning tricks but don't feel like investing the time to find it...
Re:Prostitute Penguin (Score:3, Funny)
> "Linux Turning Tricks."
I could make a joke about open "sores", but I won't.
Re:Turning Linux (Score:1)
<rolling dice>
A very nice, recent article ... (Score:5, Interesting)
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.
"Tabilize".... Or just use plain text. (Score:3, Insightful)
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-
Re:A very nice, recent article ... (Score:1)
however, something about it worries me.....they are recommending using -O9 for compiling the kernel.....does that not sound scary?
Re:A very nice, recent article ... (Score:3, Funny)
So I just looked up this "paper" thing on Google, and it sounds really cool, kinda like a flat-panel display with a built-in battery. But how do you slice the trees so thin?
Re:A very nice, recent article ... (Score:1)
You use a very special tool called a "tunglade".
UDMA, etc. (Score:3, Interesting)
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.
Re:UDMA, etc. (Score:1)
Re:UDMA, etc. (Score:2)
Re:Lame Grammer Post (Score:2, Funny)
Re:Lame Grammer Post (Score:1)
Oh to have mod points.
Check for interrupt clashes, and test (Score:5, Insightful)
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.
Re:Check for interrupt clashes, and test (Score:1)
Re:Check for interrupt clashes, and test (Score:1)
wow.. I never knew that.. (Score:2)
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.
Re:wow.. I never knew that.. (Score:3, Interesting)
Overzealous, I recommended these options to friends, who all locked up when they tried them (pinging out from IRC, etc), but I was undaunted. When my old HD started to give up the ghost, I got a new (well, new to me, this was 6 months ago) 2 gig WD for the box, and turned all the options on. Hours later, the entire filesystem was corrupted. After the whole system nosedived, I spent more than two hours hitting 'y' in fsck before I decided 'screw it' and reformatted. Fortunately, it was a clean install anyway.
Moral of the story: test out your psychotic options before you put any important data on the drive. Other moral: say what you like about fujitsu, but their drives support more hdparm options than any other I've seen, and they don't break when you use them.
--Dan
Re:wow.. I never knew that.. (Score:1)
After the whole system nosedived, I spent more than two hours hitting 'y' in fsck before I decided 'screw it' and reformatted.
You have heard of the -y switch to e2fsck, right? Not that it saves your file system, but it relieves you of pressing 'y' while learning that you are fscked.
Re:wow.. I never knew that.. (Score:1)
Or something. I was running e2fsck manually.
Thanks for the tip either way though.
--Dan
Re:wow.. I never knew that.. (Score:2)
I know I'd never say anything bad about the drives. I've got two: an old 1G drive, and a 3.4 that's still the boot drive of my machine. Still lightning fast for it's time, and ultra quiet. And it's been thru more abuse than I care to mention, and it's still going. I'd buy more Fujitsu stuff, but didn't they sell to Maxtor?
Careful with hdparm! (Score:5, Informative)
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.
Re:Careful with hdparm! (Score:3, Interesting)
I have only myself to blame.
Re:Careful with hdparm! (Score:1)
hdparm is not usually needed... (Score:1)
IIRC hdparm is usually not needed for 2.4 serial kernels as dma detection etc. is built into the ide drivers.
I know that the last view redhat 7.2 installs I have done on relatively modern hardware, and an old PII as well, have picked up the correct dma and 32bit IO modes automagically
Distributing software but not knowledge = problem (Score:4, Insightful)
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 [gnu.org] and what application developers say about this branch [mplayerhq.hu].
To actually learn a lot about Linux and all the associated tools that make it work, I highly recommend the Linux From Scratch [linuxfromscratch.org] 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".
Re:Distributing software but not knowledge = probl (Score:1)
May want to learn about 2.96 before you bash it. (Score:2)
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.
PCI Bus speed (Score:2, Informative)
Re:PCI Bus speed (Score:3, Informative)
Re:PCI Bus speed (Score:1)
Re:PCI Bus speed (Score:2)
Powertweak and /proc twiddling (Score:4, Informative)
You may try to use Powertweak [sourceforge.net] 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.
mine works (Score:1)
Funny, the Ultra/100 drive in my Redhat 7.2 box is using DMA by default:
/sbin/hdparm -tT /dev/hde
/dev/hde:
/sbin/hdparm -d /dev/hde
/dev/hde:
#
Timing buffer-cache reads: 128 MB in 0.72 seconds =177.78 MB/sec
Timing buffered disk reads: 64 MB in 1.82 seconds = 35.16 MB/sec
#
using_dma = 1 (on)
I know that I didn't have to do anything special to get it working - I just did a regular install and let it go.
Re:mine works (Score:2)
> 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.
Practically speaking... (Score:2)
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.
Pretty good resource (Score:2, Informative)
Tweaking your GUI (Score:1)
Re:Tweaking your GUI (Score:1)
Same for DVDs (Score:2)