On Thu, 2005-08-11 at 15:06 +0000, Ian K wrote:
> Joseph wrote:
> 
> >How to list real-time priority in Linux for an application (example
> >asterisk)?
> >
> >  
> >
> Do you mean processor scheduling? "This program deserves more processor
> time/power than others?"
> 
> If so, find out the process ID of the app you want to 'promote' or 'demote'
> and take it with you into a konsole/terminal and type this:
> 
> renice <process ID> <priority>
> 
> The priority is on a scale. -21---0--+21
> The negative priorities are promotions. Giving it a -21 would bring down
> many
> other applications the second they tried to use the processor. I never
> really go
> above ten, either way.
> 
> HTH,
> Ian

I'm not sure if that what they mean with "real-time priority".
All I was able to find out that some of them are running Asterisk with
switch -p; 
so they start asterisk with:
asterisk -p
This is an explanation what -p switch does (from asterisk man):

If supported by the operating system (and executing as root), attempt to
run with realtime  priority for  increased  performance  and
responsiveness within the Asterisk process, at the expense of other
programs running on the same machine.

I now that I could start asterisk with higher priority level; so I
modified the startup script to start asterisk with "nice -15".
But some of the members in asterisk forum insisting that "nice" is not
the same as "real-time priority".

Here are two replies I received form Asterisk forum:
------ reply 1 ------------------
What do you mean with listing real-time priority? You can list process 
priorities with commands like top or "ps -eo pri,nice,%cpu,pid,args 
--sort pri" (for example).

If you're interrested in asterisk's real-time responsiveness, the 
following might be of interrest.

Real-time priority actually doesn't exist in Linux (you'll need to use
a 
real RTOS for that). Still, Linux makes a destinction between processes 
that need sort of real-time response times and processes that don't. 
Controlling this in a direct way is a difficult, if possible at all. 
Prioritizing processes is done on the fly (in real time) by the 
scheduling process in the Linux core.

However, there is a way to manipulate the prioritizing of processes
with 
a command called 'nice'. Normally you use this command (with a positive 
adjustment value) to make a process to behave 'nice' to other
processes. 
That is, it gives the process a lower priority that it would normally 
get, thus making it a relative low priority process. By using nice with 
a negative adjustment (you'll need to be root for that), you're able to 
give a certain process a higher priority than it would normally get, 
thus giving the process more of a 'real-time' priority.

In my experience it proved to be more usefull to give all the
processes, 
that stood in the way of asterisk performance, a positive nice 
adjustment, rather than giving asterisk a negative nice adjustment. I 
haven't tested this thoroughly, so I'm not sure about the reasons for 
this. It could have something to with asterisk getting in the way of 
Linux's core processes when incresing it's priority. Still, it's
nothing 
more than a guess.
--------- end replay 1 ---------------

-------- reply 2 -------------

> Real-time priority actually doesn't exist in Linux 

Sure it does. 

> you'll need to use a real RTOS for that

Thanks to Ingo Molnars' realtime patches, the gnu/linux audio
community runs with latencies sub 1ms.

> Controlling this in a direct way is a difficult, if possible at all

chrt(1)
------- end reply 2 ---------

-- 
#Joseph
-- 
gentoo-user@gentoo.org mailing list

Reply via email to