-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory leak using the Docker provider (Swarm mode) #8872
Comments
I've been bit by the same problem on Traefik 2.8.3. My relevant configuration is:
Open file descriptors count is steady until Docker node is demoted, causing Docker's control socket to return error and file descriptors leaking begin: Latest Traefik log entries, when leak happens:
Traefik's process opened file descriptor list: The following set of file descriptors stay open for each unsuccessful provider endpoint request:
|
@aeburriel thanks for the tip, I can now reproduce. |
Closed by #9288. |
Welcome!
What did you do?
Configured Traefik as a service in Docker Swarm, with command-line options and labels, relying mostly on the defaults.
I must note here that I have an unorthodox setup: the swarm consists of two manager nodes, one of which regularly goes down. As long as it is down, Traefik constantly logs errors like:
That in itself wouldn't be a big deal, however...
What did you see instead?
...I noticed memory usage steadily increasing, too.
I'm not sure whether the excessive logging and memory usage are related, but just in a day, it grew from ~25MB to ~250MB.
As soon as it reached its resource limits, it went into periodic CPU bursts, which I suspect is Go's GC kicking in (?). Once restarted, memory usage went back to ~25MB.
I enabled debug mode and took these snapshots after about a day:
I noticed most memory is consumed in data structures related to the Docker provider and HTTP request processing, so I first tried setting:
--providers.docker.httpClientTimeout=60
but that didn't help.
Setting this, however, fixed the issue!
--providers.docker.watch=false
The docs aren't exactly wordy on this one, but I suppose this means if my services bounce/get relocated, then Traefik will be none the wiser. Like I said, my setup is weird, so I can live with this... but wanted to let you know in case it uncovers some deeper issue.
What version of Traefik are you using?
Version: 2.6.1
Codename: rocamadour
Go version: go1.17.7
Built: 2022-02-14T16:50:25Z
OS/Arch: linux/amd64
What is your environment & configuration?
If applicable, please paste the log output in DEBUG level
No response
The text was updated successfully, but these errors were encountered: