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?
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?
Code:man nice man renice info coreutils 'nice invocation'
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.
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).
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
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.
Note: within a cgroup nice works normally.
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.
You can always start them in the same CLI, just put them into the background.
Unfortunately I don`t want to put them in the background as the processes spit out some information on the console.
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.