# Site goes down at the same time every day in memory-constrained environment

**URL:** https://meta.discourse.org/t/site-goes-down-at-the-same-time-every-day-in-memory-constrained-environment/76358
**Category:** Support
**Created:** [18 בדצמבר,‏ 2017,‏ 10:57pm UTC](https://meta.discourse.org/t/site-goes-down-at-the-same-time-every-day-in-memory-constrained-environment/76358 "2017-12-18T22:57:22Z")
**Posts on this page:** 10
**Page:** 2

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [19 בדצמבר,‏ 2017,‏ 11:11pm UTC](https://meta.discourse.org/t/site-goes-down-at-the-same-time-every-day-in-memory-constrained-environment/76358/21 "2017-12-19T23:11:42Z")

</div>

The error `429` means you are hitting a rate limit, so no amount of additional resources are going to help you there…

---

<div class="post-metadata">

### Author: ![axfelix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/axfelix/32/65166_2.png) [@axfelix](https://meta.discourse.org/u/axfelix)
#### Post date: [19 בדצמבר,‏ 2017,‏ 11:37pm UTC](https://meta.discourse.org/t/site-goes-down-at-the-same-time-every-day-in-memory-constrained-environment/76358/22 "2017-12-19T23:37:59Z")

</div>

It’s not always a 429 – throws 408’s too.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [19 בדצמבר,‏ 2017,‏ 11:40pm UTC](https://meta.discourse.org/t/site-goes-down-at-the-same-time-every-day-in-memory-constrained-environment/76358/23 "2017-12-19T23:40:40Z")

</div>

First you need to fix the issue where IP addresses are not reported correctly to the app, as stated upstream in this topic..

---

<div class="post-metadata">

### Author: ![axfelix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/axfelix/32/65166_2.png) [@axfelix](https://meta.discourse.org/u/axfelix)
#### Post date: [20 בדצמבר,‏ 2017,‏ 12:16am UTC](https://meta.discourse.org/t/site-goes-down-at-the-same-time-every-day-in-memory-constrained-environment/76358/24 "2017-12-20T00:16:40Z")

</div>

At the moment I’m failing to work out where I can add it to the container nginx so that it’ll actually have an effect; the container’s access log is always reporting the same IP from every hit after each time I’ve tried adding it to a different block of the discourse nginx and restarting. the nginx docs suggest that module has to be built separately but I’m assuming it already is in your docker distribution?

Also, curious whether this has changed upstream semi-recently; as recently as Oct 10 (when I was probably not more than a month or so behind on updates) the Discourse site _was_ able to identify external IPs other than localhost and report them properly, and our nginx configs haven’t changed in over a year.

---

<div class="post-metadata">

### Author: ![axfelix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/axfelix/32/65166_2.png) [@axfelix](https://meta.discourse.org/u/axfelix)
#### Post date: [20 בדצמבר,‏ 2017,‏ 12:40am UTC](https://meta.discourse.org/t/site-goes-down-at-the-same-time-every-day-in-memory-constrained-environment/76358/25 "2017-12-20T00:40:41Z")

</div>

OK, yeah, it’s not a build issue, nginx -V claims it’s in there. Can’t see anything weird in the past few months of commits to discourse-docker either.

---

<div class="post-metadata">

### Author: ![axfelix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/axfelix/32/65166_2.png) [@axfelix](https://meta.discourse.org/u/axfelix)
#### Post date: [20 בדצמבר,‏ 2017,‏ 11:01pm UTC](https://meta.discourse.org/t/site-goes-down-at-the-same-time-every-day-in-memory-constrained-environment/76358/26 "2017-12-20T23:01:15Z")

</div>

Yeah, still happening ☹

To everyone’s knowledge, _should_ a dropped-in `real_ip_header X-Forwarded-For;` in the discourse {} block of the container’s `nginx/conf.d/discourse.conf` suffice for IP forwarding, and therefore might something else be going wrong if that’s not working? And is it strange that the discourse app _has_ been able to detect requester IPs (e.g. for banning purposes) in the past with these same configs, if the container’s `/var/log/nginx/access.log` definitely can’t tell them apart now, no matter where I insert that config line?

---

<div class="post-metadata">

### Author: ![axfelix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/axfelix/32/65166_2.png) [@axfelix](https://meta.discourse.org/u/axfelix)
#### Post date: [22 בדצמבר,‏ 2017,‏ 4:50pm UTC](https://meta.discourse.org/t/site-goes-down-at-the-same-time-every-day-in-memory-constrained-environment/76358/27 "2017-12-22T16:50:53Z")

</div>

OK, I ran this by a friend who has spent more time looking at nginx configs than I have, and they were able to point out that I also needed `set_real_ip_from 172.16.0.0/12;` for the container nginx in addition to the `real_ip_header X-Forwarded-For;`. So at least that should stop the 429’s. I’ll see if the problem still recurs.

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [24 בדצמבר,‏ 2017,‏ 3:10am UTC](https://meta.discourse.org/t/site-goes-down-at-the-same-time-every-day-in-memory-constrained-environment/76358/28 "2017-12-24T03:10:37Z")

</div>

To swerve back to the original problem for a moment, do you happen to have any recollection as to when you last upgraded Docker? I’ve just tracked down [a bug in Docker 17.11](https://meta.discourse.org/t/discourse-web-interface-becomes-unresponsive-a-few-minutes-after-starting/76643/14) which has the definite potential to cause the sorts of problems you reported. See the above post for more details and instructions on how to downgrade Docker to a working version.

---

<div class="post-metadata">

### Author: ![axfelix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/axfelix/32/65166_2.png) [@axfelix](https://meta.discourse.org/u/axfelix)
#### Post date: [24 בדצמבר,‏ 2017,‏ 4:09am UTC](https://meta.discourse.org/t/site-goes-down-at-the-same-time-every-day-in-memory-constrained-environment/76358/29 "2017-12-24T04:09:59Z")

</div>

root@selectbutton:~# docker --version  
Docker version 17.05.0-ce, build 89658be

but I appreciate you checking in! looks like it may have in fact just been the header forwarding issue in my case.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [24 בדצמבר,‏ 2017,‏ 4:16am UTC](https://meta.discourse.org/t/site-goes-down-at-the-same-time-every-day-in-memory-constrained-environment/76358/30 "2017-12-24T04:16:55Z")

</div>



[Previous page](https://meta.discourse.org/t/site-goes-down-at-the-same-time-every-day-in-memory-constrained-environment/76358.md?page=1)
