Re: Ubuntu - File Copy Seems Resource Intensive



Gregory Piñero wrote:
Hi guys,

I just started copying about 5GB between two partitions using Nautilus
in freshly installed 6.06 (first time doing this) and now that the
copy is going, anything else I try to do takes an extremely long time.
e.g. 2+ minutes to open Firefox, etc. Is this normal? Is there
something I should change?


Two things are happening here. The first is that the Linux kernel is a cache aggressive kernel. What that means is that it will try to use as much of your ram as it can to cache stuff that it has read or written to disk. It leaves some ram to fulfill immediate memory allocations, but if you want a big chunk of memory your going to have to wait for the kernel to clear some dirty pages. Normally for cached pages associated with a read, it just has to clean the pages and hand them over. But, for a write it has to flush those pages to disk. So, when firefox starts up it wants to allocate a bunch of ram, and thus it has to wait for the kernel to free some ram. Since your copying a file there are a lot of both read cache and write cache pages.

The second thing that is going on is that in order to start firefox you must read its binary, libraries, and users data from the same disk that your using in your copying. There is only so much bandwidth to and from your disk and the kernel io scheduler (or elevator) tries to allocate that bandwidth fairly between your two processes. Normally this is good, but in your case you care more about the firefox process starting up than you do the copy finishing. Currently I know of no way to let the kernel know this. There used to be some talk of modular, switchable elevators, but I don't know what happened to it.

Between the two problems above, the second is the worse of the two, since it also contributes to the first. As far as I know the only solution is faster disks(SATAII and 15K RPM) and more/faster RAM(DDR2 and 1GB or more). Obviously this can be prohibitively expensive.

Another solution is to start firefox before you copy large files. That or use rsync with the --bwlimit switch. That probably the better solution because you can limit rsync to 5000kb/s and still have useable bandwidth for everything else. That would be the proper solution if your going to be doing a lot of copying of large files around. You can even put the following in your .bashrc to make it nice and easy to use.

alias cp='rsync --bwlimit=5000 '

You will have to play around with the 5000 till you get a good number that leaves your system usable. Like I said though, this would be something you would do if your doing this copying of large files often. Also this wouldn't work for nautilus so you would have to copy those large files from the command line.


Also, you may not be running the optimized kernel for your processors. IO can be slow and more processor intensive on the 386 kernel. If you are running an Intel PII or above, you should run the 686 kernel(sudo apt-get install linux-686) and if your running on an athlon then you should install the k7 kernel(sudo apt-get install linux-k7).

Wow that post was longer than I thought it would be.

--
Scott Henson
LCSEE Systems Staff
WVU MAE Undergraduate
Ubuntu User


--
ubuntu-users mailing list
ubuntu-users@xxxxxxxxxxxxxxxx
https://lists.ubuntu.com/mailman/listinfo/ubuntu-users



Relevant Pages

  • Fetch stuck in state sbwait, anybody else experience this?
    ... world and kernel. ... After that I tried to install XF86-4 and firefox from ... ports but it seemed to be hanging up. ...
    (freebsd-current)
  • [opensuse] Re: Video clips on a specific site -- Firefox vs Opera
    ... I use to install the last firefox to my ~/Document, and copying the ... plugins there ...
    (SuSE)
  • input method on fc3?
    ... FC3 and soundcard ... >> without problems and sound works fine. ... What modules were loaded with kernel ... I can install and configure samba on Linux as easily as I can install ...
    (Fedora)
  • Fedora Core 2, Averatec 3220 notebook
    ... I recently bought an Averatec 3220 notebook computer and have spent some ... Following is a detailed "howto" guide for installing Linux (Fedora Core ... Linux distro, which is easy to install and use, and for lots of answers ... We need one because the default Fedora Core kernel doesn't grok NTFS ...
    (Fedora)
  • Re: install woes
    ... looking at the Fedora 9 64bit DVD: ... I'd try the acpi=off, but I didn't need any boot options, as far as I remember ... appended the kernel, probably post-install. ... but on attempting to install, it freezes up at the test media screen. ...
    (Fedora)