sidux.com
Menu

News

Give back
Last 3 Contributions
30-11-2008 20.00
25-11-2008 100.00
25-11-2008 20.00

Donate


Sponsor
hetzner.de

Languages
Preferred language:



Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
michaa
Post subject: customize "nice" an application  PostPosted: Jul 11, 2007 - 10:38 AM



Joined: Dec 02, 2006
Posts: 1707
Location: Germany / NRW
Status: Offline
Hi,

is it possible to edit the default nice value of an application, i.e. is it possible to start an application/process like kio_fish or kio_file with an other nice value than "0". May I customize an save this?

I know how to change the nice parameter with htop, but with the above mentioned processes I'd like to give them less priority each time I use it because otherwise it is no fun to work with the comp while copying (a) large file(s) from my server to my ws.

So is it possible? How?
 
 View user's profile Send private message  
Reply with quote Back to top
Ge0rgy
Post subject: RE: customize "nice" an application  PostPosted: Jul 11, 2007 - 10:51 AM



Joined: Dec 04, 2006
Posts: 554

Status: Offline
well, kio-slaves are not exactly independent programs, but rather sort of a plugin for konqueror.

concerning programs i would suggest writing a little script that starts the program with nice level. but in such a case im not sure how to control this (must be a setting in KDE itself)

normally they should not have a that hard impact on the system-performance. but io-scheduling in the kernel is getting better.
perhaps something network or HDD-related keeps the system busy and causes the slowdown.
you can try using other programs at first to find out if only the kio-slaves show that behavior, or if the whole system is problematic.

greetings.
me
 
 View user's profile Send private message  
Reply with quote Back to top
severin
Post subject: RE: customize "nice" an application  PostPosted: Jul 11, 2007 - 11:27 AM



Joined: Dec 04, 2006
Posts: 1238

Status: Offline
have you ever tried about renicing konqueror?
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
michaa
Post subject: Re: RE: customize "nice" an application  PostPosted: Jul 11, 2007 - 11:54 AM



Joined: Dec 02, 2006
Posts: 1707
Location: Germany / NRW
Status: Offline
severin wrote:
have you ever tried about renicing konqueror?


This was what I did first ... and it worked well. So my question is not explicitly conected to kio_xy. It is only about how an where to customise whatever application with an other nice value and save this a default.

With my 900 duron / 512 RAM copying a file from my home server to my ws means ... waiting or use a slow motion pc. But it is the same with **multimedia** doing something. Each cpu intensiv action slows down my system so much that I really is no fun to work with. With windows ( I have to mention it ) you may give the application in foreground the most priority by default, a feature I miss heavily in linux.
 
 View user's profile Send private message  
Reply with quote Back to top
devil
Post subject: Re: RE: customize "nice" an application  PostPosted: Jul 11, 2007 - 12:22 PM
Team Member


Joined: Nov 24, 2006
Posts: 2872
Location: berlin
Status: Offline
htop allows to set nice levels, but i never used it (no need so far)

greetz
devil

_________________
>>we are sidux - resistance is futile - you will be assimilated<<
 
 View user's profile Send private message  
Reply with quote Back to top
michaa
Post subject: Re: RE: customize "nice" an application  PostPosted: Jul 11, 2007 - 12:42 PM



Joined: Dec 02, 2006
Posts: 1707
Location: Germany / NRW
Status: Offline
@ devil

I know that, but I'd like to save it
 
 View user's profile Send private message  
Reply with quote Back to top
severin
Post subject: RE: Re: RE: customize "nice" an application  PostPosted: Jul 11, 2007 - 01:14 PM



Joined: Dec 04, 2006
Posts: 1238

Status: Offline
I found something in a gentoo forum, not very elegant though: they said to create a wrapper bash script around konqueror

Maybe somebody else knows something nicer (SCNR)
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
craigevil
Post subject: RE: Re: RE: customize "nice" an application  PostPosted: Jul 11, 2007 - 01:45 PM



Joined: Nov 30, 2006
Posts: 597
Location: USA
Status: Offline
You can always try AND:
auto nice daemon
Quote:
The auto nice daemon activates itself in certain intervals and renices jobs according to their priority and CPU usage. Jobs owned by root are left alone. Jobs are never increased in their priority.

If you need to increase the priority of a job, like cdrecord or MP3 or DVD players, this isn't really a job for and(8) but for a wrapper. Due to popular demand, I wrote such a wrapper. Get the code.

AND is very flexible. The renice intervals can be adjusted as well as the default nice level and the activation intervals. A priority database stores user/group/job/ancestor tuples along with their renice values for three CPU usage time ranges. Negative nice levels are interpreted as signals to be sent to a process, triggered by CPU usage; this way, Netscapes going berserk can be killed automatically. The strategy for searching the priority database can be configured.

AND also provides network-wide configuration files with host-specific sections, as well as wildcard/regexp support for commands in the priority database.


It is in the Debian repos. Using AND along with preload and prelink my system flies.

_________________
Debian Tips My Debian sources.list
"If you can't apt-get something, it isn't useful or doesn't exist"
 
 View user's profile Send private message Yahoo Messenger MSN Messenger  
Reply with quote Back to top
michaa
Post subject: RE: Re: RE: customize "nice" an application  PostPosted: Jul 11, 2007 - 02:20 PM



Joined: Dec 02, 2006
Posts: 1707
Location: Germany / NRW
Status: Offline
@ craigevil

