It frequently takes a long time (5-10 seconds) to save tiny (~100 line) text files on my linux (Ubuntu 9.10) machine. At the same time, it takes just as long to run commands that should normally complete virtually instantaneously (e.g. running ls in a directory with 30 files).
After a few seconds, the problem is gone, and reappears later on. I would estimate that it exists about 10% of the time.
I do have one long-running process using about 100% of one core (this is a 6 core machine) but that's constant - in other words, during the other 90% of the time when things seem to be running fine (no delays), it's still using the same amount of CPU.
What can I do to debug what's causing this? If you have suggestions for the cause, that would be fine, but I'm more interested in learning what tools and commands you'd use to investigate.