You are not logged in.

#1 2010-05-08 22:12:51

slhdn
Member
Registered: 2010-05-08
Posts: 7

file copying uses too much cpu power

I just installed Arch Linux today. Everything is good but there is one problem: When I copy a big folder(23 GB) from one partition to another, it uses 100% cpu power and significantly slows down the system. I tried copying the same folder in Ubuntu, where the system performance was not affected at all. 40% cpu usage at most. Does anyone else have this problem ? Any help would be appreciated.

Offline

#2 2010-05-08 22:20:36

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: file copying uses too much cpu power

What are you using to copy it?

File manager or flat out cp -r

Last edited by cesura (2010-05-08 22:20:58)

Offline

#3 2010-05-08 22:29:35

slhdn
Member
Registered: 2010-05-08
Posts: 7

Re: file copying uses too much cpu power

File managers. In arch Dolphin, in Ubuntu nautilus.

Offline

#4 2010-05-08 22:49:46

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: file copying uses too much cpu power

slhdn wrote:

File managers. In arch Dolphin, in Ubuntu nautilus.

That could be why, but probably not.

Try using cp. Also, don't forget copying files is actually a big task. It has to load each byte, then move it to some other hard drive sector, and do this millions of times. With a 23GB file, it will take up alot of CPU

Offline

#5 2010-05-08 22:51:10

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: file copying uses too much cpu power

What filesystems are you coping from/to? What scheduler are you using - stock Arch kernel of you've rolled your own?
IIRC Nautilus is lighter than Dolphin and KDE may be eating some cpu.

It's just a wild guess, but:
http://forums.gentoo.org/viewtopic-p-59 … ml#5987465
*) the problem with low throughput is related to a buggy firmware on several SATA-drives with NCQ
*) the problem with lagging / bad desktop interactivity is (seems) specific to the x86_64 / amd64 architecture and cfq and cfs (the cpu-scheduler) seem to be involved

Last edited by karol (2010-05-08 23:04:06)

Offline

#6 2010-05-08 23:16:54

slhdn
Member
Registered: 2010-05-08
Posts: 7

Re: file copying uses too much cpu power

Ok, I will try compiling a new kernel. Thanks for the replies.

Offline

#7 2010-05-08 23:26:44

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: file copying uses too much cpu power

> Ok, I will try compiling a new kernel. Thanks for the replies.
That may not solve your problems but please post if it does.

Offline

#8 2010-05-09 00:01:01

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: file copying uses too much cpu power

slhdn wrote:

Ok, I will try compiling a new kernel. Thanks for the replies.

You don't need to recompile if you want to try and change I/O schedulers. A simple elevator= on your GRUB kernel line should do fine. smile
Available schedulers include:
Completely Fair Queuing:elevator=cfq (default)
Deadline:elevator=deadline
NOOP:elevator=noop
Anticipatory:elevator=as
You may also be able to do it with something like

echo deadline > /sys/block/sda/queue/scheduler

to use the deadline scheduler, for /dev/sda, for instance.

FWIW, the JFS filesystem has been proven to perform best with deadline.

Offline

#9 2010-05-09 01:00:04

slhdn
Member
Registered: 2010-05-08
Posts: 7

Re: file copying uses too much cpu power

Misfit138 wrote:
slhdn wrote:

Ok, I will try compiling a new kernel. Thanks for the replies.

You don't need to recompile if you want to try and change I/O schedulers. A simple elevator= on your GRUB kernel line should do fine. smile
Available schedulers include:
Completely Fair Queuing:elevator=cfq (default)
Deadline:elevator=deadline
NOOP:elevator=noop
Anticipatory:elevator=as
You may also be able to do it with something like

echo deadline > /sys/block/sda/queue/scheduler

to use the deadline scheduler, for /dev/sda, for instance.

FWIW, the JFS filesystem has been proven to perform best with deadline.

sudo nano /sys/block/sda/queue/scheduler

noop deadline [cfq]

What does this mean? Am I using deadline, or cfq?

In this forum they recommend using bfs and bfq , but frankly I'm not very familiar with these terms. Can you tell me what I should write into the scheduler file to use those schedulers?

Offline

#10 2010-05-09 03:18:49

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: file copying uses too much cpu power

Well, BFS is a CPU scheduler, not an I/O scheduler. That's a different beast, and to my knowledge, that will require a kernel recompile..though I think there may be an AUR PKGBUILD kernel which uses bfs. Best to check there first.

To be clear, I suggested that you use 'elevator=<your_choice>' in the GRUB kernel array above, but maybe I was not concise enough.
To change I/O schedulers, in /boot/grub/menu.lst, append elevator=<your_choice> to the end of your kernel line.
Something like:

kernel /boot/vmlinuz26 root=/dev/sda1 ro elevator=deadline

You can also edit this on the fly by hitting 'e' during GRUB's timeout at boot.

I/O schedulers deal quite directly with your hdd, and are quick and easy to switch. Hence my suggestion to try them.
smile

Offline

#11 2010-05-09 10:42:54

slhdn
Member
Registered: 2010-05-08
Posts: 7

Re: file copying uses too much cpu power

kernel /boot/vmlinuz26 root=/dev/sda1 ro elevator=deadline

Thanks, this worked. smile
The system got a lot more responsive during copying.
I haven't tried BFS yet.

Offline

#12 2010-05-09 17:15:27

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: file copying uses too much cpu power

@Misfit138
Would this help?

nice -n 19 ionice -c 3

It may take longer to copy the files but it should allow me to work and not grab all the resources, right?

Offline

Board footer

Powered by FluxBB