[asterisk-dev] PJSIP realtime scalability problem

Michael Ulitskiy mulitskiy at acedsl.com
Thu Oct 15 10:58:46 CDT 2015


Hello,
 
I have a system consisting of OpenSIPS proxy, working as registrar and outbound proxy for subscribers and multiple
asterisk systems behind it providing all kind of media services to subscribers. OpenSIPS proxy dynamically assigns
which asterisk a particular endpoint should be served at and then forwards all messages from that endpoint to the
selected asterisk server. Since this is dynamic process there's no predefined list of endpoints assigned to each asterisk server.
Each asterisk server must be prepared to handle requests from any endpoint.
Currently I'm using chan_sip with dynamic realtime and it works well. Whenever a request arrives to an asterisk it retrieves that
endpoint (peer) from db and caches it. chan_sip never attempts to retrieve the whole list of endpoints.
 
Now I'm considering migrating to chan_pjsip and immediately I encountered a problem. Unlike chan_sip, pjsip is retrieving
the whole list of subscribers multiple times during initial load. Then it does it again every time you issue "pjsip list/show endpoints/aors"
CLI commands. Even worse (much worse), after initial load of AORs and endpoints with the queries that looks like this:
 
SELECT * FROM pjsip_aors_v WHERE id LIKE '%' ORDER BY id
SELECT * FROM pjsip_endpoints_v WHERE id LIKE '%' ORDER BY id
 
it follows on with loading every AOR individually with queries like this:
 
SELECT * FROM pjsip_aors_v WHERE id = 'ep1'
SELECT * FROM pjsip_aors_v WHERE id = 'ep2'
...
SELECT * FROM pjsip_aors_v WHERE id = 'epN'
 
Then it goes on with loading every endpoint individually with queries like this:
 
SELECT * FROM pjsip_endpoints_v WHERE id = 'ep1'
SELECT * FROM pjsip_endpoints_v WHERE id = 'ep2'
...
SELECT * FROM pjsip_endpoints_v WHERE id = 'epN'
 
I currently have around 10K of endpoints and it's completely unacceptable even at my scale and I'm sure there are much
bigger installations out there.
 
I asked this question on asterisk-users already (http://lists.digium.com/pipermail/asterisk-users/2015-October/287742.html)
and was told by Joshua Colp that this is how things stands now and it works as intended.
 
So I would like to ask developers if there are any plans to address it and make it behave more like chan_sip does. If no
I'd like to know how developers suggest the installations with larger number of endpoints to handle this. I'm open to any
suggestions. Right now it looks like show-stopper to me.
 
Thanks in advance,
Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20151015/705a28c6/attachment.html>


More information about the asterisk-dev mailing list