다중 쓰레드 환경에서 효율적인 자원 관리를 위한 학습 기반의 동적 쓰레드 풀 기법
Dynamic Thread Pool Scheme based on the Leaning for Efficient Resource Management in the Multi-thread Environment
- 주제(키워드) 쓰레드 풀 , 최근접 이웃 알고리즘
- 발행기관 서강대학교 일반대학원
- 지도교수 박성용
- 발행년도 2009
- 학위수여년월 2009. 2
- 학위명 석사
- 실제URI http://www.dcollection.net/handler/sogang/000000044869
- 본문언어 한국어
초록/요약
네트워크의 발전에 따라 사용자들이 늘어나게 되면서 웹 서버들은 다수 사용자들의 동시 접속을 처리할 수 있는 능력이 필요하게 되었다. 이에 따라 동시에 접속하는 다수 사용자의 서비스 요청을 처리할 수 있는 다중 쓰레드 모델을 활용하고 있다. 고정적인 시스템 자원을 점유해야 하는 고정된 쓰레드 풀 모델에 비해 동적으로 쓰레드 풀의 크기를 변경하는 워터마크 쓰레드 풀 모델은 사용자의 요청량에 따라 쓰레드 수를 적절하게 조절하여 불필요한 자원을 점유하지 않게 되는 장점이 있다. 이를 기반으로 본 논문에서는 다중 쓰레드 환경의 서버 프로그래밍을 위한 학습 기반의 동적 쓰레드 풀 모델을 제안한다. 제안하는 모델은 쓰레드 풀을 사용하는 대표적인 웹 서버 중 아파치 worker 다중 처리 모듈 (Multi-processing Module, MPM)에 AR(Auto Regressive) 모델을 통해 다음 주기의 작업 요청량을 예측하여 사전에 쓰레드를 생성하는 부분을 추가한다. 일정주기의 증감 추세가 없는 작업 요청량에도 필요한 쓰레드의 수를 정확하게 설정하기 위해 최근접 이웃(K-Nearest Neighbor) 알고리즘을 사용하여 작업 요청량에 따른 쓰레드의 수를 사전에 학습한다. 필요한 쓰레드의 수를 설정하기 위해 사전에 학습 되어진 개체들과 비교하여 유사한 개체를 선택하여 예측된 작업 요청량에 따른 쓰레드의 수를 결정하고 쓰레드를 생성한다. 필요한 쓰레드의 수를 동적으로 변경함으로써 사용자 응답 시간을 빠르게 하고, 불필요한 쓰레드는 삭제하게 되어 고정된 시스템 자원의 점유를 방지하여 사용하지 않는 자원을 다른 프로그램이 사용할 수 있도록 한다. 이렇게 쓰레드의 수를 고정하지 않고 상황에 따라 변경시킴으로써, 다른 쓰레드 풀 모델에 비해 자원을 효율적으로 사용하고 응답 시간을 개선시킬 수 있도록 구현 하였다.
more초록/요약
As the number of user increases according to the improvement of the network, it is required for web servers to have an ability to process the simultaneous connection of several users. Thus, the multi-thread schemes are used to process the service requests of several users who are connected simultaneously. Comparing to the static thread pool scheme, which possesses the static system resources, the watermark thread pool scheme, which is flexible on its size of the pool, has an advantage; it controls the number of threads according to the requests so that it does not occupy the unnecessary resources. Based on this, this paper will suggest a dynamic thread pool scheme based on the learning in a server programming of a multi-thread environment. The suggested scheme adds the creation of the threads through the prediction of the next number of periodic requests using Auto Regressive model with the web server apache worker MPM (Multi-processing Module). In order to set the exact number of the necessary threads during the unchanged number of work requests in a certain period, K-Nearest Neighbor algorithm is used to learn the number of threads in advance according to the number of requests. To set the required number of threads, the previously learned objects are compared. Then, the similar objects are selected to decide the number of the threads according to the request, and they create the threads. By modifying the number of threads dynamically, the unnecessary threads are deleted and the static occupancy of the system resources is avoided so that other programs can use those resources. As the number of threads is dynamically changed depending on the situation, this scheme is implemented to reduce the delay time and to manage the resources more efficiently than other thread pool scheme.
more목차
제 1 장 서론 = 1
1.1 연구의 배경 및 필요성 = 1
1.2 연구 방법 = 3
1.3 논문의 구성 = 4
제 2 장 관련 연구 = 5
2.1 쓰레드의 특징 = 5
2.2 기존 쓰레드 모델 = 6
2.2.1 요구 기반 쓰레드 모델 (Thread per Request Model) = 6
2.2.2 워커 쓰레드 풀 모델 (Worker Thread Pool Model) = 7
2.2.3 워터마크 쓰레드 풀 모델 (Watermark Thread Pool Model) = 7
2.2.4. 수정된 지수 평균 기법의 동적 쓰레드 풀 모델 = 8
2.3 기존 연구의 문제점 = 10
제 3 장 학습 기반의 동적 쓰레드 풀 기법 설계 = 11
3.1 설계 목표 = 11
3.2 제안된 동적 쓰레드 풀 기법의 전체 구조 = 12
3.3 사용된 알고리즘 = 13
3.3.1 AR (AutoRegressive) = 13
3.3.2 최근접 이웃 알고리즘(K-Nearest Neighbor) = 15
제 4 장 학습 기반의 동적 쓰레드 풀 기법 구현 = 18
4.1 아파치(Apache) 웹 서버의 구성 및 분석 = 18
4.1.1 아파치(Apache) 2.x 웹 서버 = 18
4.1.2 다중 처리 모듈 (Multi-Processing Module)의 종류 = 19
4.1.3 아파치 웹 서버 worker 다중 처리 모듈의 분석 = 22
4.2 학습 기반의 동적 쓰레드 풀 기법 적용 = 25
4.2.1 전체 구조 = 25
4.2.2 감시자 쓰레드 = 27
제 5 장 성능 평가 = 31
5.1 성능 평가 개요 = 32
5.1.1 성능 시험을 위한 환경 구성 = 32
5.1.2 성능 측정 방법 = 32
5.2 실험 및 성능 분석 = 34
5.2.1 사용자 응답 시간에 따른 결과 및 분석 = 34
5.2.2 효율적인 시스템 자원의 활용 결과 및 분석 = 40
5.2.3 감시자 쓰레드의 부하 측정 = 42
제 6 장 결론 및 향후 과제 = 44
참고문헌 = 46
그림목차
[그림 1] 학습 기반의 동적 쓰레드 풀 기법 = 12
[그림 2] 제곱 평균 오차율 = 14
[그림 3] k값에 따른 정확도의 변화 = 16
[그림 4] prefork 다중 처리 모듈 = 20
[그림 5] worker 다중 처리 모듈 = 21
[그림 6] worker 다중 처리 모듈 지시어 기본 설정값 = 22
[그림 7] worker 다중 처리 모듈 서비스 처리 순서도 = 24
[그림 8] 프로그램 구조도 = 25
[그림 9] 감시자 쓰레드 생성 = 27
[그림 10] 감시자 쓰레드의 자료 구조 = 28
[그림 11] AR 모델의 자료 구조 = 29
[그림 12] 최근접 이웃 알고리즘의 자료구조 = 29
[그림 13] 전체 서비스 요청량 측정 방법 = 30
[그림 14] 웹 서버 요청량 = 32
[그림 15] 사용자 서비스 요청량 그래프 = 33
[그림 16] 학습 기반의 동적 쓰레드 풀 기법의 사용자 응답 시간 = 35
[그림 17] 지수 평균 기법 동적 쓰레드 풀의 사용자 응답 시간 = 35
[그림 18] 워터 마크 쓰레드 풀의 사용자 응답 시간 = 36
[그림 19] 워커 쓰레드 풀의 사용자 응답 시간 = 36
[그림 20] 평균 사용자 응답 시간 = 37
[그림 21] 예측 정확도 = 39
[그림 22] 평균 메모리 사용량 = 40
[그림 23] 감시자 쓰레드의 부하 측정 = 42

