You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mesos.apache.org by John Omernik <jo...@omernik.com> on 2015/03/27 17:34:58 UTC
Mesos Management of Resources
I have a question about how Mesos manages resources (and then some
follow-up questions as well). I will use the power of story time to
explain my question.
Say we have a Mesos node. The physical node is running Ubuntu, and
from a hardware perspective, it's a E3-1240V2 Intel Processor with 4
physical cores, 32 GB of ram and total disk space of 64 GB. This disk
is split into two partitions of 14 GB (3.1 GB Free) and 40 GB (12 GB
Free)
When I see this node registered as a mesos slave, here is what is reported:
CPUs: 8
Memory: 30.4GB
Disk 8.6 GB
So this is where I would like to further my understanding of Mesos.
How does it see and manage resources?
1. Obviously the Ubuntu OS takes resources. How does that factor into
Mesos' available resource calculations? Where does these calculations
even come from (I can't see how 8.6 GB is my available disk on a
node). It obviously shows hyperthreaded cores, not physical cores, and
doesn't reserve any cores for OS use, but based on the memory total,
is it reserving memory or is that a GB math discrepancy?
2. Does Mesos continually update available resources to take into
account resources that are not managed by Mesos? IE. If the node
registered with 30.4 GB available memory, and then an hour later some
process not managed by mesos take another GB of memory, is Mesos aware
of that? Or will Mesos try to give resources away that it may not
control and may not exist? What happens if that occurs?
3. Can you tell Mesos Slaves, when they start, to only take X
resources? I.e. let's say you were running HDFS or MapRFS outside of
Mesos on every node, you wanted to allocate 10% of memory always to
that, can you tell Mesos to not give away resources that are
statically assigned for something else? Obviously the idea here is to
allow Mesos to manage it all, but somethings like MapRFS really need
direct access to disks etc. Perhaps it's already doing that to take
into account the OS on the box?
4. Has anyone thought of coming up with a smallish linux distro
designed to minimize non Mesos resource usage (OS usage). Basically
the minimum to allow Mesos and Docker to run on a node, with the idea
that all else should be in Mesos. (Not taking into account my
HDFS/MapRFS question).
Lots weird questions here, I understand, please feel free to point me
in the right direction on docs for how to understand some of this,
that said, if you know specifics, please share!
John
Re: Mesos Management of Resources
Posted by Vinod Kone <vi...@apache.org>.
Let me add to what others have said. Answers inline.
On Fri, Mar 27, 2015 at 9:34 AM, John Omernik <jo...@omernik.com> wrote:
> 1. Obviously the Ubuntu OS takes resources. How does that factor into
> Mesos' available resource calculations? Where does these calculations
> even come from (I can't see how 8.6 GB is my available disk on a
> node). It obviously shows hyperthreaded cores, not physical cores, and
> doesn't reserve any cores for OS use, but based on the memory total,
> is it reserving memory or is that a GB math discrepancy?
>
>
By default, Mesos offers all cpus (cpu threads to be precise), 2G less than
all memory and 5G less than all disk.
See the calculations here
<https://github.com/apache/mesos/blob/master/src/slave/containerizer/containerizer.cpp#L60>.
As Joerg mentioned, you can override the default behavior by setting the
"--resources" flag.
> 2. Does Mesos continually update available resources to take into
> account resources that are not managed by Mesos? IE. If the node
> registered with 30.4 GB available memory, and then an hour later some
> process not managed by mesos take another GB of memory, is Mesos aware
> of that? Or will Mesos try to give resources away that it may not
> control and may not exist? What happens if that occurs?
>
>
No, the slave doesn't continuously update total resources available based
on out of band processes resource age.
If there is memory pressure on the host, the kernel OOM killer will kick in
and kill processes (based on its algorithm
it might kill any process on the system, whether it is in mesos or not) to
free up resources.
> 3. Can you tell Mesos Slaves, when they start, to only take X
> resources? I.e. let's say you were running HDFS or MapRFS outside of
> Mesos on every node, you wanted to allocate 10% of memory always to
> that, can you tell Mesos to not give away resources that are
> statically assigned for something else? Obviously the idea here is to
> allow Mesos to manage it all, but somethings like MapRFS really need
> direct access to disks etc. Perhaps it's already doing that to take
> into account the OS on the box?
>
>
Yes. See "--resources" flag to explicitly set this. I would further suggest
to put non-mesos processes into their own cgroups
(e.g., system, hdfs etc) to control their resource usage and to ensure they
don't interfere with Mesos processes. systemd
might help you here.
> 4. Has anyone thought of coming up with a smallish linux distro
> designed to minimize non Mesos resource usage (OS usage). Basically
> the minimum to allow Mesos and Docker to run on a node, with the idea
> that all else should be in Mesos. (Not taking into account my
> HDFS/MapRFS question).
>
>
Maybe look into CoreOS? I am sure someone in the community must have
figured out the additional packages needed to
install on top of a CoreOS image to support Mesos.
Re: Mesos Management of Resources
Posted by CCAAT <cc...@tampabay.rr.com>.
On 03/27/2015 11:34 AM, John Omernik wrote:
> I have a question about how Mesos manages resources (and then some
> follow-up questions as well). I will use the power of story time to
> explain my question.
>
> Say we have a Mesos node. The physical node is running Ubuntu, and
> from a hardware perspective, it's a E3-1240V2 Intel Processor with 4
> physical cores, 32 GB of ram and total disk space of 64 GB. This disk
> is split into two partitions of 14 GB (3.1 GB Free) and 40 GB (12 GB
> Free)
>
>
> When I see this node registered as a mesos slave, here is what is reported:
>
> CPUs: 8
> Memory: 30.4GB
> Disk 8.6 GB
>
> So this is where I would like to further my understanding of Mesos.
> How does it see and manage resources?
>
> 1. Obviously the Ubuntu OS takes resources. How does that factor into
> Mesos' available resource calculations? Where does these calculations
> even come from (I can't see how 8.6 GB is my available disk on a
> node). It obviously shows hyperthreaded cores, not physical cores, and
> doesn't reserve any cores for OS use, but based on the memory total,
> is it reserving memory or is that a GB math discrepancy?
>
> 2. Does Mesos continually update available resources to take into
> account resources that are not managed by Mesos? IE. If the node
> registered with 30.4 GB available memory, and then an hour later some
> process not managed by mesos take another GB of memory, is Mesos aware
> of that? Or will Mesos try to give resources away that it may not
> control and may not exist? What happens if that occurs?
>
> 3. Can you tell Mesos Slaves, when they start, to only take X
> resources? I.e. let's say you were running HDFS or MapRFS outside of
> Mesos on every node, you wanted to allocate 10% of memory always to
> that, can you tell Mesos to not give away resources that are
> statically assigned for something else? Obviously the idea here is to
> allow Mesos to manage it all, but somethings like MapRFS really need
> direct access to disks etc. Perhaps it's already doing that to take
> into account the OS on the box?
>
> 4. Has anyone thought of coming up with a smallish linux distro
> designed to minimize non Mesos resource usage (OS usage). Basically
> the minimum to allow Mesos and Docker to run on a node, with the idea
> that all else should be in Mesos. (Not taking into account my
> HDFS/MapRFS question).
4) Well, that's exactly what I'm working on with Gentoo. It'll feature,
includes via ebuild selection, a myriad of codes that can be installed,
but only those necessary in the core mesos ebuild. Once I have this
working on amd64, I'll branch out to arm64 and look for others arch's
and ports to a wide variety of processors. My goal is to be able to run
mesos on a minimized gentoo core on a wide variety of processors. The
ultimate goal is to be able to customize the mix of specialty boards
in house with common server machines and supplement with cloud
distributed vendor resources, dynamically, as needed. Gentoo readily
allows for building custome, minimized systems all the way down to
state machines on embedded processors.
Right now my stuggles are with Cephfs on top of btrfs. The HDfs baggage
as well as the entire collection of Hadoop legacy codes are not of
interest to me, but surely you'll be able to add those codes, if you
like. Apache Spark/Storm are of keen interest to me and those that want
a computationally aggressive HPCC platform.
> Lots weird questions here, I understand, please feel free to point me
> in the right direction on docs for how to understand some of this,
> that said, if you know specifics, please share!
>
> John
You just have to read a lot about mesos, and realize it's still a pup,
as new codes/project go. The archives of this list would be a good place
to start.
hth,
James
Re: Mesos Management of Resources
Posted by Jörg Schad <jo...@mesosphere.io>.
Hi,
hopefully this helps to answers some of your resource questions:
In general you can configure arbitrary resources when starting a slave see
http://mesos.apache.org/documentation/latest/configuration/ and
http://mesosphere.com/docs/reference/mesos-slave/ for details.
So can you override the default, one other usecase could also be that you
tie your resources to specific roles (i.e. two cpus are reserved for HDFS
framework, two for framework x and so on) in the following format:
--resources="cpus(hdfs):2; cpus(stage):2 mem(*):15360; disk(*):710534;
ports(*):[31000-32000]"
There are certain resources (cpus,mem, disk, port) which are autodiscovered
by mesos. These automatically detected values are basically what you saw
with your resources. (see
http://mesos.apache.org/documentation/attributes-resources/)
Basically, when you want to use less than the detected amounts you should
explicitly assign less resources to the default role cpus(*):2.
Hope this helps,
Joerg
On Fri, Mar 27, 2015 at 5:34 PM, John Omernik <jo...@omernik.com> wrote:
> I have a question about how Mesos manages resources (and then some
> follow-up questions as well). I will use the power of story time to
> explain my question.
>
> Say we have a Mesos node. The physical node is running Ubuntu, and
> from a hardware perspective, it's a E3-1240V2 Intel Processor with 4
> physical cores, 32 GB of ram and total disk space of 64 GB. This disk
> is split into two partitions of 14 GB (3.1 GB Free) and 40 GB (12 GB
> Free)
>
>
> When I see this node registered as a mesos slave, here is what is reported:
>
> CPUs: 8
> Memory: 30.4GB
> Disk 8.6 GB
>
> So this is where I would like to further my understanding of Mesos.
> How does it see and manage resources?
>
> 1. Obviously the Ubuntu OS takes resources. How does that factor into
> Mesos' available resource calculations? Where does these calculations
> even come from (I can't see how 8.6 GB is my available disk on a
> node). It obviously shows hyperthreaded cores, not physical cores, and
> doesn't reserve any cores for OS use, but based on the memory total,
> is it reserving memory or is that a GB math discrepancy?
>
> 2. Does Mesos continually update available resources to take into
> account resources that are not managed by Mesos? IE. If the node
> registered with 30.4 GB available memory, and then an hour later some
> process not managed by mesos take another GB of memory, is Mesos aware
> of that? Or will Mesos try to give resources away that it may not
> control and may not exist? What happens if that occurs?
>
> 3. Can you tell Mesos Slaves, when they start, to only take X
> resources? I.e. let's say you were running HDFS or MapRFS outside of
> Mesos on every node, you wanted to allocate 10% of memory always to
> that, can you tell Mesos to not give away resources that are
> statically assigned for something else? Obviously the idea here is to
> allow Mesos to manage it all, but somethings like MapRFS really need
> direct access to disks etc. Perhaps it's already doing that to take
> into account the OS on the box?
>
> 4. Has anyone thought of coming up with a smallish linux distro
> designed to minimize non Mesos resource usage (OS usage). Basically
> the minimum to allow Mesos and Docker to run on a node, with the idea
> that all else should be in Mesos. (Not taking into account my
> HDFS/MapRFS question).
>
> Lots weird questions here, I understand, please feel free to point me
> in the right direction on docs for how to understand some of this,
> that said, if you know specifics, please share!
>
> John
>