What is the difference between corePoolSize and maxPoolSize in the Spring ThreadPoolTaskExecutor

后端 未结 6 1740
一个人的身影
一个人的身影 2020-12-08 04:17

I have to send out massEmails to all users of a website. I want to use a thread pool for each email that is sent out. Currently I have set the values to :

&l         


        
6条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-08 04:55

    You should consider to increase value of queueCapacity than consider to increase value of corePoolSize or maxPoolSize. Those two properties (*PoolSize) are number of pool to execute but each message would be considering in queueCapacity

    
    
    
    
    

    If you have 10000 users to send so 1000 * 10 (maxPoolSize) = 10000 but if 1000 for each thread is heavy, we can consider to increase poolSize.

提交回复
热议问题