Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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:

  1. Rip CDs to desktop (Linux) computer.
  2. Plug USB drive into laptop.
  3. Run WinSCP on laptop.
  4. 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?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

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.

share|improve this answer
    
This is likely the problem. –  Dave Jarvis Oct 27 '10 at 18:56

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 with mount -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?

share|improve this answer
    
First I tried copying the original files from Linux to the laptop via WinSCP. Then I removed the USB drive from the laptop and plugged it into the Linux machine to copy the files locally. In both cases there was an issue copying the files. Thank you for the note about asynchronous mounting. –  Dave Jarvis Oct 27 '10 at 17:54
    
The slowdown still happens, even mounted with async. Thanks, though! –  Dave Jarvis Oct 27 '10 at 18:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.