Colin Anderson
2004-Nov-25 11:02 UTC
[Asterisk-Users] Opinions on renice or turning off swap or ramdis k as swap?
I have 4 gig in my * box. I'm tuning for performance and I'd like to ask opinions: 1. asterisk -p == renice -20 ?? 2. I've turned off swap with no apparent ill effects. Can anyone commment on long term effects with moderate load (say, 30 SIP phones / 2-3K calls /day) 3. Can anyone comment on using ramdisk as swap and whether this is a good idea or bad idea? I'm using 2.6 kernel. I've modified the PCI latency in rc.local: setpci -v -s <my T100P address> latency_timer=ff Anyone else have any performance tips?
Steven Critchfield
2004-Nov-25 11:15 UTC
[Asterisk-Users] Opinions on renice or turning off swap or ramdis k as swap?
On Thu, 2004-11-25 at 11:02 -0700, 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 ??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.> 2. I've turned off swap with no apparent ill effects. Can anyone commment on > long term effects with moderate load (say, 30 SIP phones / 2-3K calls /day)What did you expect to get by that? Linux will swap out anything not being used but will keep what it needs. What you have done is make it more likely in a crunch, your machine will fall over instead of trying to gracefully handle the load.> 3. Can anyone comment on using ramdisk as swap and whether this is a good > idea or bad idea?Swap in ram? Why not use the ram for ram?> I'm using 2.6 kernel. I've modified the PCI latency in rc.local: > > setpci -v -s <my T100P address> latency_timer=ff > > Anyone else have any performance tips?Sounds like you need a beginers book on OS design or even a simple linux/unix admin book. -- Steven Critchfield <critch@basesys.com>
Joe Greco
2004-Nov-25 11:35 UTC
[Asterisk-Users] Opinions on renice or turning off swap or ramdis
> I have 4 gig in my * box. I'm tuning for performance and I'd like to ask > opinions:Bear in mind I come from a FreeBSD background. Linux might behave differently.> 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.> 2. I've turned off swap with no apparent ill effects. Can anyone commment on > long term effects with moderate load (say, 30 SIP phones / 2-3K calls /day)Unless Linux has a really poor swap strategy, this is a terrible idea. Even a mediocre swap implementation will begin swapping out lightly used pages when memory starts getting short. That swapping out actually *frees* memory up, memory needed by active processes. Turning off swap merely causes the system to work harder, and in the event the case where a lot of unexpected memory is being used, you're forced to keep it all in core - probably denying memory requests to processes that need them. What about when Asterisk has a really slow memory leak, growing a meg a day? In normal system design, while this is not desirable, it is simply swapped out to disk, and life goes on (at least for a lot longer than the without-swap case). Turn on swap. Turn on *big* swap. Set an alarm on swap so you're notified of any significant amount of paging. That's the best of all worlds.> 3. Can anyone comment on using ramdisk as swap and whether this is a good > idea or bad idea?RAMDISK as in something like a hardware RAMDISK? Go ahead, but you're throwing away money. Figuring out why a system with 4GB of memory and is only running Asterisk is swapping is a cheaper fix. A software RAMDISK? No way. You're eating up system RAM to provide for the lack of ... system RAM. Not smart.> I'm using 2.6 kernel. I've modified the PCI latency in rc.local: > > setpci -v -s <my T100P address> latency_timer=ff > > Anyone else have any performance tips?Carefully profile your system to find out where the bottlenecks really are. Then get out the Attitude Adjuster (BOFH's find that it works nearly as well on systems as it does on people). Then go buy a system with none of those bottlenecks. ;-) ... JG -- Joe Greco - sol.net Network Services - Milwaukee, WI - http://www.sol.net "We call it the 'one bite at the apple' rule. Give me one chance [and] then I won't contact you again." - Direct Marketing Ass'n position on e-mail spam(CNN) With 24 million small businesses in the US alone, that's way too many apples.
Peter Svensson
2004-Nov-25 13:10 UTC
[Asterisk-Users] Opinions on renice or turning off swap or ramdis k as swap?
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 ??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.> 2. I've turned off swap with no apparent ill effects. Can anyone commment on > long term effects with moderate load (say, 30 SIP phones / 2-3K calls /day)Turning off swap means that the only page-freeing operation left is demand paging of binaries. I.e. program text pages (the actual program that is) are discarded and reloaded. This can be a rather bad idea. Asterisk should stay resident in memory under normal circumstances. There can be a problem if you are running an ide disk and have unmasq irq turned off. In that case disk accesses will definitly hurt you. For any hardware from this side of the millenium unmasq irq should be safe.> 3. Can anyone comment on using ramdisk as swap and whether this is a good > idea or bad idea?That is a bad idea. Use the ram as ram instead.> I'm using 2.6 kernel. I've modified the PCI latency in rc.local: > > setpci -v -s <my T100P address> latency_timer=ffAre you sure that is a good idea? That only makes the T100 hold the bus longer. If my memory serves me the T100P is not bus mastering. I don't think the pci latency value for it is relevant, but I am not sure. I do believe the latency values of the other devices is at least as important. The T100P does not need to transfer many bytes at a time, but it does need to transfer them as soon as possible when they are ready. Peter
Gilad Ben-Yossef
2004-Nov-28 01:39 UTC
[Asterisk-Users] Opinions on renice or turning off swap or ramdis k as swap?
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> 2. I've turned off swap with no apparent ill effects. Can anyone commment on > long term effects with moderate load (say, 30 SIP phones / 2-3K calls /day)Don't do that. Swap can be useful to allow the kernel to organize memory a little better and avoid fragmentation.> > 3. Can anyone comment on using ramdisk as swap and whether this is a good > idea or bad idea?Very bad idea. Linux memory management is much smarter then DOS, from which you got this idea, I assume.> Anyone else have any performance tips?Disable any interrupts not needed on the system. Specifically, use NAPI enabled network device drivers and turn NAPI on. Gilad -- Gilad Ben-Yossef <gilad@codefidence.com> Codefidence. A name you can trust(tm) Web: http://codefidence.com | SIP: gilad@pbx.codefidence.com Tel: +972.9.8650475 ext. 201 | Fax: +972.9.8850643 "I am Jack's Overwritten Stack Pointer" -- Hackers Club, the movie
Possibly Parallel Threads
- Changing NICE value for * will it help?
- How do I match a "D"? (Was: RE: In-band disc onn ect problem (legacy PBX) - asterisk doesn't hear the touchtone?)
- Compatibility Issues with dell poweredge 1950 and TE110P card
- Something every TDMP user should know
- redhat9 100% CPU