Skip to content
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

subscriptions cleanup in cloud environments #870

Open
rubycut opened this Issue Sep 3, 2016 · 13 comments

Comments

Projects
None yet
@rubycut
Copy link

commented Sep 3, 2016

Kapacitor may run in cloud environment, and it might start every time on different machine with different ip.

Once, it connects to influxdb, kapacitor sets up udp stream on influxdb server which will send data to kapacitor.

But since kapacitor can be moved from one host to another in cloud environments, there should be some automatic system to cleanup stale subscriptions.

@rubycut

This comment has been minimized.

Copy link
Author

commented Sep 3, 2016

Opened this as advised in #782

@nathanielc

This comment has been minimized.

Copy link
Contributor

commented Sep 6, 2016

@rubycut Thanks for the issue and example use case.

@nathanielc nathanielc added this to the Unplanned milestone Sep 6, 2016

@jeremyd

This comment has been minimized.

Copy link

commented Feb 21, 2017

I have a similar issue but it's not related to hostname changing. I deploy kapacitor in a docker container that talks to a long running influxDB server. Everytime I re-deploy kapacitor it creates a new subscription and the old one is left behind (despite a graceful termination of the previous). I need to be able to deploy kapacitor statelessly and after about 1300 subscriptions I started to have influxdb issues.. I will need to write a subscription cleaner script but I would prefer that kapacitor just cleans these subscriptions when it terminates or etc.. +1 thx!

@jeremyd

This comment has been minimized.

Copy link

commented Feb 22, 2017

Incase anyone else needs some help deleting subscriptions I wrote this today.
https://github.com/jeremyd/influxdb-subscription-cleaner

@ryaminal

This comment has been minimized.

Copy link

commented Apr 21, 2017

We were just burned by this on our production system. We have a use case very similar to @jeremyd where we would very much like to have subscriptions cleaned up when kapacitor is restarted.

All we saw on our end were OOMs. Frustrating to diagnose.

@lamchakchan

This comment has been minimized.

Copy link
Contributor

commented Sep 13, 2017

Any updates on this from the Influx team?

@ewillia1983

This comment has been minimized.

Copy link

commented Oct 11, 2017

+1

1 similar comment
@niclonious

This comment has been minimized.

Copy link

commented Nov 13, 2017

+1

@gshif

This comment has been minimized.

Copy link
Member

commented Mar 28, 2018

Regarding the issue reported by @jeremyd, I was not able to reproduce it. I did try it by deploying kapacitor in a docker container as well as in a cloud (AWS) on ubuntu platform. I did not notice new subscription(s) were created when kapacitor was re-deployed. By re-deploy I mean (in my testing) running docker-compose up (start up kapacitor) and then shutting it down (ctrl+C). Ran it for 100 times.
I was running latest influxdb release 1.5.1 and kapacitor 1.3.3 in ubuntu 16.04. @jeremyd , please let me know if my repo is wrong

@doransmestad

This comment has been minimized.

Copy link

commented Mar 28, 2018

@gshif Thanks for taking a look. We recently experienced this issue and it brought down our production cluster as well. I think what may be missing from your reproduction environment is changing hostnames. As we provision kapacitor using AWS ECS, a new container hostname is created. This new hostname is used to register for subscriptions. Unfortunately, InfluxDb attempts to deliver data to the old subscriptions (even though the old kapacitor is gone). In our environment we saw 100% cpu load on InfluxDb and nearly 3TBs of traffic egress from our Influx cluster in attempts to send data to the 100s of defunct kapacitor nodes.

Hopefully that helps some? If not, please feel free to reach out to me. I can easily reproduce this issue in our environment and would love to find a solution.

Thanks again,
Doran

Update: I should mention, we're running InfluxEnterprise 1.3 and kapacitor 1.4.

@gshif

This comment has been minimized.

Copy link
Member

commented Mar 28, 2018

@doransmestad , Thank you for your reply. We are aware of the situation when changing hostnames/IPs won't remove the stale subscriptions. We are currently looking into resolving this issue.

Thanks,
Gershon

@rbetts rbetts modified the milestones: Unplanned, 1.5.1 Jun 13, 2018

@timhallinflux timhallinflux modified the milestones: 1.5.1, Unplanned Aug 3, 2018

@ajcaldera1

This comment has been minimized.

Copy link

commented Aug 10, 2018

I have customers waiting on this. Is there a new plan to fix this issue?

@stanislav-zaprudskiy

This comment has been minimized.

Copy link

commented Aug 27, 2018

On top of this clean-up issue, I'm running into a problem where such stale subscriptions are still consumed by new Kapacitor installations (considering its URL remains the same), which results into duplicated data flow through stream() node. @ #2038

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.