Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flink Slots/Parallelism vs Max CPU capabilities

I'm trying to understand the logic behind flink's slots and parallelism configurations in .yaml document.

Official Flink Documentation states that for each core in your cpu, you have to allocate 1 slot and increase parallelism level by one simultaneously.

But i suppose that this is just a recommendation. If for a example i have a powerful core(e.g. the newest i7 with max GHz), it's different from having an old cpu with limited GHz. So running much more slots and parallelism than my system's cpu maxcores isn't irrational.

But is there any other way than just testing different configurations, to check my system's max capabilities with flink?

Just for the record, im using Flink's Batch Python API.

like image 988
Qehu Avatar asked Aug 18 '26 06:08

Qehu


1 Answers

It is recommended to assign each slot at least one CPU core because each operator is executed by at least 1 thread. Given that you don't execute blocking calls in your operator and the bandwidth is high enough to feed the operators constantly with new data, 1 slot per CPU core should keep your CPU busy.

If on the other hand, your operators issue blocking calls (e.g. communicating with an external DB), it sometimes might make sense to configure more slots than you have cores.

like image 149
Till Rohrmann Avatar answered Aug 20 '26 20:08

Till Rohrmann



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!