Created on 12-19-2016 02:51 AM - edited 08-18-2019 04:58 AM
In my cluster, when I running an Yarn app, my CPU of each node get very high.
I want to prevent this issue. I configure yarn.nodemanager.resource.percentage-physical-cpu-limit=80(%)
But nodes still run out of CPU ( some time is 200% CPU cause I can not ssh to this) and also cause high CPU, hbase region server force to stop.
I need limit CPU usage of nodes that mean when I run Yarn app, the CPU can not run out of resource. How can I do that.
Thanks
Created 12-19-2016 04:46 AM
Created 12-19-2016 05:30 AM
Yarn app not big so much, I run Apache Kylin and buid cubes. When running, Yarn app follow my memory setting. But for CPU, even when I set limit for CPU, it always exceed over my limit. I mean when I set CPU limit 80%, but when app running , it reach to 100% even 200%
Created 12-19-2016 05:23 AM
You will need to enable CPU scheduling. by default yarn only accounts for ram. if you enable cpu scheduling, each yarn app will ram for and cpu, and yarn will provide containers based on what is available per your ram and CPU limits. if cpu scheduling is not enabled, very difficult to limit.
Created 12-19-2016 05:46 AM
Do you have any documents relate to this (cpu scheduling) ?
Created 12-19-2016 07:59 PM
Here is documenation on enabling cpu scheduling
Created 12-19-2016 03:42 PM
Hi @Hoang Le
Use the following doc to configure cpu scheduling:
But it's also recommended to configure cgroups for this to be effective:
However, these can be a bit of pain.
Most of the time, increasing the container size (map, reduce and tez) would reduce the CPU load.
Setting YARN container memory values is a balancing act between memory (RAM), processors (CPU cores), and disks so that processing is not constrained by any one of these cluster resources.
However, if the application usage pattern is known, the containers can be tuned to influence and maximize the resources utilization. For example, if CPU usage and load average are too large, an increase in the container size reduces the number of containers allocated per node. A good rule of thumb is not to have the load average bigger than 4 times the number of physical core.
Then a likely cause for having large amounts of CPU used is Garbage Collections and especially continuous Garbage Collection which would be helped by a larger container.
Increase by 50% the following and observe any changes:
tez.task.resource.memory.mb
hive.tez.container.size
mapreduce.map.memory.mb
mapreduce.reduce.memory.mb
Created 12-19-2016 04:27 PM
Please look at the Java heap size. Try increasing heap size first. This will give you more memory to prevent many GC cycles. You want high CPU usage for your application just not for GC and other applications.
Also, please check to see if other applications are running. Running Linux top command may help to see if other tasks are running and where the CPU is being used.
Created 11-13-2017 10:18 PM
@Hoang Le, did you ever get this resolved? I am interesting in to know how to fix this issue too?