Fedora Linux Support Community & Resources Center
  #1  
Old 14th July 2011, 02:33 PM
witek Offline
Registered User
 
Join Date: Oct 2009
Posts: 115
linuxfirefox
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?
Reply With Quote
  #2  
Old 14th July 2011, 02:56 PM
PabloTwo Offline
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 6,054
linuxfirefox
Re: How to prioritize tasks?

Code:
man nice
man renice
info coreutils 'nice invocation'
Reply With Quote
  #3  
Old 14th July 2011, 03:10 PM
witek Offline
Registered User
 
Join Date: Oct 2009
Posts: 115
linuxfirefox
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.
Reply With Quote
  #4  
Old 14th July 2011, 03:50 PM
roelj Offline
Registered User
 
Join Date: Jun 2009
Location: Netherlands
Age: 22
Posts: 289
linuxsafari
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).
Reply With Quote
  #5  
Old 14th July 2011, 04:03 PM
bodhi.zazen Offline
Registered User
 
Join Date: Jul 2006
Location: Montana
Posts: 731
windows_xp_2003firefox
Re: How to prioritize tasks?

Quote:
Originally Posted by witek View Post
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
Reply With Quote
  #6  
Old 14th July 2011, 07:39 PM
witek Offline
Registered User
 
Join Date: Oct 2009
Posts: 115
linuxfirefox
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
Reply With Quote
  #7  
Old 14th July 2011, 08:02 PM
smr54 Offline
Registered User
 
Join Date: Jan 2010
Posts: 5,479
linuxopera
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.
Reply With Quote
  #8  
Old 14th July 2011, 08:36 PM
roelj Offline
Registered User
 
Join Date: Jun 2009
Location: Netherlands
Age: 22
Posts: 289
linuxfirefox
Re: How to prioritize tasks?

Quote:
Originally Posted by witek View Post
RedHat documentation on cgroups might be good but this one seems better:
https://wiki.archlinux.org/index.php/Cgroups
Thanks for this. This is a nice overview.
Reply With Quote
  #9  
Old 14th July 2011, 08:49 PM
jpollard Online
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,782
linuxfedorafirefox
Re: How to prioritize tasks?

Note: within a cgroup nice works normally.
Reply With Quote
  #10  
Old 15th July 2011, 05:54 AM
witek Offline
Registered User
 
Join Date: Oct 2009
Posts: 115
linuxfirefox
Re: How to prioritize tasks?

Quote:
Originally Posted by jpollard View Post
Note: within a cgroup nice works normally.
So maybe some initial configuration should be made in /etc/cgconfig.conf during Fedora installation?
Reply With Quote
  #11  
Old 15th July 2011, 01:56 PM
jpollard Online
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,782
linuxfedorafirefox
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.
Reply With Quote
  #12  
Old 15th July 2011, 02:22 PM
witek Offline
Registered User
 
Join Date: Oct 2009
Posts: 115
linuxfirefox
Re: How to prioritize tasks?

Quote:
Originally Posted by jpollard View Post
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.
Reply With Quote
  #13  
Old 15th July 2011, 02:25 PM
jpollard Online
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,782
linuxfedorafirefox
Re: How to prioritize tasks?

You can always start them in the same CLI, just put them into the background.
Reply With Quote
  #14  
Old 15th July 2011, 02:58 PM
witek Offline
Registered User
 
Join Date: Oct 2009
Posts: 115
linuxfirefox
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.
Reply With Quote
  #15  
Old 15th July 2011, 03:34 PM
jpollard Online
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,782
linuxfedorafirefox
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.
Reply With Quote
Reply

Tags
prioritize, tasks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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:21 (Monday, 28-07-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat