-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stats: Filter stats to be flushed to sinks (#18805)
Provide the ability to filter stats to be flushed to sinks to reduce CPU usage for the periodic stats aggregation process. Commit Message: Additional Description: Envoy stats are periodically flushed to stat sinks (default cadence of 5s) on the main thread. The number of stats scales linearly with the number of clusters, as approximately 100 stats are replicated for each cluster. For high counts of clusters (order of 10k), the flushing of stats dominates CPU usage on the main thread. Being tied up in stats flushing can prevent the main thread from processing xDS updates in a timely manner, or even starve worker threads of CPU if the CPU is overcommitted. Usually, the number of stats of interest can be an order of magnitude lower than the number of stats. There is a mechanism to reject unwanted stats, but doing so will also make them unavailable for viewing in the admin console, which could hinder debuggability. Further, Envoy actually needs some of its stats to run (see for eg. #14610) which is currently an open bug. See the design doc below for more details: https://docs.google.com/document/d/1lzMvRlU5xY0yezpqA75N6kU747GY7I_WeGpBXiPaP5M/edit#heading=h.xgjl2srtytjt Risk Level: Low Testing: Added tests Docs Changes: NA Release Notes: NA Platform Specific Features: NA See below benchmark results from //test/server:server_stats_flush_benchmark ``` ---------------------------------------------------------------------------------- Benchmark Time CPU Iterations ---------------------------------------------------------------------------------- bmFlushToSinks/10 0.003 ms 0.003 ms 247626 bmFlushToSinks/100 0.019 ms 0.019 ms 36474 bmFlushToSinks/1000 0.193 ms 0.193 ms 3622 bmFlushToSinks/10000 2.25 ms 2.25 ms 299 bmFlushToSinks/100000 61.8 ms 61.8 ms 10 bmFlushToSinks/1000000 1212 ms 1212 ms 1 bmFlushToSinksWithPredicatesSet/10 0.001 ms 0.001 ms 496056 bmFlushToSinksWithPredicatesSet/100 0.007 ms 0.007 ms 104775 bmFlushToSinksWithPredicatesSet/1000 0.067 ms 0.067 ms 10411 bmFlushToSinksWithPredicatesSet/10000 0.704 ms 0.704 ms 938 bmFlushToSinksWithPredicatesSet/100000 28.0 ms 28.0 ms 25 bmFlushToSinksWithPredicatesSet/1000000 484 ms 484 ms 2 ``` Signed-off-by: Pradeep Rao <[email protected]>
- Loading branch information
1 parent
c07bfee
commit 55a97dd
Showing
23 changed files
with
527 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.