问题
I use following command to kick off a flink yarn session.
yarn-session.sh -jm 4096 -tm 4096 -n 4 -s 2
With above command, it means that 4 task managers will be started(also means that 4 yarn containers are started since every task manager is a yarn container), and 2 slots for each task manager.
Since one task manager is a yarn container, that means, only one core is allocated for each task manager , but I have specified 2 slots for each task manager, which means the two slots will share only one core?
I have thought that each slot should occupy at least one core?
Not sure I have understood correctly or I have missed something.
回答1:
"One core per slot" has been suggested as a default starting point, but it shouldn't be considered a rule. You are free to do whatever you want. If each slot contains several computationally intensive tasks, it makes sense to give each slot multiple cores. On the other hand, if each slot has little work to do, and will spend most of its time blocked on i/o, a fractional core will be enough.
来源:https://stackoverflow.com/questions/63543558/about-core-allocation-for-flink-task-manager-and-task-slot