Background
While copying a vast number of multi-megabyte sound files, the Kubuntu desktop becomes intermittently unresponsive (the mouse pointer can move, but Firefox, Konsole, and KDE itself temporarily ignore keyboard presses, mouse clicks, and network I/O).
$ uname -a
Linux jaguar 2.6.32-22-generic #36-Ubuntu SMP Thu Jun 3 19:31:57 UTC 2010 x86_64 GNU/Linux
$ cp -Rnv /home/user/music/flac/* .
The PID is 11544, and I subsequently tried:
$ renice -n 19 -p 11544
$ ionice -c 3 -p 11544
Strangely, when remotely accessing a laptop on the local network (via TightVNC), the remote screen continuously updates (if I am using the laptop). Similarly, playing music files off the USB drive (even a file that has not been fully copied) does not get affected by the intermittent unresponsive problem.
Pressing Control-Z to suspend the copy process results in normal behaviour (once the keystroke is finally accepted by Konsole) instantly.
What I was trying to accomplish was the following:
- Rip CDs to desktop (Linux) computer.
- Plug USB drive into laptop.
- Run WinSCP on laptop.
- Copy music files using WinSCP from desktop computer to USB drive on laptop.
However, no matter what software I used (WinSCP, Tunnelier, or rsync over Cygwin), the copy would start at a zippy 2 MB/s, then choke to 60 KB/s after a few seconds. Effectively, the secure copy would stall.
Googlin'
Searches have found a few people who have experienced similar problems. The issues went away for most of them by switching to Tunnelier. This did not work for me. Other people switched to FreeBSD to solve the problem. That's not an option at this time. Still others switched from SSH Protocol 2 to SSH Protocol 1. That did not work for me, either.
Log Files
The USB drive checked out fine using chkdsk /f
on Windows. There are no relevant error messages in any of the log files from /var/log
.
Performance
Monitoring the system using top
shows nothing suspicious when the "pauses" occur. (top
continues to refresh during a moment of unresponsiveness.) The program hald-addon-storage
shows it polls /dev/sr0
every 2 seconds. Whatever that means.
Hardware
Quad-core with 8 GB of RAM. The /tmp
drive is empty and /
shows 72% usage. RAM has 2 GB free and not a single CPU is pegged beyond 1% usage, even during the pauses.
Question
Does anyone have any ideas on what might be happening, or avenues to explore to try and understand what is happening with the system?
I got quite lost after the cp/renice/ionice examples you provided. :) Was the USB drive connected to your desktop during those examples (so no network traffic between desktop and laptop was needed), or did you try that desktop + (laptop+usb) combo later? And when you say "rip CDs to Linux desktop", do you store those files on a local hard drive or that USB disk?
In many Linux distributions USB drives will get mounted with
sync
mount option by default. That means safer writes, but on the other hand with some drives that might mean very slow write performance and all kind of other funny side-effects. Mounting the drive withmount -o remount,async /your/usbdrive/mountpoint
will probably speed up the write operations a lot.Does the Linux desktop stall if you do your WinSCP stanza, but instead of USB drive try to copy to local drive in your laptop?
I'm a bit confused as well. First you show commands suggesting the problem is copying stuff from your home directory to a USB drive, but then you start talking about your Windows laptop and scp. So what are you actually doing?
Wrt. to poor Linux desktop interactivity when writing heaviliy to a slow device, the recent 2.6.36 kernel contains a patch that is supposed to fix this particular issue.
As you seem to be using Ubuntu 10.04, you could try the new kernel from the kernel PPA and see if that fixes the issue for you.