[SOLVED] Proxmox 4 LXC CPU limit and disk size

Rokixz

New Member
Aug 26, 2014
11
0
1
Šiauliai, Lithuania
Hello,

First of all I want to thank you for this great release, however I have some questions regarding LXC, I am newbie user of this container system so any help will be appreciated:

I have converted openvz containers to LXC and everything works so great so far except two things:

CPU limits seems to be not working - it just use host CPU number - does not matter if I reduce or increase the value.

Second thing is regarding storage - I have migrated all my containers to LVM, but how to reduce or increase a storage size? The Edit option is blank so I am worried what should I do if I will lack of space (should I extend logical volume size or what?).

So long story short: How to limit CPU cores number of LXC containers and how to extend or reduce containers storage in LVM volumes?

Available schedulers for my hard disks:

noop [deadline] cfq

CPU model: Intel(R) Xeon(R) CPU X3450 @ 2.67GHz

P.S.

If there are similar topics please give me a link and sorry in advance because I was unable to search such topic.
 
Last edited:
Did you test CPU limits in containers and they didn't work?

Here's the top output on hypervisor with a 1CPU container and two "yes" processes
Code:
  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
61594 root      20   0    4376    960    868 R  50.8  0.0   0:33.82 yes
61621 root      20   0    4376    956    864 R  48.8  0.0   0:29.31 yes

As expected, each "yes" takes half of the single core configured.
 
Did you test CPU limits in containers and they didn't work?

Here's the top output on hypervisor with a 1CPU container and two "yes" processes
Code:
  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
61594 root      20   0    4376    960    868 R  50.8  0.0   0:33.82 yes
61621 root      20   0    4376    956    864 R  48.8  0.0   0:29.31 yes

As expected, each "yes" takes half of the single core configured.

It would be glad if you could write down the command you are running.

I check the CPU numbers using that command:

cat /proc/cpuinfo | grep processor | wc -l
8

but CPU number is set as 6 in my container. Maybe it should be like that I do not really know - I am new to LXC, however KVM machines are working fine as previously.

Thank you for your response anyway.
 
You didn't check the cpu. You've read /proc/cpuinfo, but /proc is bind mounted inside containers. So you are basically reading the same "file" inside our outside the container.
 
You didn't check the cpu. You've read /proc/cpuinfo, but /proc is bind mounted inside containers. So you are basically reading the same "file" inside our outside the container.

OK I understand now, one problem is solved now, it would be glad to hear anything about the storage issue.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!