Wednesday, 2019-02-27

*** igordc has quit IRC00:09
*** lcastell has joined #kata-general00:25
*** lcastell has quit IRC00:26
*** lcastell has joined #kata-general00:59
*** igordc has joined #kata-general01:26
*** lcastell has quit IRC01:29
*** sameo has quit IRC02:09
*** igordc has quit IRC02:40
*** igordc has joined #kata-general02:40
kata-irc-bot<kmacleod> Hi folks. Using Kata 1.5, Kube 1.12. I’m trying to manipulate my pod spec such that kata allocates 8 vCPUs to the pod’s VM, but the relationship between the pod spec’s CPU resource limits and the number of allocate CPus isn’t obvious from experimentation.05:26
*** tmhoang has joined #kata-general07:26
*** sgarzare has joined #kata-general07:56
kata-irc-bot<xwlpt> Kata container reserved one cpu and 2G memory by default for VM08:25
*** gwhaley has joined #kata-general08:49
*** igordc has quit IRC09:25
*** sameo has joined #kata-general09:44
kata-irc-bot<graham.whaley> hi @kmacleod - there is an algo, but it is maybe slightly more complex than one expects as we try to take into account CPU resource needed by the VM/kata itself as well as handling different CPU requirements across multiple containers in the same pod (VM). There are some docs at https://github.com/kata-containers/documentation/blob/master/constraints/cpu.md that hopefully help explain. If you think we can improve them, edits10:46
kata-irc-botmost welcome!10:46
*** stackedsax has quit IRC13:53
*** stackedsax has joined #kata-general13:54
*** igordc has joined #kata-general13:56
*** igordc has quit IRC15:11
*** tmhoang has quit IRC16:12
*** sgarzare has quit IRC17:18
*** tmhoang has joined #kata-general17:22
*** igordc has joined #kata-general19:31
*** gwhaley has quit IRC19:52
*** sameo has quit IRC22:22
kata-irc-bot<kmacleod> Yeah, I figured as much. I did read that page previously, but it’s rather light on detail. A few more concrete, non-trivial examples would go a long way top explain things. I’ve been trying to deduce the algorithm empirically but it’s hard to get a grip on.22:59
kata-irc-bot<kmacleod> For example, if I have a pod spec that has a cpu limit of “8”, I get 4 vcpus23:08
kata-irc-bot<eric.ernst> @kmacleod agreed!23:12
kata-irc-bot<eric.ernst> I'll work to update this, with some example yaml, and resulting VM specs.23:13
kata-irc-bot<eric.ernst> i don't expct 4 vCPU if you have a limit of 8, btw.23:13
kata-irc-bot<eric.ernst> Is this just an example you made up or something you observed?23:13
kata-irc-bot<eric.ernst> And ... thanks for the feedback -- much appreciated!23:13
kata-irc-bot<kmacleod> does it depend on the physical CPUs on the host?23:13
kata-irc-bot<eric.ernst> @julio.montes will know best.23:14
kata-irc-bot<eric.ernst> it doesn't map 1:1, unless you are using somethinng like CPU sets (cpu manager with static)23:15
kata-irc-bot<eric.ernst> its just the number of hypervisor threads (vcpus) which are started.23:15
kata-irc-bot<eric.ernst> Realistically, you don't want to start more threads than CPUs, but i'm not sure if we specificalyl capped that.23:16
kata-irc-bot<eric.ernst> your k8s scheduler, however, should take this into account23:16
kata-irc-bot<kmacleod> sure23:16
kata-irc-bot<eric.ernst> Kenny, you based out of Australia?23:17
kata-irc-bot<kmacleod> Here’s an example podspec, for example. 3 containers, one with a cpu limit of 8, one with 4, another with no limit. When I exec into container1 and `cat /proc/cpuinfo` I see 5 vCPUs.23:18
kata-irc-bot<kmacleod> yeah, australia23:18
kata-irc-bot<eric.ernst> interesting.  to verify -- you're on 1.5 kata?23:19
kata-irc-bot<kmacleod> If I change those values, the number of vCPUs does go up and down, just not by a number I can predict23:19
kata-irc-bot<kmacleod> yeah, 1.523:19
kata-irc-bot<eric.ernst> that's concerning.23:19
kata-irc-bot<eric.ernst> @jose.carlos.venegas.m ^ you have any ideas here?23:19
kata-irc-bot<eric.ernst> it shoudl just be the sum of the container requests + default23:20
kata-irc-bot<eric.ernst> default being from the configuration.toml for kata.23:20
kata-irc-bot<kmacleod> yeah, I beliebe the default is still 123:20
kata-irc-bot<eric.ernst> so, I would espect you get 13 vCPU23:20
kata-irc-bot<kmacleod> IIRC, when I last looked at this under kata 1.3, it behaved as you describe23:20
kata-irc-bot<eric.ernst> well, we did work to improve things.23:21
kata-irc-botAction: jose.carlos.venegas.m looks23:21
kata-irc-bot<kmacleod> yeah, I understand there were improvements related to not over-provisioning when there were fractional values used23:21
kata-irc-bot<eric.ernst> before, in 1.3, if you had  1 containr which requsts 500 mCPU and another that requests 200 mCPU, it would result in 3 (1 default, 1 for ctr1, 1 for ctr2).  this was wrong, imo, and we should have fixed this.23:21
kata-irc-bot<eric.ernst> yeap.23:21
kata-irc-bot<eric.ernst> I have a cluster up and give this a test, but I won't be able to dive into it for a few more hours.23:22
kata-irc-bot<eric.ernst> It's a bit early in your day (i don't math good, so correct me :)), so hopefully i'll have more news before EOD for you23:22
kata-irc-bot<eric.ernst> if we're lucky Carlos, @jose.carlos.venegas.m, may have input sooner.23:22
kata-irc-bot<kmacleod> that would great if you could, thanks. not massively urgent at this point, but it will become a blocker for us in the next week or so23:22
kata-irc-bot<eric.ernst> Yea, undertsood.23:23
kata-irc-bot<kmacleod> at this point I’d settle for just being able to predict the result, even if I can’t make it do what I want23:23
kata-irc-bot<eric.ernst> :slightly_smiling_face:23:23
kata-irc-bot<eric.ernst> The current behavior is certainly not expected, and I'll need to dig into our CI to make sure this is covered already (it should be...)23:23
kata-irc-bot<eric.ernst> thanks for bringing it up.23:24
kata-irc-bot<kmacleod> :thumbsup: thanks for the help23:24
kata-irc-bot<eric.ernst> If you like open source karam bonus points, if you can open a github issue it'd be awesome23:24
kata-irc-bot<eric.ernst> https://github.com/kata-containers/runtime/issues/new23:24
kata-irc-bot<kmacleod> will do23:25
kata-irc-bot<kmacleod> just a sanity check - I should see the same number of vCPUs regardless of which container in the pod I exec into, right?23:25
kata-irc-bot<eric.ernst> Yah, it should show all of the available ones in the Virtual Machine.23:26
kata-irc-bot<kmacleod> yeah23:26
kata-irc-bot<eric.ernst> but the container would be constrained to just use what it is allocated via cgroups23:27
kata-irc-bot<kmacleod> also, are we talking podspec cpu requests or cpu limits here? My example uses limits. If I change the requested value, it doesn’t seem to have any effect.23:27
kata-irc-bot<kmacleod> although I’ll do a bit more fiddling with it to verify that23:27
kata-irc-bot<eric.ernst> you can just set one; it gives you a guaranteed pod (if you just say limits, it sets req and limits to the same)23:32
kata-irc-bot<eric.ernst> these are container spec23:32
kata-irc-bot<kmacleod> ah ok23:32
kata-irc-bot<eric.ernst> there actually isn't a limits/requests for resourcs in the podspec, just container23:32
kata-irc-bot<kmacleod> yep23:32
kata-irc-bot<eric.ernst> (though there are talks of adding this ...)23:33
kata-irc-bot<eric.ernst> (i undrstand that was an interesting use case for atlassian before)23:33
kata-irc-bot<kmacleod> yeah, for our use case it would be nicer if we could specify memory and cpu limits at the pod level, to remove the need for our users to partition the memory23:33
kata-irc-bot<kmacleod> https://github.com/kata-containers/runtime/issues/129223:36
kata-irc-bot<eric.ernst> Yeah, i think other sig-node folks agree.23:36
kata-irc-bot<eric.ernst> I'm working on a KEP which may add this to the scope.23:36
kata-irc-bot<kmacleod> nice23:36

Generated by irclog2html.py 2.15.3 by Marius Gedminas - find it at mg.pov.lt!