Modules too long to load. its about 30 mins

this is my experience after upgrading postgres v11 to v16.

[Jun 10 16:15:39] DEBUG[3772997]: http.c:1470 handle_uri: match request [ari/events] with handler [httpstatus] len 10
[Jun 10 16:15:39] DEBUG[3772997]: http.c:1492 handle_uri: Requested URI [ari/events] has no handler
[Jun 10 16:15:39] DEBUG[3772997]: http.c:566 ast_http_send: HTTP keeping session open. status_code:404

Those log messages have nothing to do with database access. What do you use the database for? Have you done checking on the database to ensure it can respond in a timely manner?

The issue started after I upgraded my RDS PostgreSQL. But when I revert to my old DB connection with PostgreSQL 11, Asterisk is ready in about 2 minutes. I have more then 2000 records on ps_endpoints.
Maybe someone can help


here’s the complete screenshot. maybe you can help me on this. thanks

Don’t do screenshots. If you want anyone to help then generally logs are preferred. As well, that screenshot just shows ARI application stuff.

There is nothing in Asterisk to help configuration wise that I can think of, to properly set up state for monitoring and other things it has to do a full query of all endpoints. If that takes a long time then it takes a long time, though for a realtime environment you really want stuff to be fast and local if you are tightly coupling it to a database. I have no input on the RDS side.

Thanks for your input. I think this more on loading modules. I’ll send the full logs.
nothing show in ARI.

DevSIPServer*CLI> odbc show

ODBC DSN Settings

Name: asterisk
DSN: asterisk
Number of active connections: 1 (out of 1)
Logging: Disabled

[Jun 10 16:49:34] DEBUG[3773723]: http.c:2013 httpd_helper_thread: HTTP closing session. Top level
[Jun 10 16:49:34] DEBUG[3773727]: http.c:1956 httpd_helper_thread: HTTP opening session. Top level
[Jun 10 16:49:34] DEBUG[3773727]: http.c:1415 handle_uri: HTTP Request URI is /ari/events?app=appvno_callcontroller&subscribeAll=true
[Jun 10 16:49:34] DEBUG[3773727]: http.c:1470 handle_uri: match request [ari/events] with handler [httpstatus] len 10
[Jun 10 16:49:34] DEBUG[3773727]: http.c:1492 handle_uri: Requested URI [ari/events] has no handler
[Jun 10 16:49:34] DEBUG[3773727]: http.c:566 ast_http_send: HTTP keeping session open. status_code:404
DevSIPServerCLI> module show like https
DevSIPServer
CLI> module show like ari
DevSIPServerCLI> module show like http
DevSIPServer
CLI> module show like ari
DevSIPServer*CLI>

Modules can do whatever they want when they are loaded, and for PJSIP this includes querying for things from the database which can block loading.

do you have any idea on how can I verify on the pjsip what is causing this. i guess this is more on ps endpoints records. thanks

The log will show when loading of a module has started and has completed, if res_pjsip.so takes awhile then that is likely the cause and the debug messages would probably further show so. Otherwise a deadlock backtrace[1] would show what Asterisk is doing at the time.

[1] Getting a Backtrace - Asterisk Documentation

On Monday 10 June 2024 at 11:08:36, bogus via Asterisk Community wrote:

do you have any idea on how can I verify on the pjsip what is causing this.
i guess this is more on ps endpoints records. thanks

Give than you say the problem occurs with Postfgres 16 and does not occur with
Postgres 11, how about looking at the DB queries which Postgres is receiving,
and the responses it is sending, during Asterisk startup?

I would always start examining a problem by looking at the thing which has
changed between “no problem” and “problem”, and in this case that is Postgres.

Antony.


If at first you don’t succeed, destroy all the evidence that you tried.

                                               Please reply to the list;
                                                     please *don't* CC me.
1 Like