# A way of monitoring the max stack depth reached

**URL:** <https://discuss.python.org/t/a-way-of-monitoring-the-max-stack-depth-reached/75867>\
**Category:** Ideas\
**Created:** [January 1, 2025, 5:01pm UTC](https://discuss.python.org/t/a-way-of-monitoring-the-max-stack-depth-reached/75867 "2025-01-01T17:01:24Z")\
**Posts on this page:** 1\
**Showing post:** 18

<div class="post-metadata">

**Author:** ![seddonym](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/seddonym/32/24939_2.png) [@seddonym](https://discuss.python.org/u/seddonym)\
**Post date:** [January 3, 2025, 8:19am UTC](https://discuss.python.org/t/a-way-of-monitoring-the-max-stack-depth-reached/75867/18 "2025-01-03T08:19:40Z")

</div>

It’s more complicated than that - we run our application under many different configurations with a variety of interchangeable plugins. And I have a feeling that the max depth might be affected by the order in which HTTP requests are served.

That said, we probably could statically determine an optimal way of pre-importing all the modules during bootstrap, in such a way that we minimize the length of import chains.

---

_[View the full topic](https://discuss.python.org/t/a-way-of-monitoring-the-max-stack-depth-reached/75867)._
