FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 11-24-2010, 04:37 AM
Matthias Andersson
 
Default How to set default nice level for an application

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!

I want to make thunderbird always start with a nice level of 20 instead
of the default 0. What is the easiest way of achieving this?

I had a look at /etc/security/limits.conf which was mentioned in some
forum posts but that didn't really serve this purpose.

Cheers,
Matthias
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJM7KSbAAoJEDF8u+ZDBCZ5pWcIAMc7RIdVPN MbGa8WonCGDooO
DScKKncAVmWiKD0qeTfcMTgPiIERL++RnqVbd87+R17kRVuCS4 gNyGXNbcXdGku8
xUDF70UKT5dkoE1ukikzU655G32hAwZ4cW/LC5Hg4LBylsLgbmAQs5ZpH+OvpoOV
gJ/XS8rnPHLq4k+K7I4+KH/JrEeACSozWVKGISVES2RMtXD5JZq/rFV4DYW4JCj8
nPyCSIkfNjQkfM12jz0hv1TxDv/SkCm5p4xZMZZhqJwaN+puaZgqCC5jOB294Ijb
Pwc1Uj9rs7ICo/SrhDTJg3w2KKi5EUtRupfZ0bws+fctHEumEBII/phuTrLRcE0=
=rNvc
-----END PGP SIGNATURE-----

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 11-24-2010, 05:05 AM
Luis Paulo
 
Default How to set default nice level for an application

On Wed, Nov 24, 2010 at 05:37, Matthias Andersson
<matthias.andersson@pp1.inet.fi> wrote:
> Hi!
>
> I want to make thunderbird always start with a nice level of 20 instead
> of the default 0. What is the easiest way of achieving this?
>
> I had a look at /etc/security/limits.conf which was mentioned in some
> forum posts but that didn't really serve this purpose.
>
> Cheers,
> Matthias

Why not the obvious? Just run
$ nice -n 20 thunderbird

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 11-24-2010, 05:09 AM
Nils Kassube
 
Default How to set default nice level for an application

Matthias Andersson wrote:
> I want to make thunderbird always start with a nice level of 20
> instead of the default 0. What is the easiest way of achieving this?

The nice level range doesn't include 20 (see "man nice"). Do you mean
-20 (highest priority) or 19 (lowest priority)? If you mean -20, I have
no idea because only root can raise the priority and I would never
suggest to run thunderbird as root. But if you mean 19, I would suggest
you create a starter for thunderbird on your desktop which starts the
command

/usr/bin/nice -19 /usr/bin/thunderbird

and maybe you should also consider using ionice (see "man ionice") which
would make the command:

/usr/bin/nice -19 /usr/bin/ionice -c3 /usr/bin/thunderbird


Nils

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 11-24-2010, 05:32 AM
Matthias Andersson
 
Default How to set default nice level for an application

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 11/24/2010 08:09 AM, Nils Kassube wrote:
> Matthias Andersson wrote:
>> I want to make thunderbird always start with a nice level of 20
>> instead of the default 0. What is the easiest way of achieving this?
>
> The nice level range doesn't include 20 (see "man nice"). Do you mean
> -20 (highest priority) or 19 (lowest priority)? If you mean -20, I have
> no idea because only root can raise the priority and I would never
> suggest to run thunderbird as root. But if you mean 19, I would suggest
> you create a starter for thunderbird on your desktop which starts the
> command
>
> /usr/bin/nice -19 /usr/bin/thunderbird
>
> and maybe you should also consider using ionice (see "man ionice") which
> would make the command:
>
> /usr/bin/nice -19 /usr/bin/ionice -c3 /usr/bin/thunderbird
>
>
> Nils
>

Sorry, I meant level 19. I have run the command renice -n 19 -p <pid>
to set thunderbird to run at a higher nice level. However, is there some
way of doing this automagically?

//Matthias
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJM7LGVAAoJEDF8u+ZDBCZ5FrgIAKj/DspJlSU0Slcznb/IYxEu
rh6O3kMy5V67vf8y82vctLfDUuXPefTHdomm6h5vtdIVptsbXO YOkcTgu1nzPGth
S5vGzAoRZHqlizOgelQTqkT5zB29/yI7vEqYXhAAVq6ofUirMmOyqaE5XjYYQVwa
fX1WhrU1qM5tptvy8zzVno+FL4E72yTzPJDSuKcXeb1R7YJTRw pxAznbfdHOJ/iA
pUvWsxLrcF00w6IRspcvEPKZoArqEA1dWT4TLynSArNxD8hZLY pBNQexTN0POSXj
3ohpVryu3cZhv5Vo8n9w4SP65WvFLP4ccY0aqHKH0Fx/PY38lRrAaByULeA4/D4=
=Kk3E
-----END PGP SIGNATURE-----

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 11-24-2010, 05:54 AM
Basil Chupin
 
