-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
locality zone name is looked up often when running with --use-fake-symbol-table 0 #11573
Comments
on it |
This turns out to be a little messier than anticipated. @rgs1 suggested above we could store a map in the PriorityStateManager, but is one of those always available when we make HostDescriptionImpls? I started to make that change but found the fanin of contexts growing. I'll take a look more later with fresh start. Also, I think as @rgs1 observed this is not really mission-critical because these don't get created in the request flow, IIUC. |
@mattklein123 could use your advice on which of the many places (dozens?) But because there are so many instances where Hostimpl is instantiated, and I'm not sure they all are triggered by xDS, I might lull myself into thinking I've fixed this problem when I might only have captured the names one level in the call-stack higher but no less frequently. Thanks for your help! |
I would assume it's during the EDS update process? cc @snowp |
I would imagine the main flow is through EDS updates, though new |
I'm considering making the zone-name a dynamic segment so we just avoid this issue and the huge refactor to keep zone->StatName maps available for all callers. Switching to a dynamic segment is (for the impl) one-word change:
A future refactor could make it feasible to track a symbolic StatName for each zone through the call-sites but I think this makes sense for now. SG? |
I like it -- I don't think introducing the zone --> StatName maps is worth the complexity at this point. If switching to a dynamic segment makes the lookups go away (at the expense of some allocations maybe -- not that it matters, not a hot path anyway), I think we should do it. |
When disabling the fake symbol table, I see the following:
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 aHostDescription
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>
inPriorityStateManager
, and the just pass a reference to theStatName
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
The text was updated successfully, but these errors were encountered: