Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

YARN - Is there a metric in RM for Number of Containers got preempted over time

avatar
Rising Star

Hi,

I am looking for a Resource Manager metric where it emits metrics related to number of containers preempted, amount of preempted MB and Vcores.

I am able to get this metric from each application, but looking if resource manager can emit these metrics for each queue. I have searched through all the different metrics in AMS but it doesn't have it.

HDPv2.5.0 or Hadoopv2.7.3

1 ACCEPTED SOLUTION

avatar
Expert Contributor

@Saikiran Parepally

I don't think queue level preemption metrics exists. However, they are fairly easy to calculate from the app level metrics.

curl http://YOUR_RM_ADDRESS.com:8088/ws/v1/cluster/apps > /tmp/apps
queues=$(cat /tmp/apps | jq '.apps.app[].queue' | sort -u)
for queue in $queues; do
    echo $queue
    metrics="preemptedResourceMB preemptedResourceVCores numNonAMContainerPreempted numAMContainerPreempted"
    for metric in $metrics; do
        printf "%30s: " $metric 
        cat /tmp/apps | jq -r ".apps.app[] | select(.queue == $queue) .$metric" | paste -s -d+ - | bc
    done    
done

Most likely there are more efficient ways to to do this calculation in higher level programming languages, or if you are a jq expert.

View solution in original post

2 REPLIES 2

avatar
Expert Contributor

@Saikiran Parepally

I don't think queue level preemption metrics exists. However, they are fairly easy to calculate from the app level metrics.

curl http://YOUR_RM_ADDRESS.com:8088/ws/v1/cluster/apps > /tmp/apps
queues=$(cat /tmp/apps | jq '.apps.app[].queue' | sort -u)
for queue in $queues; do
    echo $queue
    metrics="preemptedResourceMB preemptedResourceVCores numNonAMContainerPreempted numAMContainerPreempted"
    for metric in $metrics; do
        printf "%30s: " $metric 
        cat /tmp/apps | jq -r ".apps.app[] | select(.queue == $queue) .$metric" | paste -s -d+ - | bc
    done    
done

Most likely there are more efficient ways to to do this calculation in higher level programming languages, or if you are a jq expert.

avatar
Rising Star

Thanks @gnovak currently I am getting app level details similarly as mentioned above using REST API. I am interested to see if there is anything at queue level.