Default How to set default nice level for an application

On 24/11/2010 16:37, Matthias Andersson wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi!
>
> I want to make thunderbird always start with a nice level of 20 instead
> of the default 0. What is the easiest way of achieving this?
>

OK, first time I am hearing about 'nice'.

What's the advantage of running something like TB ( or anything else for
that matter) with a different 'nice level'?

BC


--
Attorney: Doctor, do you recall the time that you examined the body?
Witness: The autopsy started at 2030 hours.
Attorney: And Mr. Denton was dead at the time?
Witness: If not, he was by the time I finished.


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 11-24-2010, 07:43 AM
Mark
 
Default How to set default nice level for an application

On Tue, Nov 23, 2010 at 10:54 PM, Basil Chupin <blchupin@iinet.net.au> wrote:
>
> OK, first time I am hearing about 'nice'.
>
> What's the advantage of running something like TB ( or anything else for
> that matter) with a different 'nice level'?
>
Nice is the kernel's way of prioritizing processes for scheduling.
The higher the nice number, the more the process is deemed to be
"nice" to other processes, thereby lowering their priority. Most
normal processes run at nice level 0, and this is adjusted up or down
automatically by the kernel as it cycles through the scheduling. The
more a process needs i/o, the less nice it gets, and the more CPU the
process uses, the nicer it gets. Certain system processes run at
lower and lower niceness levels (higher and higher priority) depending
on their needs.

I'd bet there's a good write-up on this somewhere on the web, but
that's the basic idea.

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 11-24-2010, 08:05 AM
Doug
 
Default How to set default nice level for an application

On 11/24/2010 03:43 AM, Mark wrote:
> On Tue, Nov 23, 2010 at 10:54 PM, Basil Chupin<blchupin@iinet.net.au> wrote:
>> OK, first time I am hearing about 'nice'.
>>
>> What's the advantage of running something like TB ( or anything else for
>> that matter) with a different 'nice level'?
>>
> Nice is the kernel's way of prioritizing processes for scheduling.
> The higher the nice number, the more the process is deemed to be
> "nice" to other processes, thereby lowering their priority. Most
> normal processes run at nice level 0, and this is adjusted up or down
> automatically by the kernel as it cycles through the scheduling. The
> more a process needs i/o, the less nice it gets, and the more CPU the
> process uses, the nicer it gets. Certain system processes run at
> lower and lower niceness levels (higher and higher priority) depending
> on their needs.
>
> I'd bet there's a good write-up on this somewhere on the web, but
> that's the basic idea.
>
Perhaps the above explanation is perfectly clear to some, but maybe it
might make sense to simplify: If you set the "nice" level to -20, that
process
will have absolute priority. Conversely, if you set it to (+) 20, that
process
will have the lowest priority, thus being "nice" to everything else and
letting everything else have first shot at the cpu.

--doug

--
Blessed are the peacemakers...for they shall be shot at from both sides. --A. M. Greeley


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 11-24-2010, 04:51 PM
Nils Kassube
 
Default How to set default nice level for an application

Matthias Andersson wrote:
> On 11/24/2010 08:09 AM, Nils Kassube wrote:
> > But if you mean
> > 19, I would suggest you create a starter for thunderbird on your
> > desktop which starts the command
> >
> > /usr/bin/nice -19 /usr/bin/thunderbird
> >
> > and maybe you should also consider using ionice (see "man ionice")
> > which would make the command:
> >
> > /usr/bin/nice -19 /usr/bin/ionice -c3 /usr/bin/thunderbird
>
> Sorry, I meant level 19. I have run the command renice -n 19 -p <pid>
> to set thunderbird to run at a higher nice level. However, is there
> some way of doing this automagically?

Yes, it could be done with a script like this (untested):

#!/bin/bash
while true;do
pids=$(/bin/pidof thunderbird)
test -z "$pids" || /usr/bin/renice -19 $pids
sleep 1m
done

Make that script executable and make it run at startup. Sorry, I can't
tell you how to do it with Gnome but with KDE you could put the script
in $HOME/.kde/Autostart/. However I would prefer to use a starter like I
wrote in my previous reply. That avoids renicing processes every minute
which are already at level 19 and thunderbird is run with level 19 from
the start.


Nils

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 11-25-2010, 12:21 AM
Luis Paulo
 
Default How to set default nice level for an application

On Wed, Nov 24, 2010 at 06:32, Matthias Andersson
<matthias.andersson@pp1.inet.fi> wrote:
>
> Sorry, I meant level 19. I have run the command renice -n 19 -p <pid>
> to set thunderbird to run at a higher nice level. However, is there some
> way of doing this automagically?
>
> //Matthias

Mathias,
I think if you want to start thunderbird at nice level 19, you should
start thunderbird at nice level 19.
Right?

Regards
Luis

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 11:17 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org