 |
 |
 |
 |
| Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum. |

14th July 2011, 02:33 PM
|
 |
Registered User
|
|
Join Date: Oct 2009
Posts: 107

|
|
|
How to prioritize tasks?
Hello,
Assume I`m a newbie and I want to run two CPU-consuming tasks but with different priorities - I mean one to get more CPU time that the other. How to achieve this in Fedora?
|

14th July 2011, 02:56 PM
|
 |
"Registered User" T-Shirt Winner
|
|
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,128

|
|
|
Re: How to prioritize tasks?
Code:
man nice
man renice
info coreutils 'nice invocation'
|

14th July 2011, 03:10 PM
|
 |
Registered User
|
|
Join Date: Oct 2009
Posts: 107

|
|
|
Re: How to prioritize tasks?
PabloTwo, you are wrong. Nice does not work in Fedora. That is why I`m asking. If you don`t believe do a simple test and try to schedule two cpu-consuming tasks with nice.
|

14th July 2011, 03:50 PM
|
|
Registered User
|
|
Join Date: Jun 2009
Location: Netherlands
Age: 21
Posts: 279

|
|
|
Re: How to prioritize tasks?
This is where CGroups come in (I think):
Click here to read more about it.
And I believe RedHat has pretty good documentation on it (you have to register for an account though).
|

14th July 2011, 04:03 PM
|
 |
Registered User
|
|
Join Date: Jul 2006
Location: Montana
Posts: 731

|
|
|
Re: How to prioritize tasks?
Quote:
Originally Posted by witek
Hello,
Assume I`m a newbie and I want to run two CPU-consuming tasks but with different priorities - I mean one to get more CPU time that the other. How to achieve this in Fedora?
|
I also pointed you to cgroups in your other thread on this issue
__________________
If it is not broken, tweak it... If you break Fedora you get to keep both pieces :p
|

14th July 2011, 07:39 PM
|
 |
Registered User
|
|
Join Date: Oct 2009
Posts: 107

|
|
|
Re: How to prioritize tasks?
Well, I understand that cgroups are making their impressive entrance but why nobody said it loud and clear that such a well established, well known and simple to use tool as 'nice' is no longer valid?
Can anyone confirm that introduction of cgroups is equivalent to ditch 'nice' ? I can`t believe that and I`ve just issued a bug: https://bugzilla.redhat.com/show_bug.cgi?id=721416
RedHat documentation on cgroups might be good but this one seems better:
https://wiki.archlinux.org/index.php/Cgroups
|

14th July 2011, 08:02 PM
|
|
Registered User
|
|
Join Date: Jan 2010
Posts: 4,980

|
|
|
Re: How to prioritize tasks?
I've added a comment on the bug. Rahul and Bill Nottingham (who commented on your bug) are usually really good about getting these things knows. (From Bill's comment on the bug though, I'm not sure if I'm missing something).
In fairness, though this seems like a glaring omission, when you consider the major changes which the vast majority of users are getting upset about, such as the whole gnome3 thing, it's one of those that's probably easy to overlook till you use it. I suspect those taking care of of release notes and common bugs might not have run into it yet.
If this is what Bill's comment meant (that nice is no longer effective), then yes, more mention should be made of it.
|

14th July 2011, 08:36 PM
|
|
Registered User
|
|
Join Date: Jun 2009
Location: Netherlands
Age: 21
Posts: 279

|
|
|
Re: How to prioritize tasks?
Quote:
Originally Posted by witek
|
Thanks for this. This is a nice overview.
|

14th July 2011, 08:49 PM
|
|
Registered User
|
|
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,108

|
|
|
Re: How to prioritize tasks?
Note: within a cgroup nice works normally.
|

15th July 2011, 05:54 AM
|
 |
Registered User
|
|
Join Date: Oct 2009
Posts: 107

|
|
|
Re: How to prioritize tasks?
Quote:
Originally Posted by jpollard
Note: within a cgroup nice works normally.
|
So maybe some initial configuration should be made in /etc/cgconfig.conf during Fedora installation?
|

15th July 2011, 01:56 PM
|
|
Registered User
|
|
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,108

|
|
|
Re: How to prioritize tasks?
Perhaps.
But you do need to remember that it will depend on how the processes are started.
I believe that if both processes are started in a command shell, they will both be in the same cgroup.
In their infinite wisdom... the gnome/fedora developers are trying to make every process started via the menu will get its own cgroup, customized to the class of process. This way they can give "interactive" processes (namely the GUI) more CPU than others.
I seem to remember that the terminal/CLI gets its own cgroup. What happens between two terminal/CLI instances I don't know. They may be in the same cgroup, but could also be in separate instances. If they are in separate instances, then different nice values for processes started (one in each) will have no effect. There will only be one process in the cgroup - and it will get all of the cpu time allocated to the cgroup. And since the two processes would be in different cgroups, each would get all of the time allocated to that cgroup, making the nice value useless.
|

15th July 2011, 02:22 PM
|
 |
Registered User
|
|
Join Date: Oct 2009
Posts: 107

|
|
|
Re: How to prioritize tasks?
Quote:
Originally Posted by jpollard
I seem to remember that the terminal/CLI gets its own cgroup. What happens between two terminal/CLI instances I don't know. They may be in the same cgroup, but could also be in separate instances.
|
It looks they are in separate instances.I started my processes from two different terminals when nice was ignored. It is buggy behavior anyway for me. Nice should work despite.
|

15th July 2011, 02:25 PM
|
|
Registered User
|
|
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,108

|
|
|
Re: How to prioritize tasks?
You can always start them in the same CLI, just put them into the background.
|

15th July 2011, 02:58 PM
|
 |
Registered User
|
|
Join Date: Oct 2009
Posts: 107

|
|
|
Re: How to prioritize tasks?
Unfortunately I don`t want to put them in the background as the processes spit out some information on the console.
|

15th July 2011, 03:34 PM
|
|
Registered User
|
|
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,108

|
|
|
Re: How to prioritize tasks?
Ok. One other approach.
From the first terminal window, start a second from the CLI (or if gnome terminal, from the menu).
Now both terminal windows will be in the same cgroup.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Similar Threads
|
| Thread |
Thread Starter |
Forum |
Replies |
Last Post |
|
Scheduled tasks
|
jroa1 |
Using Fedora |
4 |
14th January 2011 01:39 AM |
|
Automating tasks
|
cutesneakers |
Using Fedora |
2 |
22nd July 2005 04:21 PM |
Current GMT-time: 10:09 (Saturday, 25-05-2013)
|
|
 |
 |
 |
 |
|
|