0
votes

I am running a mVoIP application that uses Asterisk servers. Currently, I have more than 1 million registered users. SIP registration was totally fine at first time, but it is getting slow recently. It takes 3 to 5 seconds to register on Asterisk Server.

Asterisk server saves user information in server memory and I did indexing in MySQL database. Here is a sample SIP user information. Can you see why SIP registration is slow? Thank you.

  * Name       : 1000
  Description  :
  Realtime peer: Yes, cached
  Secret       : <Set>
  MD5Secret    : <Not set>
  Remote Secret: <Not set>
  Context      : from-sip
  Record On feature : automon
  Record Off feature : automon
  Subscr.Cont. : <Not set>
  Language     :
  Tonezone     : <Not set>
  AMA flags    : Unknown
  Transfer mode: open
  CallingPres  : Presentation Allowed, Not Screened
  Callgroup    :
  Pickupgroup  :
  Named Callgr :
  Nam. Pickupgr:
  MOH Suggest  :
  Mailbox      :
  VM Extension : asterisk
  LastMsgsSent : 0/0
  Call limit   : 0
  Max forwards : 0
  Dynamic      : Yes
  Callerid     : "" <>
  MaxCallBR    : 384 kbps
  Expire       : 3212
  Insecure     : no
  Force rport  : Yes
  Symmetric RTP: No
  ACL          : No
  DirectMedACL : No
  T.38 support : No
  T.38 EC mode : Unknown
  T.38 MaxDtgrm: -1
  DirectMedia  : No
  PromiscRedir : No
  User=Phone   : No
  Video Support: No
  Text Support : No
  Ign SDP ver  : No
  Trust RPID   : No
  Send RPID    : No
  TrustIDOutbnd: Legacy
  Subscriptions: Yes
  Overlap dial : Yes
  DTMFmode     : rfc2833
  Timer T1     : 500
  Timer B      : 32000
  ToHost       :
  Addr->IP     : 118.131.206.XXX:58390
  Defaddr->IP  : (null)
  Prim.Transp. : UDP
  Allowed.Trsp : UDP
  Def. Username: 1000
  SIP Options  : (none)
  Codecs       : (ulaw|alaw|opus)
  Codec Order  : (opus:20,ulaw:20,alaw:20)
  Auto-Framing : No
  Status       : Unmonitored
  Useragent    : LinphoneAndroid/2.3.2 (belle-sip/1.3.2)
  Reg. Contact : sip:[email protected]:58390
  Qualify Freq : 60000 ms
  Keepalive    : 0 ms
  Sess-Timers  : Accept
  Sess-Refresh : uas
  Sess-Expires : 1800 secs
  Min-Sess     : 90 secs
  RTP Engine   : asterisk
  Parkinglot   :
  Use Reason   : No
  Encryption   : No
3
I think this is not a programming question. Maybe you should ask in serverfault.com?Juan Cespedes

3 Answers

1
votes

Asterisk is designed to be small office PBX.

It never was stated to serve 1mln registration.

There are nothing to change in asterisk itself, but you can check other projects that was designed to deal with your size/problem.

They are openser family(opensips.org/kamailio.org), OpenSBC etc.

opensips or kamailio probably can handle 1mln users(tens of thousands request per second) without any issues.

Also it is time think about failover and disaster recovery, load balancing etc.

0
votes

Asterisk stores registration in astdb. Newer versions migrated to implement this using sqlite instead of berkeley db, this may or may not increase performance. https://wiki.asterisk.org/wiki/display/AST/SQLite3+astdb+back-end

Also, if you choose to use realtime sip (the dynamic version) you can use any database backends to store registration information. But this option most likely incompatible with mVoIP, what I'm not familiar with.

And I totally agree with:

Asterisk is designed to be small office PBX.

0
votes

What are your server specifications? It may be the server specifications that are not enough.