Skip to content

locality zone name is looked up often when running with --use-fake-symbol-table 0 #11573

@rgs1

Description

@rgs1

When disabling the fake symbol table, I see the following:

$ while :; do curl -s 0:9901/stats/recentlookups ; echo ; sleep 1 ; done
....
   36778 zone_name_X
   36913 zone_name_Y
   36979 zone_name_Z
...

Note: those numbers aren't going up that fast, it's a few thousand every couple of seconds. Also, it doesn't show up in CPU/mem perf profiling. But it might still be good to clean it up.

What we probably want is to avoid creating a new Stats::StatNameManagedStorage every time a HostDescription instance is constructed:

https://github.com/envoyproxy/envoy/blob/master/source/common/upstream/upstream_impl.cc#L257

We could have a std::unordered_map<std::string, StatName> in PriorityStateManager, and the just pass a reference to the StatName every time a HostImpl is created here:

https://github.com/envoyproxy/envoy/blob/master/source/common/upstream/upstream_impl.cc#L1210

Again, I don't think this is a blocker for changing the default value on the --use-fake-symbol-table flag.

cc: @jmarantz

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions