Context limit

Hi Asterisk Experts,

I would like to ask if there is a limit on how many contexts you can create in the extensions.conf file.

Thanks,
Lui

There will be no realistic hard limit although very large numbers may have a performance impact or run you out of memory. The code will not have been deliberately designed to be efficient for large numbers, so you will need to, either read the code or run tests.

Hi David,

Thanks for your reply. Based on that, i think i might still have to do a load test with a huge number of contexts and check the memory and cpu of the server.

How about the number of includes or context within a context you can do?

Regards,
Lui

You really need to look at the code. Most things are done without fixed limits, but there may be cases where there are fixed limits but they are sufficiently large that no-one has reported a problem on these forums.

ok David. I got another question. Is there an increase in the performance if you split the config files. For example, you include 9 extensions_custom_xxx.conf compared to one big extensions.conf file.

1st setup:
extensions.conf (100 lines)
extensions_custom1.conf (100 lines)
.
.
.
extensions_custom9.conf (100 lines)

2nd setup:
extensions.conf (1000 lines)

Regards,
Lui

#include directives are processed at module load time, so they will slow down module reloads, but not affect the normal execution.