{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/consul-template/issues/601","repository_url":"https://api.github.com/repos/hashicorp/consul-template","labels_url":"https://api.github.com/repos/hashicorp/consul-template/issues/601/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/consul-template/issues/601/comments","events_url":"https://api.github.com/repos/hashicorp/consul-template/issues/601/events","html_url":"https://github.com/hashicorp/consul-template/issues/601","id":145230134,"number":601,"title":"no poll rate limiting, consul-template ddos's consul","user":{"login":"pmbauer","id":453580,"avatar_url":"https://avatars.githubusercontent.com/u/453580?v=3","gravatar_id":"","url":"https://api.github.com/users/pmbauer","html_url":"https://github.com/pmbauer","followers_url":"https://api.github.com/users/pmbauer/followers","following_url":"https://api.github.com/users/pmbauer/following{/other_user}","gists_url":"https://api.github.com/users/pmbauer/gists{/gist_id}","starred_url":"https://api.github.com/users/pmbauer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmbauer/subscriptions","organizations_url":"https://api.github.com/users/pmbauer/orgs","repos_url":"https://api.github.com/users/pmbauer/repos","events_url":"https://api.github.com/users/pmbauer/events{/privacy}","received_events_url":"https://api.github.com/users/pmbauer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-01T16:54:16Z","updated_at":"2016-04-01T16:59:54Z","closed_at":null,"body":"https://github.com/hashicorp/consul-template/blob/5b955a8999a29b01e301cc9b9ac7c4b7b714685f/watch/view.go#L64\r\n\r\n1. For every dependency in a template, CT kicks off a go routine that continuously polls consul as fast as it can.  The only time it ever backs off is if there's an error.  for example\r\n`error fetching: Get http://127.0.0.1:8500/v1/health/service/[...]: dial tcp 127.0.0.1:8500: connect: cannot assign requested address`\r\n\r\n2. Then the CT go routine waits the configured retry period (no exponential backoff, note the RetryFunc always returns the retry constant)\r\nhttps://github.com/hashicorp/consul-template/blob/5b955a8999a29b01e301cc9b9ac7c4b7b714685f/runner.go#L939\r\nhttps://github.com/hashicorp/consul-template/blob/5b955a8999a29b01e301cc9b9ac7c4b7b714685f/watch/view.go#L60\r\n\r\n3. and then proceeds to poll the endpoint again as fast as it can\r\n\r\nThis happens for every single dependency, DDOSing consul.  For our system, this happens well before the dependency count warning.\r\n\r\nconsul-template needs a configured poll rate and exponential backoff on network failures."},"comment":{"url":"https://api.github.com/repos/hashicorp/consul-template/issues/comments/204470959","html_url":"https://github.com/hashicorp/consul-template/issues/601#issuecomment-204470959","issue_url":"https://api.github.com/repos/hashicorp/consul-template/issues/601","id":204470959,"user":{"login":"pmbauer","id":453580,"avatar_url":"https://avatars.githubusercontent.com/u/453580?v=3","gravatar_id":"","url":"https://api.github.com/users/pmbauer","html_url":"https://github.com/pmbauer","followers_url":"https://api.github.com/users/pmbauer/followers","following_url":"https://api.github.com/users/pmbauer/following{/other_user}","gists_url":"https://api.github.com/users/pmbauer/gists{/gist_id}","starred_url":"https://api.github.com/users/pmbauer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmbauer/subscriptions","organizations_url":"https://api.github.com/users/pmbauer/orgs","repos_url":"https://api.github.com/users/pmbauer/repos","events_url":"https://api.github.com/users/pmbauer/events{/privacy}","received_events_url":"https://api.github.com/users/pmbauer/received_events","type":"User","site_admin":false},"created_at":"2016-04-01T16:59:54Z","updated_at":"2016-04-01T16:59:54Z","body":"p.s.\r\nwe are working on a patch for this since it's impacting our system; will send a pull request.  Thanks."}}