Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upFrequent config reloading cause multi connection of same target #3577
Comments
This comment has been minimized.
This comment has been minimized.
|
#2830 Should fix this. Will get around to it soon. |
This comment has been minimized.
This comment has been minimized.
|
Reloading only when config changes is a good solution for my case. But what if the config is actually changes and should be reloaded frequently? Like add or remove some targets every minute, most targets remains unchanged and this multi-connection may still happen? |
This comment has been minimized.
This comment has been minimized.
|
Hi, you should use file SD for that.
…On Tue 12 Dec, 2017, 9:25 PM ZeeShen, ***@***.***> wrote:
Reloading only when config changes is a good solution for my case.
But what if the config is actually changes and should be reloaded
frequently? Like add or remove some targets every minute, most targets
remains unchanged and this multi-connection may still happen?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3577 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHA3H7A1aj-dpIZZK9iZGCjPuqGBTP85ks5s_0OvgaJpZM4Q-s2B>
.
|
This comment has been minimized.
This comment has been minimized.
|
Is this still happening? |
This comment has been minimized.
This comment has been minimized.
|
We gave prometheus a BIG fd limit to avoid such |
ZeeShen
closed this
Jul 18, 2018
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 22, 2019
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
lock
bot
locked and limited conversation to collaborators
Mar 22, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
ZeeShen commentedDec 12, 2017
I set a cron job that check prometheus config repo and SIGHUP prometheus when config changes.
A bug in the job cause prometheus reloading config every minute. Then prometheus kept logging
error like
too many open files.↑ Open fd and goroutine count increasing after setting ulimit to 4096, target count 700+, avg scrape duration 60ms.
Then I found most of these opening fds were socket files. And with
netstat, I found prometheus kept several(like 5 or 6)ESTABLISHEDconnections with same targets.Not familiar with the code base but it might be helpful to check here that scrape pool will start new scrape loops when config changes. Maybe something wrong with scrape loop's run or stop?
I fixed the cron job and prometheus is running correctly now(open fd 600+, socket 500+). But I think maybe the prometheus server should deal with this frequent reloading situation. Or maybe something wrong with my configuration?
Environment
Linux 4.4.0-62-generic x86_64
running with
--storage.tsdb.path=/mnt/prometheus --config.file=/xxx/prometheus.yml --storage.tsdb.retention=360hand the prometheus.yaml is kinda big, main part is an ec2-sd and a file-sd of static targets.