-
Notifications
You must be signed in to change notification settings - Fork 168
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
virt-install: do not assign vpu's when executed in Kubernetes #284
Conversation
Example of a pod where this can be seen:
If you assign 64 VCPU's when the resource cap is set to 1CPU, then the VM will hang during boot up and get confused about the time.
|
# to a VM hang. (e.g. 64 vcpu's to a 1 cpu assignment...) | ||
p1c = open("/proc/1/cgroup") | ||
if re.search(r'.*kubepods.*', p1c.read()): | ||
return '--vcpus=sockets=1,cores=1,threads=1' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Humm...I swear we tested this though. When I e.g. rsh into a MCD pod and type nproc
I get 2
which matches the host.
You're saying this code is returning 64
today?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I saw this in OpenShift where I had a resource limit of 2CPU's. Looking at the logs, it was clearly getting 64.
Related: moby/moby#20770 |
Hm so I guess Edit: Here's what they ended up doing for the JVM: http://hg.openjdk.java.net/jdk/hs/rev/7f22774a5f42 (man, ugly C++) |
What if we just capped it at 2? We don't need extreme performance but going down to 1 is a bit harsh. |
I went with 1 since AFAIK, there is no good way to tell what the vcpu allocation is. If you go with 2 and you only have a 1vcpu allocation then performance will suffer. Really, any choice is going to be harsh. |
src/virt-install
Outdated
@@ -51,6 +51,14 @@ def get_libvirt_smp_arg(): | |||
See e.g. https://www.redhat.com/archives/libvirt-users/2017-June/msg00025.html | |||
We want to match the number of host physical cores. | |||
""" | |||
|
|||
# When running under K8S, the scehduling may be much more restrictive than | |||
# physical core count, and the code below will assing that count, leading |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/assing/assign/ ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also s/scehd/sched/ :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ha, re-pushed.
so we are running this in kube/openshift in centos CI. I guess we've been lucky we haven't hit a performance issue yet? |
Seems like we're assigning 20 vCPUs there: http://artifacts.ci.centos.org/fedora-coreos/prod/builds/latest/install.log. Though |
Before merging this, any thoughts on @cgwalters request for 2 over 1 vcpu? I mean, this is rock and a hard place. I don't see a good answer until we have support elsewhere. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I trust @darkmuggle knows what he is doing :)
Eh it's simplest to go down to 1 for now I guess. |
Out of interest: the TL;DR of that OpenJDK HotSpot patch is that they're doing |
No description provided.