FedoraForum.org - Fedora Support Forums and Community
Page 1 of 2 12 LastLast
Results 1 to 15 of 27
  1. #1
    Join Date
    Oct 2009
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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?

  2. #2
    PabloTwo's Avatar
    PabloTwo is offline "Fedora User" T-Shirt Winner
    Join Date
    Mar 2007
    Location
    Seville, FL
    Posts
    8,919
    Mentioned
    39 Post(s)
    Tagged
    0 Thread(s)

    Re: How to prioritize tasks?

    Code:
    man nice
    man renice
    info coreutils 'nice invocation'

  3. #3
    Join Date
    Oct 2009
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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.

  4. #4
    Join Date
    Jun 2009
    Location
    Netherlands
    Age
    35
    Posts
    290
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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).

  5. #5
    Join Date
    Jul 2006
    Location
    Montana
    Posts
    733
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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

  6. #6
    Join Date
    Oct 2009
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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

  7. #7
    Join Date
    Jan 2010
    Posts
    8,698
    Mentioned
    41 Post(s)
    Tagged
    0 Thread(s)

    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.

  8. #8
    Join Date
    Jun 2009
    Location
    Netherlands
    Age
    35
    Posts
    290
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to prioritize tasks?

    Quote Originally Posted by witek
    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.

  9. #9
    Join Date
    Aug 2009
    Location
    Waldorf, Maryland
    Posts
    7,343
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to prioritize tasks?

    Note: within a cgroup nice works normally.

  10. #10
    Join Date
    Oct 2009
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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?

  11. #11
    Join Date
    Aug 2009
    Location
    Waldorf, Maryland
    Posts
    7,343
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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.

  12. #12
    Join Date
    Oct 2009
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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.

  13. #13
    Join Date
    Aug 2009
    Location
    Waldorf, Maryland
    Posts
    7,343
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to prioritize tasks?

    You can always start them in the same CLI, just put them into the background.

  14. #14
    Join Date
    Oct 2009
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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.

  15. #15
    Join Date
    Aug 2009
    Location
    Waldorf, Maryland
    Posts
    7,343
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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.

Page 1 of 2 12 LastLast

Similar Threads

  1. Scheduled tasks
    By jroa1 in forum Using Fedora
    Replies: 4
    Last Post: 14th January 2011, 02:39 AM
  2. Automating tasks
    By cutesneakers in forum Using Fedora
    Replies: 2
    Last Post: 22nd July 2005, 04:21 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •