What happens if I try to use more cores than I have?

前端 未结 2 1229
既然无缘
既然无缘 2020-12-18 03:16

In my sparkconf, i can set the number of cores to use, i have 4 physical, 8 logical on my laptop, what does spark do if I specify a number that was not possible on the machi

2条回答
  •  暖寄归人
    2020-12-18 03:33

    Number of cores doesn't describe physical cores but a number of running threads. It means that nothing really strange happens if the number is higher than a number of available cores.

    Depending on your setup it can be actually a preferred configuration with value around twice a number of available cores being a commonly recommended setting. Obviously if number is to high your application will spend more time on switching between threads than actual processing.

提交回复
热议问题