your my hero, I think this is what I missed for a long time now and what my comp needed urgently. I've now installed it and reading about config and priorities.

Could you please be a bit more verbose about preload and prelink?

Thanks


PS: you did miss to mention this Wink :

He did it again, comrade system administrator!
-- desperate Comrade Stanitzki, after some DAU again launched yet another un-niced 100+ CPU-hour job on a shared workstation.

AND is here to help. It was born from the desparate cries of a thousand regular users suffering from above DAU.

( in my case: ...cries of one user suffering from some cpu consuming application )


Last edited by michaa on Jul 11, 2007 - 02:32 PM; edited 1 time in total
 
 View user's profile Send private message  
Reply with quote Back to top
severin
Post subject: RE: Re: RE: customize "nice" an application  PostPosted: Jul 11, 2007 - 02:26 PM



Joined: Dec 04, 2006
Posts: 1238

Status: Offline
@craigevil: I've just briefly read up on prelink (from the gentoo documentation). It seems to re-write my binaries, so I'd think it's necessary to run it after every dist-upgrade; besides I'd think it takes a long time to have it prelink the entire system; these two things seem to make it very unsuitable to anything but debian stable. Could you comment a little on this?

Where do you set your "KDE_IS_PRELINKED="true"" ? I tried exporting it from /etc/init.d/bootmisc.sh, but bash doesn't see it?

EDIT: looks like /etc/profile is the correct place to set environment variables in debian
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
craigevil
Post subject: RE: Re: RE: customize "nice" an application  PostPosted: Jul 13, 2007 - 02:05 PM



Joined: Nov 30, 2006
Posts: 597
Location: USA
Status: Offline
Put this command into terminal to install Prelink:

su apt-get install prelink

3. Now put this command into the terminal:

su kedit /etc/default/prelink


4. Change where it says “PRELINKING=unknown” from unknown to “yes”
5. Adjust the other options if you know what the heck you’re doing. If it looks foreign to you, the defaults work well.
6. To start the first prelink (the longest one!), put this in terminal:

su prelink -vAm

Automatic Prelinking After Program Are Installed

One problem with prelinking in that when you install new programs those programs are not prelinked. So to avoid this problem when installing programs with apt-get or synaptic, use the directions below.

1. Put this in terminal:

kdesu kedit /etc/apt/apt.conf

2. When the file opens in Kedit, put this line at the end of the file and save (even if the file has no content before you add the line):

DPkg::Post-Invoke {”echo Running prelink, please wait…;/etc/cron.daily/prelink”;}

General Notes About Prelinking

In the future, prelink performs a quick prelink (a less-than-1-minute procedure on most systems) daily, usually at midnight. Every 14 days, or whatever you changed it to be, a full prelink will run.

If you just did a major apt-get upgrade that changed systemwide libraries (i.e. libc6, glibc, major gnome/X libs, etc etc etc) and experience cryptic errors about libs, rerun step 6.

To undo prelink, change step 4 from yes to no, then rerun step 6.

Prelinking will make the binaries it prelinks change, so it’s not appropriate if you have tripwire or another checksum-based IDS system, or if you do incremental or differential backups to save on space.

prelink
http://www.linuxcommand.org/man_pages/prelink8.html

Most people that run Sid do not recommend using prelink, that said I have used it since I first installed Kanotix almost 3 yrs ago with no problems.

"preload is an adaptive readahead daemon. It monitors applications that users run, and by analyzing this data, predicts what applications users might run, and fetches those binaries and their dependencies into memory for faster startup times."
http://sourceforge.net/projects/preload

_________________
Debian Tips My Debian sources.list
"If you can't apt-get something, it isn't useful or doesn't exist"
 
 View user's profile Send private message Yahoo Messenger MSN Messenger  
Reply with quote Back to top
DeepDayze
Post subject: RE: Re: RE: customize "nice" an application  PostPosted: Jul 13, 2007 - 02:31 PM



Joined: Dec 02, 2006
Posts: 1909

Status: Offline
Prelink's a lot like WinXP's Prefetch it appears, as the mechanism behind both prelink and prefetch are similar in both implementations
 
 View user's profile Send private message  
Reply with quote Back to top
severin
Post subject: Re: RE: Re: RE: customize "nice" an application  PostPosted: Jul 16, 2007 - 07:54 AM



Joined: Dec 04, 2006
Posts: 1238

Status: Offline
craigevil wrote:
kdesu kedit /etc/apt/apt.conf

2. When the file opens in Kedit, put this line at the end of the file and save (even if the file has no content before you add the line):

DPkg::Post-Invoke {”echo Running prelink, please wait…;/etc/cron.daily/prelink”;}
I could not get this to work due to the blanks in "Running prelink, please wait...". I guess it's just a matter of protecting the string by the right type of quotation marks, but for the time being I changed it to "Prelinking..."

EDIT: This one works:
Code:
DPkg::Post-Invoke {"echo Running prelink, please wait...";"/etc/cron.daily/prelink";};
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2007 The PNphpBB Group
Credits
 
Logos and trademarks are the property of their respective owners, comments are property of their posters, the rest is © 2006-2008 by sidux e.V., 10407 Berlin, Kniprodestr. 104. sidux e.V. is a Berlin, Germany based non-profit foundation. Consult Impressum and Legal Terms for details. sidux™ is Free Software released under the GNU/GPL license and other compatible licenses.
powered by Zikula & Zafenio