CentOS 7, Container Question
Hi, folks,
We would like to run a container on a server, the reason being the COST
of a Sybase license (it’s by core), and what we can afford is a 4-core license. Now, the server’s a nice Dell w/ 32 cores, so, ideally, what we want to do is set up containers, then, in one container, *only* have it see 4 cores, while the rest of the server, including (possibly)
other containers, can see the other 28. The first try seems to have disabled *all* the cores other than those four.
Is it possible to do what we want, and if so, some pointers would be most appreciated.
mark
9 thoughts on - CentOS 7, Container Question
You can do that with Virtual Box. I haven’t tried it with anything else, but Virtual Box allows you to set (and change) the number of cores available to the session.
I’ve been wracking my brain, but for the life of me can’t recall the exact program name, but back when I managed a HPCC, there was a tool that would let you restrict a running process to X number of CPUs/Cores natively. I
keep thinking it was MPC, but nothing googles on that. Regardless, that might be a better way of running Sybase, as a container may not be beefy enough to handle the load Sybase is likely to generate.
—
Mark Haney ::: Senior Systems Engineer
*VIF* *International Education*
P.O. Box 3566 ::: Chapel Hill, N.C. 27515 ::: USA
919-265-5006 office
Global learning for all. http://www.viflearn.com Find VIF on Facebook <http://facebook.com/VIFInternationalEducation> |
Twitter <https://twitter.com/vifglobaled> | LinkedIn
<http://www.linkedin.com/company/vif-international-education>
Recognized as a ‘Best for the World’
<http://bestfortheworld.bcorporation.net/> B Corp!
Docker has the –cpu option that might do what you need.
You can also do this without a container:
http://blog.scoutapp.com/articles/2014/11/04/restricting-process-cpu-usage-using-nice-cpulimit-and-cgroups
Another option is to use KVM and Libvirt (and virt-manager if you need a GUI)
‘tasksel’? I believe it is just a wrapper for sched_setaffinity/sched_getaffinity, which you can also do with cgroups.
Frank Cox wrote:
4-core
My manager’s been looking at containers – he doesn’t want the overhead, both system usage and system maintenance, of a VM. Isn’t VB a VM?
mark
Mark Haney wrote:
we’ve been using torque, though we’re slowly moving to slurm.
I agree with you though, I don’t know that doing it that way will work – I
think Sybase *looks* at the number of cores it can see, probably some of the license info it uses.
mark
Yes.
I believe *[0]* is what you are after. In summary:
lxc-cgroups -n cpuset.cpus 0-3
I’ve experimented with it – *[1]*:
Regards, ak.
*[0]*
https://docs.oracle.com/cd/E37670_01/E37355/html/ol_control_containers.html
*[1]* https://imagebin.ca/v/2iMePQ4Sbf62
Also, I know you’ve stated you don’t want the overhead of VM’s. However, running a Linux VM on top of KVM on a Linux host doesn’t tax the host system much at all. If you haven’t tried KVM recently, then you owe it to yourself to do so and see for yourself – for Linux VM on Linux host, it outperforms VirtualBox.
Regards, ak.