Changes between Version 83 and Version 84 of FAQ
- Timestamp:
- Jan 13, 2010 10:17:28 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
FAQ
v83 v84 947 947 There are few configuration settings to tweak to reduce the CPU usage of the application or to produce the best performance out of pjsip: 948 948 1. '''Echo canceller'''. The software AEC probably is the most CPU intensive module in PJSIP. To reduce the CPU usage, shorten the EC tail length to lower value (the {{{pjsua_media_config.ec_tail_len}}} setting), or even disable it altogether by setting {{{pjsua_media_config.ec_tail_len}}} to zero. 949 1. '''Float vs fixed point'''. If your platform does not support floating point, disable floating point in PJSIP build, by declaring {{{PJ_HAS_FLOATING_POINT}}} to zero in your {{{config_site.h}}}. 949 950 1. '''Codec'''. Use low complexity codec such as ''pcmu'' or ''pcma''. When using ''pcmu'' or ''pcma'', make sure pjmedia chooses the table based implementation, by setting {{{PJMEDIA_HAS_ALAW_ULAW_TABLE}}} macro to 1 (the default is normally enabled, but it may worth double-checking). 950 951 1. '''Avoid resampling'''. Resampling is a CPU intensive process, thus it should be avoided if you can, by choosing uniform clock rate for all media components (sound device, conference bridge, codecs, WAV files, etc.). 951 952 1. '''Choose effective sampling rate'''. Make sure that PJSUA-LIB selects the most effective sampling rate/clock rate for your application. For example, if the application only supports narrowband codecs (G.711, GSM, iLBC, G.723, or G.729), then the best sampling rate to choose would be 8KHz. Choosing higher sampling rate will only just waste CPU power since with higher sampling rate, the more processing is needed. With ''pjsua'', sampling rate can be forced with {{{--clock-rate}}} option. In the application, this can be achieved by setting {{{pjsua_media_config.clock_rate}}} field. 953 1. '''Conference bridge vs audio switchboard'''. If you don't need conferencing, you may want to consider replacing the conference bridge with the [wiki:Nokia_APS_VAS_Direct#switchboard audio switchboard] which is lighter. You will loose conferencing feature, but as a bonus the audio latency will improve. To use the audio switchboard, declare {{{PJMEDIA_CONF_USE_SWITCH_BOARD}}} to non-zero in your {{{config_site.h}}} 952 954 1. '''Logging'''. The default logging level is 5, which provides verbose information just in case some debugging is needed. When absolute performance is needed, you can decrease the logging verbosity level to 3 so that only vital information is displayed. This can be done by, either at compile time by setting {{{PJ_LOG_MAX_LEVEL}}} macro (in {{{config_site.h}}} as usual), or at run-time by calling {{{pj_log_set_level()}}}. 953 955 1. '''Threads'''. Use the optimum number of SIP worker threads in the application. The optimum number would be equal to the number of processors (or processor cores) in the system. … … 958 960 1. '''Hash tolower optimization'''. By setting {{{PJ_HASH_USE_OWN_TOLOWER}}} to one, the hash function will convert the key to lower case and calculate the hash value in one loop. 959 961 1. '''Release mode'''. Don't forget to set the appropriate compiler optimization flag, and disable assertion with '''-DNDEBUG'''. 960 1. '''Float vs fixed point'''. If your platform does not support floating point, disable floating point in PJSIP build, by declaring {{{PJ_HAS_FLOATING_POINT}}} to zero in your {{{config_site.h}}}.961 1. '''Conference bridge vs audio switchboard'''. If you don't need conferencing, you may want to consider replacing the conference bridge with the [wiki:Nokia_APS_VAS_Direct#switchboard audio switchboard] which is lighter. You will loose conferencing feature, but as a bonus the audio latency will improve. To use the audio switchboard, declare {{{PJMEDIA_CONF_USE_SWITCH_BOARD}}} to non-zero in your {{{config_site.h}}}962 962 963 963 === How can I configure pjsip to serve thousands of calls? === #high-perf