By default asterisk (on my system) runs with NICE value "0" like most of the programs. Will the performance improve if I assign NICE value of let say -5 or -10 to asterisk? To my understanding it should as the priority will be higher than most other programs (it might even solve some echo problem). Am I right? How to start asterisk with priority let say -5? If I start the main process with higher priority will subprocesses receive the same NICE value? -- #Joseph
Colin Anderson
2004-Dec-09 12:41 UTC
[Asterisk-Users] Changing NICE value for * will it help?
>How to start asterisk with priority let say -5? >If I start the main process with higher priority will subprocesses >receive the same NICE value?Short answer, which I have learned, is don't NICE it. Use asterisk -p instead Long answer: Reposting the well-reasoned answers to my related question 2 weeks ago, thanks Peter S, Gilad Ben-Yossef, Joe Greco, and yes, even Mr. Critchfield: On Thu, 25 Nov 2004, Colin Anderson wrote:> I have 4 gig in my * box. I'm tuning for performance and I'd like to ask > opinions: > > 1. asterisk -p == renice -20 ??[Peter S] The -p option sets asterisk to realtime priority if possible. This is different from the traditional unix nice levels. A program with realtime priorities will _never_ be preempted by a normal program. A program with the traditional unix nicelevel of -20 will give up some time slots to lower priority programs. This has advantages (scheduling of packets are much better e.g.) and disadvantages (a broken asterisk server will leave the system impossible to log in to). The disadvantage can be soften by keeping a shell open with realtime priority (higher) around. Running with -p does help a lot for VoIP stuff. Note that this is user-space (pseudo) realtime stuff. Lowlatency patches for the kernel can give better response time for the zaptel drivers as well. This is orthogonal. [Gilad Ben-Yossef] Colin Anderson wrote:> I have 4 gig in my * box. I'm tuning for performance and I'd like to ask > opinions: > > 1. asterisk -p == renice -20 ??What asterisk -p does is mark the aterisk process as a POSIX real time priority process. Unless you have other process marked in the same way, the scheduling algorithm will prefer this process to others at all times. which means that if is not blocking, it will be the running process. I've been running like this with Asterisk for a couple of month with no ill effects except that some error conditions cal cause asterisk to go into a loop which will effectively freeze all user space activity on the machine. I keep a shell set to a higher real time priority then asterisk on the machine for these cases. You can use the following tool to get a real time priority shell: http://projects.codefidence.com/realtime.html [Joe Greco]> I have 4 gig in my * box. I'm tuning for performance and I'd like to ask > opinions: > 1. asterisk -p == renice -20 ??Why? If you have other things running on the machine, get a dedicated box for Asterisk. It might make sense to give it a mildly elevated priority, but running it at -20 might cause problems if you needed to get in and administer a runaway server. [Peter Critchfield]> 1. asterisk -p == renice -20 ??Unless you have done something not very smart like putting a DB on your asterisk machine, reniceing asterisk isn't going to give you more clock cycles.
Seemingly Similar Threads
- Opinions on renice or turning off swap or ramdis k as swap?
- How do I match a "D"? (Was: RE: In-band disc onn ect problem (legacy PBX) - asterisk doesn't hear the touchtone?)
- redhat9 100% CPU
- how to call s extension from SIP phone?
- How do I match a "D"? (Was: RE: In-band disconn ect problem (legacy PBX) - asterisk doesn't hear the touchtone?)