이 글의 코드 및 정보들은 강의를 들으며 정리한 내용을 토대로 작성하였습니다.
개발을 하다 보면
다음과 같은 Column들이 필요하다.
언제 생성되었는가?
언제 수정되었는가?
누가 생성하였는가?
누가 수정하였는가?
위와 같은 Needs를 Spring에서는 추상화시켜놓았다.
이 글에서는 2가지 방식으로 해당 기능 사용법을 알아본다.
순수 JPA를 사용하는 방식
Spring Data JPA를 사용하는 방식
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