Repository navigation
Closed
Description
... the bad news is that we're allocating too much in policy again :)
From test-cmd in memprofile, it looks like we are bypassing / flushing the policy cache very aggressively (in an N^2 or N^3 pattern, maybe?) and so we are allocating lots of objects. For a test-cmd run we make ~40k API calls, but we are allocating ~26.5 million objects. It looks like confirmNoEscalation is the source of the GetClusterPolicy and GetEffectivePolicyRules calls, and it does not appear to be hitting caches. Should be reproducible with the following command (will dig in tomorrow and look for anything obvious).
$ OPENSHIFT_PROFILE=mem hack/test-cmd.sh
21188269 of 77583010 total (27.31%)
Dropped 4165 nodes (cum <= 387915)
Showing top 30 nodes out of 307 (cum >= 11648542)
flat flat% sum% cum cum%
0 0% 0% 35049045 45.18% runtime.goexit
0 0% 0% 26480274 34.13% k8s.io/kubernetes/pkg/runtime/serializer/versioning.(*codec).Decode
70156 0.09% 0.09% 23742880 30.60% k8s.io/kubernetes/pkg/runtime/serializer/json.(*Serializer).Decode
0 0% 0.09% 23215417 29.92% github.com/ugorji/go/codec.(*Decoder).Decode
0 0% 0.09% 23215417 29.92% github.com/ugorji/go/codec.(*Decoder).decode
0 0% 0.09% 22511738 29.02% github.com/ugorji/go/codec.(*Decoder).decodeI
4215935 5.43% 5.52% 22444678 28.93% github.com/ugorji/go/codec.(*decFnInfo).kStruct
0 0% 5.52% 21898462 28.23% github.com/ugorji/go/codec.(*Decoder).decodeValue
11791 0.015% 5.54% 20675631 26.65% k8s.io/kubernetes/pkg/storage/etcd.(*etcdHelper).bodyAndExtractObj
22210 0.029% 5.57% 20280901 26.14% k8s.io/kubernetes/pkg/storage/etcd.(*etcdHelper).extractObj
26964 0.035% 5.60% 19947641 25.71% k8s.io/kubernetes/pkg/runtime/serializer/recognizer.(*decoder).Decode
0 0% 5.60% 19898074 25.65% k8s.io/kubernetes/pkg/storage/etcd.(*etcdHelper).Get
0 0% 5.60% 19840076 25.57% k8s.io/kubernetes/pkg/registry/generic/registry.(*Store).Get
0 0% 5.60% 19572675 25.23% github.com/ugorji/go/codec.(*decFnInfo).kSlice
0 0% 5.60% 19179545 24.72% k8s.io/kubernetes/pkg/storage.(*Cacher).Get
21270 0.027% 5.63% 17591168 22.67% github.com/openshift/origin/pkg/authorization/rulevalidation.(*DefaultRuleResolver).GetEffectivePolicyRules
0 0% 5.63% 17293989 22.29% github.com/openshift/origin/pkg/authorization/registry/clusterpolicy.(*storage).GetClusterPolicy
Activity
deads2k commentedon Jun 16, 2016
@smarterclayton How about holding on the re-run until I've had time to plumb through shared caches?
smarterclayton commentedon Jun 16, 2016
This seems a straight up regression, unless there's something I don't know
about the policy caches. That not the case?
On Jun 16, 2016, at 7:31 AM, David Eads [email protected] wrote:
@smarterclayton https://github.com/smarterclayton How about holding on
the re-run until I've had time to plumb through shared caches?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#9368 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ABG_p7IwDjLdgWYj0RFMG0p-s7YP7N22ks5qMTQTgaJpZM4I3Bqk
.
soltysh commentedon Jun 16, 2016
/sub
deads2k commentedon Jun 16, 2016
There are a couple spots to do with scoped tokens that bypass the cache since we didn't have clean plumbing for them. Fixing that is near the top of my list. I also want to re-wire our existing caches to use the new cache style we have.
smarterclayton commentedon Jun 16, 2016
[-]The good news is that I have performance numbers[/-][+]Significant regression in API server due to policy code path[/+]timothysc commentedon Jun 16, 2016
ack /cc @mffiedler
smarterclayton commentedon Jun 23, 2016
mem.pdf
smarterclayton commentedon Jun 23, 2016
smarterclayton commentedon Jun 23, 2016
This is @ 7c4fc5a
smarterclayton commentedon Jun 23, 2016
which I think is the same, is the bulk of them. It looks like we make ~1-3 per mutation call.
deads2k commentedon Jun 24, 2016
How easy/hard is it to get the comparison mem chart for 1.2? Do you have a script?
Given that its the
GetEffectivePolicyRulescall, I'd suspect this copy: https://github.com/openshift/origin/blob/master/pkg/authorization/rulevalidation/find_rules.go#L130-L145, but its been around forever. I can refactor it to[][]PolicyRuleand avoid copying all the rules every request.smarterclayton commentedon Jun 24, 2016
I think the command has worked since 1.0.
On Jun 24, 2016, at 7:54 AM, David Eads [email protected] wrote:
which I think is the same, is the bulk of them. It looks like we make ~1-3
per mutation call.
How easy/hard is it to get the comparison mem chart for 1.2? Do you have a
script?
Given that its the GetEffectivePolicyRules call, I'd suspect this copy:
https://github.com/openshift/origin/blob/master/pkg/authorization/rulevalidation/find_rules.go#L130-L145,
but its been around forever. I can refactor it to [][]PolicyRule and avoid
copying all the rules every request.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#9368 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ABG_p_nvo81TIs37pqBsR7g6MMEXBceHks5qO8VQgaJpZM4I3Bqk
.
deads2k commentedon Jul 20, 2016
Clayton thinks he's got this.
smarterclayton commentedon Jul 25, 2016
Almost resolved with #9814
deads2k commentedon Jul 25, 2016
Wasn't that pre-existing?
smarterclayton commentedon Jul 25, 2016
The fix in there fixes conversions.