You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which seems like a very weird remediation in this case - the workers were all at 20% utilization in our case (w/out limits being provided to the containers) 🤔
Yeah...gotta say I'm pretty skeptical. Our workers never really seem to show high memory usage. They already have 16GB each, I don't think this is a situation where we can just throw hardware at it.
The only scenario I can imagine is a very quick spike in memory allocation that goes down just as quickly, but I find it hard to imagine a spike big enough to allocate ~12GB of RAM, let alone one that's quick enough to escape our metrics.
"A hypothesis we had was that since this is only observed on iptables operations that perhaps the table within kernel memory keeping track of this stuff filled up. I’ve heard from people that iptable is pretty inefficient with memory when it’s persisting rules."
One thing of note is that build runs containers in Docker Compose, in a container. Could iptables rules be sticking around between builds? Or do they get cleaned up properly when the network namespace is destroyed?
Just chiming in that we are noticing this flake as well when we are running slightly more containers/worker than usual (~160 on one with highest load).
To summarize: we are currently using RC78, which contains the fix for #3251. We don't see any more the iptables error. We have a distribution of containers per worker of average 100 (very low because we are currently running overprovisioned).
@edude03 I strongly suggest to upgrade and to try fewest as container placement srategy; RC4 was pre #3251.
Noticed this today as well.. still running v3.14.1, 16 workers in the environment this happened in, most at about ~120-150, but we cap at 250. I don't think it's necessarily due to the amount of containers (as, we frequently have workers peak over 200 without issue). I think I've only seen it a few times, so hard to say. Def. not seeing any memory issues, disk or inode issues, etc. We currently use random placement strategy as it's not a thing in the version we're running (upgrade is a work in progress.. a bit hard to do with almost 1,900 pipelines and ~240 teams).
I saw the issue temporally on Concourse 5.2.0 for the email put resource (iptables: create-instance-chains: iptables: Memory allocation problem). Not sure what cleared the issue
Ditto with 5.4.0 using the binaries on Ubuntu 18.04:
# uname -a
Linux ci 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic
we're going to push this investigation to after our containerd spike since this might go away if we move to containerd. For now the only lead we have is that it might need a kernel version bump.
@suhlig It looks like Ubuntu 18.04.2 doesn't have the version of the kernel with the fix. It ships with kernel 4.18. Ubuntu 18.04.3 ships with kernel 5.0. Let us know if you get a chance to test it with the new kernel.
Unfortunately, my team deploys our Concourses with bosh and there's no short-term plan to release any Ubuntu stemcell newer than Xenial, so there's little hope of us being able to try with kernel 4.19 or newer.
Hell friends. We have the same problem as @matt-royal - so we are curious how the Concourse team is deploying this. Clearly they are not using BOSH, for if they were, the stem cell would cause issues. This is causing a fair amount of churn with our pipelines and making product managers (like me) ask why we are using it in the first place.
@mreider we're using the helm chart on k8s (specifically GKE, where node images since v1.15.4-gke.22 have had the necessary kernel)! That said, we do have some pretty hefty integration test suites that use BOSH using the GCP Xenial stemcells from bosh.io -- maybe we're conveniently missing the scenarios where this bug tends to creep up.
Hi friends. We hit this recently and I thought I'd share my conclusions in case it helps anyone.
It's a memory fragmentation problem. I'm not familiar enough with concourse to know how or why it got worse recently, but I'm confident concourse is responsible for the majority of the fragmentation. Using the example from @jwatson0's comment above:
iptables is attempting to allocate 324 KiB and failing. There are no slabs 512 KiB (or bigger; the next size up from the required 324 KiB) available. cat /proc/buddyinfo gives the same info as the second line above.
This graph is from our investigation showing the difference in fragmentation between a node running a concourse worker and one that isn't. The metrics come from the prometheus node exporter with the buddy collector enabled.
In our context we're running concourse on kubernetes (using the helm chart). As one might imagine, and as others have commented on above, the more stuff running on a single node the bigger the iptables configuration and the more likely this problem is to be hit. We've worked around it so far by forcing the worker pods onto their own nodes. But that will only push the problem downstream a bit.
@blairboy362 Thanks for sharing! That sounds like a useful thing to watch out for in the future.
Giving worker pods their own nodes makes a lot of sense given the current way things work. In the future I think that will be ultimately resolved with our own K8s native runtime, which we're planning to start very soon (possibly next week).
In the meantime, this may improve with our upcoming containerd worker backend which configures fewer rules (#5534 (comment)).
TBH if the real problem is that the worker genuinely cannot allocate memory for some other arbitrary reason, I'm not totally sure what we could do. 🤔 I wonder if using some interface other than iptables would help.
Is anyone still running into this issue in a single-dedicated-worker-VM context?
Activity
kcmannem commentedon Jan 23, 2019
Garden team investigated this issue. They said just increase the workers memory. There is no other fix they can provide.
cirocosta commentedon Jan 23, 2019
Which seems like a very weird remediation in this case - the workers were all at 20% utilization in our case (w/out limits being provided to the containers) 🤔
vito commentedon Jan 23, 2019
Yeah...gotta say I'm pretty skeptical. Our workers never really seem to show high memory usage. They already have 16GB each, I don't think this is a situation where we can just throw hardware at it.
The only scenario I can imagine is a very quick spike in memory allocation that goes down just as quickly, but I find it hard to imagine a spike big enough to allocate ~12GB of RAM, let alone one that's quick enough to escape our metrics.
kcmannem commentedon Jan 23, 2019
Heres what they had to say:
"A hypothesis we had was that since this is only observed on iptables operations that perhaps the table within kernel memory keeping track of this stuff filled up. I’ve heard from people that iptable is pretty inefficient with memory when it’s persisting rules."
vito commentedon Jan 23, 2019
One thing of note is that build runs containers in Docker Compose, in a container. Could
iptablesrules be sticking around between builds? Or do they get cleaned up properly when the network namespace is destroyed?topherbullock commentedon Jan 24, 2019
Yeah, I don't think more worker memory will help here; the workers' memory utilization ~15% when the flake occurred.
@vito Garden should destroy the
iptablesfor the container when the container is destroyed (https://github.com/cloudfoundry/guardian/blob/7536c003d476be01a24401148db6238416f53c02/gardener/gardener_test.go#L830-L835, https://github.com/cloudfoundry/guardian/blob/7536c003d476be01a24401148db6238416f53c02/kawasaki/networker.go#L246-L278). I think anyiptablesentries created by Docker will go away; we'd probably notice a lot more issues if they were leakingdavidjahn commentedon Jan 30, 2019
Just chiming in that we are noticing this flake as well when we are running slightly more containers/worker than usual (~160 on one with highest load).
marco-m commentedon Feb 8, 2019
We started seeing the same with 5.0 RC54
cirocosta commentedon Feb 8, 2019
Hey @marco-m ,
Do you also see this happening only in workers with more containers than the usual like @davidjahn ?
thx!
wagdav commentedon Feb 8, 2019
@cirocosta
@marco-m and I summarized what we see in #3251
edude03 commentedon Feb 23, 2019
We're seeing this with 5.0.0-rc4 when there are more builds than usual as well.
marco-m commentedon Feb 23, 2019
To summarize: we are currently using RC78, which contains the fix for #3251. We don't see any more the
iptableserror. We have a distribution of containers per worker of average 100 (very low because we are currently running overprovisioned).@edude03 I strongly suggest to upgrade and to try
fewestas container placement srategy; RC4 was pre #3251.lrstanley commentedon Apr 11, 2019
Noticed this today as well.. still running v3.14.1, 16 workers in the environment this happened in, most at about ~120-150, but we cap at 250. I don't think it's necessarily due to the amount of containers (as, we frequently have workers peak over 200 without issue). I think I've only seen it a few times, so hard to say. Def. not seeing any memory issues, disk or inode issues, etc. We currently use random placement strategy as it's not a thing in the version we're running (upgrade is a work in progress.. a bit hard to do with almost 1,900 pipelines and ~240 teams).
10 remaining items
colmtuohy commentedon Jul 17, 2019
I saw the issue temporally on Concourse 5.2.0 for the email put resource (iptables: create-instance-chains: iptables: Memory allocation problem). Not sure what cleared the issue
Rukenshia commentedon Jul 18, 2019
We just upgraded to concourse 5.3.0 and also experience this problem.
We use this stemcell in bosh:
suhlig commentedon Aug 4, 2019
Ditto with 5.4.0 using the binaries on Ubuntu 18.04:
ddadlani commentedon Aug 6, 2019
we're going to push this investigation to after our containerd spike since this might go away if we move to containerd. For now the only lead we have is that it might need a kernel version bump.
jwatson0 commentedon Oct 4, 2019
Got this today. Here's my dmesg stack trace in case it helps:
marco-m commentedon Oct 5, 2019
@jwatson0 which version of Concourse ?
matt-royal commentedon Oct 15, 2019
@suhlig It looks like Ubuntu 18.04.2 doesn't have the version of the kernel with the fix. It ships with kernel 4.18. Ubuntu 18.04.3 ships with kernel 5.0. Let us know if you get a chance to test it with the new kernel.
Unfortunately, my team deploys our Concourses with bosh and there's no short-term plan to release any Ubuntu stemcell newer than Xenial, so there's little hope of us being able to try with kernel 4.19 or newer.
mreider commentedon Jan 22, 2020
Hell friends. We have the same problem as @matt-royal - so we are curious how the Concourse team is deploying this. Clearly they are not using BOSH, for if they were, the stem cell would cause issues. This is causing a fair amount of churn with our pipelines and making product managers (like me) ask why we are using it in the first place.
jamieklassen commentedon Jan 24, 2020
@mreider we're using the helm chart on k8s (specifically GKE, where node images since
v1.15.4-gke.22have had the necessary kernel)! That said, we do have some pretty hefty integration test suites that use BOSH using the GCP Xenial stemcells from bosh.io -- maybe we're conveniently missing the scenarios where this bug tends to creep up.blairboy362 commentedon Jul 24, 2020
Hi friends. We hit this recently and I thought I'd share my conclusions in case it helps anyone.
It's a memory fragmentation problem. I'm not familiar enough with concourse to know how or why it got worse recently, but I'm confident concourse is responsible for the majority of the fragmentation. Using the example from @jwatson0's comment above:
iptables is attempting to allocate 324 KiB and failing. There are no slabs 512 KiB (or bigger; the next size up from the required 324 KiB) available.
cat /proc/buddyinfogives the same info as the second line above.This graph is from our investigation showing the difference in fragmentation between a node running a concourse worker and one that isn't. The metrics come from the prometheus node exporter with the
buddycollector enabled.In our context we're running concourse on kubernetes (using the helm chart). As one might imagine, and as others have commented on above, the more stuff running on a single node the bigger the iptables configuration and the more likely this problem is to be hit. We've worked around it so far by forcing the worker pods onto their own nodes. But that will only push the problem downstream a bit.
vito commentedon Jul 30, 2020
@blairboy362 Thanks for sharing! That sounds like a useful thing to watch out for in the future.
Giving worker pods their own nodes makes a lot of sense given the current way things work. In the future I think that will be ultimately resolved with our own K8s native runtime, which we're planning to start very soon (possibly next week).
In the meantime, this may improve with our upcoming
containerdworker backend which configures fewer rules (#5534 (comment)).TBH if the real problem is that the worker genuinely cannot allocate memory for some other arbitrary reason, I'm not totally sure what we could do. 🤔 I wonder if using some interface other than
iptableswould help.Is anyone still running into this issue in a single-dedicated-worker-VM context?