Ask Your Question
2

1 vcore instance is using 100% of node's CPU

asked 2013-11-28 01:52:58 -0500

jamesmarkof gravatar image

I have a default set up as per this document: http://docs.openstack.org/trunk/install-guide/install/apt/content/

So I have a controller node and a compute node. The compute node has an 8-core AMD processor and 16GB of RAM. I created an instance on it with 2GB of ram and 1 vcore (flavor:small). Now here is what's peculiar - when I run a processor intensive operation on the instance, say John The Ripper, the whole compute node is utilizing 100% of CPU.

Why does that happen? Why doesn't the instance stay within the confines of the resources I allocate to it?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-12-23 10:48:40 -0500

jtopjian gravatar image

updated 2013-12-23 18:19:43 -0500

This is because OpenStack is not placing any boundaries on the amount of CPU that the instance can claim. Note that a single core in use can still peg a server with high load. Look into cgroups to learn how to place resource restrictions on instances. In the case of CPU, you'll want to limit the amount of "cpu shares" that an instance has access to. This _should_ throttle the usage.

You will need to do this outside of OpenStack as I don't believe OpenStack has support for this yet. I have seen blueprints and wiki entries for this type of feature, but I'm not sure of an implementation status.

Edit: I stand corrected. It looks as though setting CPU shares is possible!

http://docs.openstack.org/admin-guide-cloud/content/ch_introduction-to-openstack-compute.html

See the section on "Flavors".

edit flag offensive delete link more

Comments

I see. But wouldn't this defeat the purpose of vcpu allocation? What's the reason for picking it if OpenStack does not adhere to what you select and simply allocated all the CPU resource to every instance running on the node?

jamesmarkof gravatar imagejamesmarkof ( 2013-12-23 14:45:11 -0500 )edit

The benefit of vcpu allocations is to allow your instances to take advantage of multiple cpus. Maybe I'm misunderstanding the issue you're having. If you use a tool such as htop, do you see *all* cores pegged? Or just one core?

jtopjian gravatar imagejtopjian ( 2013-12-23 14:47:22 -0500 )edit

Oh so vcpu only plays a role when there are more than one CPUs on the node? Am I understanding it correctly?

jamesmarkof gravatar imagejamesmarkof ( 2013-12-23 16:40:06 -0500 )edit

A vcpu (virtual cpu) is the number of cpus that an instance has. "virtual" has two meanings here. one: the cpus are being assigned to a virtual machine. two: vcpus are not one-to-one mappings to physical cpus on the compute node. 1 vcpu would equal 1 physical core but openstack applies a ...

jtopjian gravatar imagejtopjian ( 2013-12-23 16:45:07 -0500 )edit

... 16:1 overcommit ratio to cpus. So one physical core actually equals 16 vcpus that you can allocate to instances in OpenStack. With that in mind, though, if you have an instance with 1 cpu (cat /proc/cpuinfo), and it's running a job like john the ripper, it should only be affecting one...

jtopjian gravatar imagejtopjian ( 2013-12-23 16:46:46 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2013-11-28 01:52:58 -0500

Seen: 604 times

Last updated: Dec 23 '13