I have read that AM in yarn asks for no of containers based on the current availability of resources. So my question is
Case 1 - If I run my job when no other job is running in the same queue then my job will get more no of containers.
Case 2- If queue is already occupied then job will get less no of containers.
Case 3- My job will get fixed no of containers.
It would be greatly helpful if you can tell my understanding is correct or not and on which parameter AM master asks for no of containers from RM.
Number of containers each query will use is defined here (https://cwiki.apache.org/confluence/display/TEZ/How+initial+task+parallelism+works), which consider number of resource available on current queue, the number of resource available in a queue is defined by the minimum guaranteed capacity (yarn.scheduler.capacity.root._queuename_.capacity) and not maximum capacity (yarn.scheduler.capacity.root._queuename_.maximum-capacity).
YARN ResourceManager does its best to allocate memory and vcores to use all available resources in the most efficient way possible ideally there will be some or few resources left idle