# Context limit

**URL:** <https://community.asterisk.org/t/context-limit/44512>\
**Category:** Asterisk Support\
**Created:** [November 19, 2013, 2:07pm UTC](https://community.asterisk.org/t/context-limit/44512 "2013-11-19T14:07:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![asterguy](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/asterguy/32/266_2.png) [@asterguy](https://community.asterisk.org/u/asterguy)\
**Post date:** [November 19, 2013, 2:07pm UTC](https://community.asterisk.org/t/context-limit/44512/1 "2013-11-19T14:07:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![david55](https://avatars.discourse-cdn.com/v4/letter/d/e19adc/32.png) [@david55](https://community.asterisk.org/u/david55)\
**Post date:** [November 19, 2013, 2:30pm UTC](https://community.asterisk.org/t/context-limit/44512/2 "2013-11-19T14:30:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![asterguy](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/asterguy/32/266_2.png) [@asterguy](https://community.asterisk.org/u/asterguy)\
**Post date:** [November 19, 2013, 3:04pm UTC](https://community.asterisk.org/t/context-limit/44512/3 "2013-11-19T15:04:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![david55](https://avatars.discourse-cdn.com/v4/letter/d/e19adc/32.png) [@david55](https://community.asterisk.org/u/david55)\
**Post date:** [November 19, 2013, 3:10pm UTC](https://community.asterisk.org/t/context-limit/44512/4 "2013-11-19T15:10:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![asterguy](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/asterguy/32/266_2.png) [@asterguy](https://community.asterisk.org/u/asterguy)\
**Post date:** [November 20, 2013, 10:22am UTC](https://community.asterisk.org/t/context-limit/44512/5 "2013-11-20T10:22:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![david55](https://avatars.discourse-cdn.com/v4/letter/d/e19adc/32.png) [@david55](https://community.asterisk.org/u/david55)\
**Post date:** [November 20, 2013, 11:29am UTC](https://community.asterisk.org/t/context-limit/44512/6 "2013-11-20T11:29:11Z")

</div>

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