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

Configuration settings should take units in the value, not put units in the setting name #27

Closed
briansmith opened this issue Dec 8, 2017 · 3 comments
Assignees

Comments

@briansmith
Copy link
Contributor

Consider CONDUIT_PROXY_EVENT_BUFFER_CAPACITY. What units is this setting measured in? Currently the units are implicitly bytes, e.g. CONDUIT_PROXY_EVENT_BUFFER_CAPACITY=10000 means 10,000 bytes. Instead of having implicit units, we should use explicit units so we can write, e.g. CONDUIT_PROXY_EVENT_BUFFER_CAPACITY=10kb (for base-2 kilobytes) or CONDUIT_PROXY_EVENT_BUFFER_CAPACITY=10000b (for bytes), etc.

Similarly we have CONDUIT_PROXY_METRICS_FLUSH_INTERVAL_SECS. This is better because the name of the setting gives the units so one doesn't have to guess. However, we've already run into a case during testing where we want to use a sub-second unit. This setting should instead by named CONDUIT_PROXY_METRICS_FLUSH_INTERVAL and accept values with units specified, e.g. 10s for 10 seconds or 200ms for 200 milliseconds.

Similar concerns apply to other settings, not just in the proxy, but also in the other components.

@hawkw
Copy link
Contributor

hawkw commented Dec 8, 2017

Okay, I wrote a lot of these configuration settings, so I'd be happy to fix this.

@briansmith
Copy link
Contributor Author

Great. I'll merge b/env5 (#24, #25, #26) as soon as I get on a network where I can re-verify that everything is working in minikube. (This issue is a follow-up to those PRs.)

@hawkw
Copy link
Contributor

hawkw commented Dec 8, 2017

Sounds good to me. Do you think we ought to interpret these settings with a default unit in cases where one is not provided (so as to not break existing configs), or treat missing units as a parse error (cc @olix0r)?

@olix0r olix0r closed this as completed in 63fbbd6 May 8, 2018
@briansmith briansmith assigned olix0r and unassigned hawkw May 9, 2018
khappucino pushed a commit to Nordstrom/linkerd2 that referenced this issue Mar 5, 2019
Configuration values that take durations are currently specified as
time values with no units.  So `600` may mean 600ms in some contexts and
10 minutes in others.

In order to avoid this problem, this change now requires that
configurations provide explicit units for time values such as '600ms' or
10 minutes'.

Fixes linkerd#27.
khappucino pushed a commit to Nordstrom/linkerd2 that referenced this issue Mar 5, 2019
Required for linkerd#1322.

Currently, the proxy places a limit on the number of active routes
in the route cache. This limit defaults to 100 routes, and is intended
to prevent the proxy from requesting more than 100 lookups from the 
Destination service. 

However, in some cases, such as Prometheus scraping a large number of
pods, the proxy hits this limit even though none of those requests 
actually result in requests to service discovery (since Prometheus 
scrapes pods by their IP addresses). 

This branch implements @briansmith's suggestion in 
linkerd#1322 (comment).
It splits the router capacity limit to two separate, configurable 
limits, one that sets an upper bound on the number of concurrently 
active destination lookups, and one that limits the capacity of the
router cache.

I've done some preliminary testing using the `lifecycle` tests, where a
single Prometheus instance is configured to scrape a very large number 
of proxies. In these tests, neither limit is reached. Furthermore, I've added
integration tests in `tests/discovery` to exercise the destination service 
query limit. These tests ensure that query capacity is released when inactive
routes which create queries are evicted from the router cache, and that the
limit does _not_ effect DNS queries.

This branch obsoletes and closes linkerd#27, which contained an earlier version of
these changes.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants