![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
Hello, Unregistered You are browsing a READ only archive of the main support categories pre 4/21/2008. You will not be able to post or reply any threads in this section.
|
|
General Help All your general support questions for Ubuntu, Kubuntu, Edubuntu and Xubuntu. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Quad Shot of Ubuntu
![]() Join Date: May 2006
Beans: 414
Ubuntu 6.10 Edgy
|
Limit CPU usage of process
I wrote a script to convert a few thousand music files from one file to another, and have started it going and don't want to stop it now really. However, after leaving it running for a while I realise that I forgot to start it with the 'nice' command, to make it have a low priority on CPU usage. Is there a way to lower a processes priority once it has started?
The script uses lots of sequential ffmpeg instances, and each one has a different PID, so I suspect this may not be possible. Also, would the 'nice' command have done what I wanted it to do seeing as the script itself doesn't do much, other that tell ffmpeg which files to convert. That is, it's ffmpeg that is using the resources. Or does 'nice' make all the children of a script have the same priority as the parent process? Last edited by Lunar_Lamp; August 15th, 2006 at 06:13 AM.. |
|
|
|
|
|
#2 |
|
Quad Shot of Ubuntu
![]() Join Date: Feb 2006
Location: San José, Costa Rica
Beans: 456
Ubuntu Jaunty Jackalope (testing)
|
Re: Limit CPU usage of process
You can use the command renice to dinamically assign a new nice value to a running process.
You can define process groups to alter a whole bunch of processes at the same time. Check the docs typing man renice |
|
|
|
|
|
#3 |
|
A Carafe of Ubuntu
![]() Join Date: Aug 2006
Location: UK
Beans: 100
Ubuntu 9.10 Karmic Koala
|
Re: Limit CPU usage of process
I think (but don't quote me!) that if you assign a nice value to a process any child processes from that are given the same nice value. i.e. If you renice the original script process then everytime that starts off the next ffmpeg instance that should have the same nice value.
|
|
|
|
|
|
#4 |
|
Quad Shot of Ubuntu
![]() Join Date: May 2006
Beans: 414
Ubuntu 6.10 Edgy
|
Re: Limit CPU usage of process
Thanks a lot!
|
|
|
|
|
|
#5 |
|
5 Cups of Ubuntu
![]() Join Date: Oct 2006
Location: Sweden
Beans: 12
Ubuntu 7.04 Feisty Fawn
|
Re: Limit CPU usage of process
I'd suggest using the utility 'cpulimit'.
sudo apt-get install cpulimit man cpulimit |
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|