Consul is a distributed, highly available, and data center aware solution to connect and configure applications across dynamic, distributed infrastructure. https://www.consul.io
Go to file
Paul Banks 0b5a078b95
Optimize health watching to single chan/goroutine. (#5449)
Refs #4984.

Watching chans for every node we touch in a health query is wasteful. In #4984 it shows that if there are more than 682 service instances we always fallback to watching all services which kills performance.

We already have a record in MemDB that is reliably update whenever the service health result should change thanks to per-service watch indexes.

So in general, provided there is at least one service instances and we actually have a service index for it (we always do now) we only ever need to watch a single channel.

This saves us from ever falling back to the general index and causing the performance cliff in #4984, but it also means fewer goroutines and work done for every blocking health query.

It also saves some allocations made during the query because we no longer have to populate a WatchSet with 3 chans per service instance which saves the internal map allocation.

This passes all state store tests except the one that explicitly checked for the fallback behaviour we've now optimized away and in general seems safe.
2019-03-15 20:18:48 +00:00
.circleci refactor circleci config to 2.0 2019-03-08 16:03:40 -05:00
.github Remove consul-docs automatic PR review (#5306) 2019-02-01 10:48:52 -08:00
acl New ACLs (#4791) 2018-10-19 12:04:07 -04:00
agent Optimize health watching to single chan/goroutine. (#5449) 2019-03-15 20:18:48 +00:00
api fix typos reported by golangci-lint:misspell (#5434) 2019-03-06 11:13:28 -06:00
bench Gets benchmarks running again and does a rough pass for 0.7.1. 2016-11-29 13:02:26 -08:00
build-support build: fix 'make ui' scripts so that it can handle versions like "v1.4.0-rc1-55-g2c8675565-rc1 (2c8675565)" (#4920) 2019-01-29 14:24:26 -06:00
command fix typos 2019-03-06 14:47:33 -05:00
connect fix typos reported by golangci-lint:misspell (#5434) 2019-03-06 11:13:28 -06:00
demo demo: Added udp port forwarding 2018-05-30 13:56:56 +09:00
ipaddr New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
lib fix typos reported by golangci-lint:misspell (#5434) 2019-03-06 11:13:28 -06:00
logger fix typos reported by golangci-lint:misspell (#5434) 2019-03-06 11:13:28 -06:00
sentinel Renames stubs to be more consistent. 2017-11-29 18:36:52 -08:00
service_os Changes made : 2018-06-28 21:18:14 -04:00
snapshot snapshot: read meta.json correctly. (#5193) 2019-01-08 17:06:28 +01:00
terraform terraform: fix formatting of consul.tf (#4580) 2018-10-24 08:02:38 -07:00
test snapshot: read meta.json correctly. (#5193) 2019-01-08 17:06:28 +01:00
testrpc speed up TestHTTPAPI_MethodNotAllowed_OSS from 11s -> 0.5s (#5268) 2019-01-25 10:01:21 -06:00
testutil testutil: Set the environment variable NOLOGBUFFER=1 to have test agent logs go straight to stdout 2019-02-13 13:13:10 -06:00
tlsutil agent: enable reloading of tls config (#5419) 2019-03-13 10:29:06 +01:00
types Removes remoteConsuls in favor of the new router. 2017-03-16 16:42:19 -07:00
ui update ffi to dodge CVE-2018-1000201 (#4670) 2018-09-14 11:22:48 +02:00
ui-v2 ui: Custom version of ember-block-slots compatible with ember 3 (#5245) 2019-01-30 10:56:04 +00:00
vendor acl: reduce complexity of token resolution process with alternative singleflighting (#5480) 2019-03-14 09:35:34 -05:00
version Putting source back into Dev Mode 2019-03-05 19:26:42 +00:00
watch fix typos reported by golangci-lint:misspell (#5434) 2019-03-06 11:13:28 -06:00
website Docs Proofing (#5424) 2019-03-15 09:35:33 -05:00
.dockerignore Update the scripting 2018-06-14 21:42:47 -04:00
.gitignore merge feedback: fix typos; actually use deliverLatest added previously but not plumbed in 2018-10-10 16:55:34 +01:00
.travis.yml travis: enable branch builds for f-acl-ux and stop doing them for f-envoy 2019-02-13 14:05:09 -06:00
CHANGELOG.md Update CHANGELOG.md 2019-03-15 20:16:13 +00:00
GNUmakefile CA Provider Plugins (#4751) 2019-01-07 12:48:44 -05:00
INTERNALS.md docs: correct link to top level agent package (#4750) 2018-10-04 09:15:55 -05:00
LICENSE Initial commit 2013-11-04 14:15:27 -08:00
NOTICE.md add copyright notice file 2018-07-09 10:58:26 -07:00
README.md Contribution guide (#4704) 2018-10-05 09:06:40 -07:00
Vagrantfile Adds a basic Linux Vagrant setup, stolen from Nomad. 2017-10-06 08:10:12 -07:00
main.go Added Side Effect import for Windows Service 2018-06-18 14:55:11 -04:00
main_test.go Adding basic CLI infrastructure 2013-12-19 11:22:08 -08:00

README.md

Consul Build Status Join the chat at https://gitter.im/hashicorp-consul/Lobby

Consul is a tool for service discovery and configuration. Consul is distributed, highly available, and extremely scalable.

Consul provides several key features:

  • Service Discovery - Consul makes it simple for services to register themselves and to discover other services via a DNS or HTTP interface. External services such as SaaS providers can be registered as well.

  • Health Checking - Health Checking enables Consul to quickly alert operators about any issues in a cluster. The integration with service discovery prevents routing traffic to unhealthy hosts and enables service level circuit breakers.

  • Key/Value Storage - A flexible key/value store enables storing dynamic configuration, feature flagging, coordination, leader election and more. The simple HTTP API makes it easy to use anywhere.

  • Multi-Datacenter - Consul is built to be datacenter aware, and can support any number of regions without complex configuration.

  • Service Segmentation - Consul Connect enables secure service-to-service communication with automatic TLS encryption and identity-based authorization.

Consul runs on Linux, Mac OS X, FreeBSD, Solaris, and Windows. A commercial version called Consul Enterprise is also available.

Please note: We take Consul's security and our users' trust very seriously. If you believe you have found a security issue in Consul, please responsibly disclose by contacting us at security@hashicorp.com.

Quick Start

An extensive quick start is viewable on the Consul website:

https://www.consul.io/intro/getting-started/install.html

Documentation

Full, comprehensive documentation is viewable on the Consul website:

https://www.consul.io/docs

Contributing

Thank you for your interest in contributing! Please refer to CONTRIBUTING.md for guidance.