Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can get memory and CPU usage of hadoop yarn application?

I want to ask, after I've ran my hadoop mapreduce application, how can I get the total memory and CPU usage of that application. I've seen it on log and resource manager web page but I didn't get it.

Is it possible? Can I get it per job execution or on per application, and can I get it per node usage or total usage?

Thanks a lot....

like image 929
Kenny Basuki Avatar asked May 12 '15 08:05

Kenny Basuki


People also ask

How does YARN allocate memory?

YARN uses the MB of memory and virtual cores per node to allocate and track resource usage. For example, a 5 node cluster with 12 GB of memory allocated per node for YARN has a total memory capacity of 60GB. For a default 2GB container size, YARN has room to allocate 30 containers of 2GB each.

Does YARN handle storage?

YARN also allows different data processing engines like graph processing, interactive processing, stream processing as well as batch processing to run and process data stored in HDFS (Hadoop Distributed File System) thus making the system much more efficient.

What is reserved memory in YARN?

A container will become reserved state when the container is assigned to some nodemanager node which do not have enough resource(cpu or memory) for it.


1 Answers

Yes, you can very well check the total memory and cpu usage of the application.

You may use the Job tracker UI, click on the counters link on the completed page, and might get a typical view as follows. The memory and cpu counters were highlighted.

enter image description here

Clicking on the highlighted links will show you the consumption by every Tasks (Map/Reduce) of the job.

To view these values of these consumption counters from command line, you may use

hadoop job -counter <job-id> org.apache.hadoop.mapreduce.TaskCounter CPU_MILLISECONDS for cpu usage

hadoop job -counter <job-id> org.apache.hadoop.mapreduce.TaskCounter PHYSICAL_MEMORY_BYTES for memory usage

like image 144
suresiva Avatar answered Sep 21 '22 00:09

suresiva