stats: when creating a new stat, extra symbol table locks are taken during tag extraction
- Dominant language
- C++
- Stars
- 28.9k
- Forks
- 5.6k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 428
Description
I don't believe this is a serious performance issue because once a stat is created and placed in the central cache, this does not occur. But when a stat is initially created in a scope, the tag extraction process generates a new string that requires symbol-table lookup.
I have an in-progress solution to this I started quite some time ago and it's not compiling at this time: https://github.com/jmarantz/envoy/tree/tag-extract-without-symtab-lock -- I'm not sure it's worth the complexity it adds, but I wanted not to lose track of it.
An example of /stats/recentlookups output for a server we have in production illustrates the issue:
```
Count Lookup
90 vhost.vcluster.upstream_rq_retry
90 vhost.vcluster.upstream_rq_retry_limit_exceeded
90 vhost.vcluster.upstream_rq_retry_overflow
90 vhost.vcluster.upstream_rq_retry_success
90 vhost.vcluster.upstream_rq_timeout
90 vhost.vcluster.upstream_rq_total
105 host_REDACTED
525 _default
540 envoy.virtual_cluster
540 envoy.virtual_host
540 other
total: 15785
```
This server has been running for a long time so a total of 15k lookups spread over time is totally reasonable. ANd the numbers for (e.g. `envoy.virtual_cluster` grow slowly over time. But it would be nice if this display were clean and there were no repeated lookups of the same stat names.
Contributor guide
Assessment
This issue has not been assessed yet.