I have a question:
What is the difference between corePoolSize and maxPoolSize in the Spring ThreadPoolTaskExecutor?
Let’s find out the correct answer to the question
CorePoolSize is the minimum number of threads used by the pool
The number can increase up to MaxPoolSize
When the load goes down
the pool will shrink back to CorePoolSize
If the CorePoolSize if very high
there can a high chance that many of your threads from pool are remaining unused for certain period
since for every request new thread gets created until it reaches MaxPoolSize
We will see many examples
But the concept is the same.
Therefore if only one example is understood, you can pass the rest.
Case 1.
If the load is too high and queueCapacity is full
the new executor threads will be created unless the maxPoolSize is reached.
These additional threads will expire as soon as the queue is empty.
If the corePoolSize is exhausted
queueCapacity is full and maxPoolSize is also reached
then the new submitteds tasks will be rejected and called will get an exception.
Case 2.
- thread pool size = 1
- core pool size = 5
- max pool size = 10
- the queue is = 100
As requests come in,
threads will be created up to 5
and then tasks will be added to the queue
until it reaches 100.
When the queue is full
new threads will be created up to maxPoolSize.
Once all the threads are in use
and the queue is full
tasks will be rejected.
As the queue reduces
so does the number of active threads.
SCP(Secure Copy) is a command-line utility
that allows you to securely copy files and directories between two locations.
From your local system to a remote system
From a remote system to your local system
Between two remote systems from your local system
If you want to know the concept properly, be sure to read this article
Mac 유저가 아무런 설정 변경 없이 terminal 혹은 iTerm2을 사용하여
Alt/Cmd + Left/Right 단축키를 사용하면
원하는대로 커서가 움직이지 않고 이상한 문자가 입력된다.
Alt/Cmd + Left/Right 단축키를 사용할 수 있도록 설정을 변경해보자.