Hi team. I wish to use fine-grained resource manag...
# troubleshooting
s
Hi team. I wish to use fine-grained resource management in our flink cluster (not running on Kubernetes or YARN), with 2 taskmanagers. Until now, I had set the number of slots per task manager to 2 via “taskmanager.numberOfTaskSlots: 2” in the flink’s conf. What I am unable to figure from the documentation is that if we choose to enable fine-grained resource management via “cluster.fine-grained-resource-management.enabled: true” option, then what happens to the statically defined number of slots ? Flink seems to start up with both these configurations set. So does the statically defined number of slots need not be removed/ignored. Even when it is commented out, it seems to take it’s default value of 1 and TM starts with 1 slot. This is confusing me because as per https://nightlies.apache.org/flink/flink-docs-release-1.17/docs/deployment/finegrained_resource/#resource-allocation-strategy , it says that “The TaskManager will be launched with total resources but no predefined slots” but how is this achieved ?
@Donatien Schmitz Hi, while searching for previous posts in this channel with respect to fine-grained resource management, I saw that you have worked with it. Would you be able to help me here ? Thanks !
d
Hi @Sumit Lakra! So, you are right about the statically defined number of slots. The number of slots declared shouldn't have an influence on fine-grain slots but it does as the number of CPU per TaskManager is equal to de number of slots (by default). You can declare how much CPU (cores in fact) TaskManagers should have with the following option:
taskmanager.cpu.cores
(https://github.com/apache/flink/blob/522ff833ad7e3b3c80f4c1ba326cb05fdc4d6a3c/flin[…]ain/java/org/apache/flink/configuration/TaskManagerOptions.java) This option is by default equal to the number of task slots. Another thing is that you can have more slots than CPU available on a TaskManager by declaring a ResourceProfile with less than 1 core. (e.g two slots of 0.5 cores for a TM with 1 CPU) as long as you don't exceed other resources (managed, heap, network, ...).