Playback ivr file slowly, when many concurrent calls are in system and they are hearing that ivr file in the same time

You could try the following:

  1. Install the other sound file formats as gsm very likely needs transcoding
  2. Turn off the mssql/odbc stuff for the moment
  3. Turn off monitoring for the moment

In case you are writing to a hard disk, monitoring 25 calls, i.e. 50 channels could be the primary source of your problems.

He’s on a VM, so won’t even have dedicated access to the disk arm.

what do you mean by ā€œdisk armā€ ?

On the sort of hard disk that is used for bulk storage, the thing that limits the total throughput is moving the arm that carries the heads beween the cylinders, where a cylinder is the set of tracks at the same radial distance from the spindle.

As such the crtiical resource is that arm.

If you have more than one user, including, but not limited, to the result of having multiple virtual machines, they will all be fighting to have the arm in the part of the disk they want to use.

There are stieps that can be taken to minimise large arm movents, but they may mean that it takes longer to get back to the same place on the disk .

really thanks for your kind help.

is there any configuration in asterisk to limit memory usage of service.
i gave the server 20gig memory last night, but still asterisk is consuming about 6.5gig like yesterday that total ram was 10g.
maybe there is a configuration to limit asterisk memory usage.

No. As I said, if this is the figure shown by ps -l you almost certainly have a memory leak.

My prime suspect would be the database library, but you need to work out what correlates with an increase in memory usage.

I haven’t read all lines here in detail, but is he is on a VM, say qemu/kvm, he could set the buffer mode to ā€œunsafeā€ which minimizes real disk access (and is more fun in case the box crashes).

i gave 40 core cpu to the server (5core,8socket) and 40 gig memory,
but still we have problem : ivr and any other voice plays very slow and cdrs processed very late.
i check problem deeper
i found that CDR events raised with delay too,

qestion1 : cdr event raise after writing cdr to file and database???

question2 : with assuming that my database driver has problem and made this lag, did it cause that cdr didnt write EVEN in master.conf ???

i mean , if it had any problem with odbc for import cdr to sql , does it made lag on writing CDr to master.conf too?

if any problem exists in cdr writing , it didn’t write even in master.conf and no cdr event !!!

cdr in db and in master.conf and cdr events , all happened with delay about 30 minutes,
system load is abnormal too.

i check res_odbc.conf

i see below options in sql configurations :
poolling = no
limit = 1

maybe these options are making problem.
i changed pooling to yes and limit = 50 last night
and i want to check applied configs today ( im waiting for 12:00pm (peak hour)) then i will inform you the result.

another question : can i reduce numbers of CDR in a call,

imagine a call :
call comes in and go to ivr then send to queue :
agent 1 rings and noAnswer ====> 1 cdr exactly after ring finished - during call
agent 2 rings and noAnswer ====> 1 cdr exactly after ring finished -during call
agent 3 rings and Answer ====> 1 cdr exactly after answer - during call
after agent 3 hangup the call again ====> 3 cdr - end of the call

hw can i config these logs?

general status is alittle better but problem not solved completely.

i double check res_odbc.conf and see below options :

; The maximum number of connections to have open at any given time.
; This defaults to 1 and it is highly recommended to only set this higher
; if using a version of UnixODBC greater than 2.3.1.
;max_connections => 20

; How long (in seconds) should we attempt to connect before considering the
; connection dead? The default is 10 seconds, but you may wish to reduce it,
; to increase responsiveness.
;connect_timeout => 10

i changed :
max_connections => 30 (as i update odbc version to 2.3.7)
and
connect_timeout => 7

question : are those changes applied with reload asterisk in console OR it need restart asterisk service ??? (as i can’t restart asterisk at this time with 70 concurrent calls)

i use bellow command :
[root@astrsk ~]# asterisk -rx ā€œodbc show allā€

ODBC DSN Settings

Name: asteriskcdrmssqldb
DSN: MSSQL-asteriskcdrmssqldb
Last connection attempt: 1970-01-01 03:30:00
Number of active connections: 1 (out of 30)

30 connections are accepted BUT i don’t know why it does not use 30 connection ???!!!

does it need to restart asterisk???

CDR is single threaded. It would only use 1 connection at a time.

how can i made it as multi thread with odbc ??
please help me, reason of my all problem is cdr, (using odbc for mssql)

please check bellow url , it said that i can have more than 1 active connection for cdr odbc:
https://blogs.asterisk.org/2016/06/15/asterisk-odbc-connections/

You can’t. The CDR implementation is fundamentally single threaded. Changing that would require rewriting it. ODBC can be used for other things, and thus can result in multiple connections for them but not for CDR.

so how can i create multiple connection for odbc ?
my odbc configs:

odbc.ini

[MSSQL-asteriskcdrmssqldb]
Description=Dev DB MS SQL Server
Driver=ODBCDriver17forSQLServer
Database=AsteriskCDR
Username=app_cdr
Password=********************
Trace=no
Server=10.1.10.67
Port=1433

odbcinst.ini

[ODBC]
Trace=yes
TraceFile=/var/log/odbc/traceFile.log
Pooling=Yes
Threading=2

[FreeTDS]
Description=FreeTDS ODBC driver for MSSQL
Driver=/usr/lib64/libtdsodbc.so.0.0.0
Setup=/usr/lib64/libtdsS.so.2.0.0
Pooling=Yes
FileUsage=1
CPTimeout=120
CPReuse=5
Threading=2

res_odbc.conf

[asteriskcdrmssqldb]
enabled=>yes
dsn=>MSSQL-asteriskcdrmssqldb
username=>test_app_asteriskcdr
password=>pv2_QxJV.9Wb71Do-g796
pooling=>yes
limit=>2
pre-connect=>yes
share_connections=>no
max_connections=>20

cdr_adaptive_odbc.conf

[adaptive_connection]
connection=asteriskcdrmssqldb
table=cdr
alias start => calldate

cdr_odbc.conf

[global2]
dsn=MSSQL-asteriskcdrmssqldb
username=test_app_asteriskcdr
password=pv2_QxJV.9Wb71Do-g796
loguniqueid=yes
table=cdr
dispositionstring=yes

As I’ve stated, CDR can not use multiple connections. It will only ever use 1.

but with this 1 connection i have problem.
cdrs wait in a queue SO send to database and master.conf with big delay about 30 minutes.
this amount of waiting cdr will cause overload.
what do you suggest for the problem?

Don’t directly connect Asterisk to the database, but instead have it write to a file and have a separate process pick up the CDRs and put them into the database?

I have noticed that whenever there are high volume of calls on asterisk, CDR posting even to files gets delayed and different values(duration, billsec, start and end time) populated in CDR are incorrect.
Looking for solution since almost two months but got no success.

Regards,
Dinesh