Skip to content

Regex overhead is high with a large number of clusters #2373

@jmarantz

Description

@jmarantz

Description:
See #2063 and the 10k testcase. In that testcase, with #2358 applied, the 30 second startup time is dominated by regex code associated with tags.

I did a little debugging to try to understand the tags, and I still don't. But my naive observation is that we are applying a bunch of regexes to stat names to do this transform (in Counter& ThreadLocalStoreImpl::ScopeImpl::counter():

input:
    name = "http.admin.downstream_cx_http1_total"
outputs:
   tag_extracted_name = "http.downstream_cx_http1_total"
   tags = vector {{
      name_ = "envoy.http_conn_manager_prefix", 
      value_ = "admin"
   }}

My feeling is that this is a structural transformation that could be done much faster if the name structure is retained in the stat structures, rather than flattening the string in stats and then rediscovering. But I don't have enough of a feel for whether this alone would make startup fast, or whether the effort to fix would be worth instant startups on huge numbers of clusters.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions