Difference between revisions of "Performance Suggestions M4"

From Kolmisoft Wiki
Jump to navigationJump to search
Line 69: Line 69:


M2 Core creates CDR for each call attempt through Terminators. If you enable log_only_last_cdr then only last attempt will be stored to database. This way CDR inserts will be less frequent and database will be smaller.
M2 Core creates CDR for each call attempt through Terminators. If you enable log_only_last_cdr then only last attempt will be stored to database. This way CDR inserts will be less frequent and database will be smaller.
===do_not_log_system_cdrs = 1===
If this setting is enabled then FAILED calls with HGC >= 300 will not be stored to database. This will slightly improve performance by having a smaller database and less frequent inserts to the database.


===do_not_log_failed_cdrs = 1===
===do_not_log_failed_cdrs = 1===


If this setting is enabled then only answered calls will be stored to database. This will greatly improve peformance by having smaller database and less frequent inserts to database.  
If this setting is enabled then only answered calls will be stored in the database. This will slightly improve performance by having a smaller database and less frequent inserts to the database.


===disable_advanced_routing = 1===
===disable_advanced_routing = 1===

Revision as of 07:11, 19 October 2019

M2 Performance Tuning

Many of the settings described here will improve system performance at the cost of usability.

SSD

Use SSD disks for Database! This will greatly improve performance.

FreeSwitch configuration settings

Internal FreeSwitch database

Configure FreeSwitch to store internal database in RAM.

Check if configuration file /usr/local/freeswitch/conf/autoload_configs/switch.conf.xml contains variable core-db-name. Set this variable to:

<param name="core-db-name" value="/dev/shm/core.db" />

If variable is missing, add it. If variable is commented out, uncomment it. Freeswitch restart is required.

Disable FreeSwitch logs

Disabling FreeSwitch logs will decrease load on HDD/SSD.

In configuration file /usr/local/freeswitch/conf/autoload_configs/logfile.conf.xml comment out line:

<map name="all" value="console,debug,info,notice,warning,err,crit,alert"/>

Or you may remove only debug, info and notice messages. Note that HTML comment format is used.

In configuration file /usr/local/freeswitch/conf/autoload_configs/switch.conf.xml set:

<param name="loglevel" value="0"/>

FreeSwitch restart is required.

M2 Core configuration settings

There are several M2 configuration settings that may improve performance. These settings must be set in /etc/m2/system.conf. M2 Core restart is required when you change these settings.

cdr_batch_size = x

Here x is how many CDRs should be stored in buffer before M2 Core inserts them to MySQL database. Default value is 30. Useful values are between 10 and 100.

It is faster to insert CDRs in batches but the bigger the batch size the less frequently CDR wil be inserted to database.

cdr_flush_time = x

Here x is how often to flush CDR batch to MySQL database (in seconds). Default value is 5 seconds. Useful values are between 1 and 60.

logging

show_debug = 0
show_notice = 0
show_warning = 0
show_error = 0

These variables will disable M2 Core logging and thus decreases load on HDD/SSD. If warnings and errors are important, you may leave show_warning = 1 and show_error = 1.

balance_check_period = x

Here x is how ofter to check balance for active calls. Default value is 1 (check every second). You may set this value to higher (let’s say check every 5 seconds) but then there is a risk that calls may last 5 seconds longer than balance allows. This is not a problem if you have set very high balance for your clients and you are not worried about balance going too low. In that case you may set even higher value for balance check. Note that balance check is used only to prevent balance from dropping lower than balance limit is set to. Call billing does not depend on this variable and will be accurate in all cases.

active_calls_check_period = x

Here x is how often to refresh active calls information. Default value is every 5 seconds. You may increase this value to decrease load on database.

log_only_last_cdr = 1

M2 Core creates CDR for each call attempt through Terminators. If you enable log_only_last_cdr then only last attempt will be stored to database. This way CDR inserts will be less frequent and database will be smaller.

do_not_log_system_cdrs = 1

If this setting is enabled then FAILED calls with HGC >= 300 will not be stored to database. This will slightly improve performance by having a smaller database and less frequent inserts to the database.

do_not_log_failed_cdrs = 1

If this setting is enabled then only answered calls will be stored in the database. This will slightly improve performance by having a smaller database and less frequent inserts to the database.

disable_advanced_routing = 1

If you are not using advanced routing (routing by quality) you may disable this feature as it passively stores data required for advanced routing (even if you have not configured advanced routing in GUI).

M2 GUI configuration settings

Call limit/capacity

Enable limits if you really need them. If you don’t need concurrent call limits, set them to 0. If call limits are enabled, M2 Core has to count concurrent calls for User/Device and this takes system resources.

Failover Routing Group

M2 Core has to retrieve all required informations for Failover Routing Groups (dial peers, terminators, rates) before call is even made. If you use Failover Routing Groups, try to make them as small as possible (few dial peers and few terminators).

Destination mask in Dial Peer settings

Destination mask Lithuania% is much faster than %Lithuania%. Try to avoid wildcard % in front of name.

Archived calls

Use archive calls feature to keep you database small. Queries run faster on smaller databases.

Bypass Media in Connection Point settings

When set, the media (RTP) from the originating endpoint is sent directly to the destination endpoint and vice versa. The signaling (SIP) for both endpoints still goes through M2, but the media is point-to-point.

Enable this setting if you are sure that both Originator and Terminator uses the same codec. This will greatly improved FreeSwitch performance as switch no longer has to process media data.