# Bad Gateway at irregular intervals

**URL:** <https://meta.discourse.org/t/bad-gateway-at-irregular-intervals/211977>\
**Category:** Self-hosting\
**Created:** [December 13, 2021, 4:41pm UTC](https://meta.discourse.org/t/bad-gateway-at-irregular-intervals/211977 "2021-12-13T16:41:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![L30110](https://avatars.discourse-cdn.com/v4/letter/l/eb9ed0/32.png) [@L30110](https://meta.discourse.org/u/L30110)\
**Post date:** [December 13, 2021, 4:41pm UTC](https://meta.discourse.org/t/bad-gateway-at-irregular-intervals/211977/1 "2021-12-13T16:41:36Z")

</div>

Out of the blue, my Discourse instance (docker installed) is returning Bad Gateway errors at intervals. The container is still running, but I need to manually stop and start the app to get things going again. Then it seems fine … until this occurs again sometime shortly later. I’m unsure of the appropriate log location for more info. Where should I start? Thanks very much!

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [December 13, 2021, 6:36pm UTC](https://meta.discourse.org/t/bad-gateway-at-irregular-intervals/211977/2 "2021-12-13T18:36:28Z")

</div>

Are you running out of RAM? What does `free -h` say?

What do you see in `/var/discourse/shared/standalone/log/rails/production.log` (I think I typed it right, but if not, you’ll have to adjust). And `/var/discourse/shared/standalone/log/var_log/nginx/..something...`

---

<div class="post-metadata">

**Author:** ![L30110](https://avatars.discourse-cdn.com/v4/letter/l/eb9ed0/32.png) [@L30110](https://meta.discourse.org/u/L30110)\
**Post date:** [December 13, 2021, 6:48pm UTC](https://meta.discourse.org/t/bad-gateway-at-irregular-intervals/211977/3 "2021-12-13T18:48:57Z")

</div>

I’ll check the next time this happens. Thanks! Right now less than 50% RAM in use.

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [December 13, 2021, 7:01pm UTC](https://meta.discourse.org/t/bad-gateway-at-irregular-intervals/211977/4 "2021-12-13T19:01:12Z")

</div>

Probably not RAM, then. You can look at the logs now.

---

<div class="post-metadata">

**Author:** ![L30110](https://avatars.discourse-cdn.com/v4/letter/l/eb9ed0/32.png) [@L30110](https://meta.discourse.org/u/L30110)\
**Post date:** [December 21, 2021, 5:30pm UTC](https://meta.discourse.org/t/bad-gateway-at-irregular-intervals/211977/5 "2021-12-21T17:30:37Z")

</div>

The logs look OK. Nothing obvious anyway. Even when it’s up, it’s been very sluggish. Often takes a long time to respond, long enough that it timeouts for users (or even me, locally). Really strange since that box has been stable for a long time and little changes on it other than routine Ubuntu updates (18.04).
