Design and Implementation of a Web Server Using a Learning-based Dynamic Thread Pool Scheme

학습 기반의 동적 쓰레드 풀 기법을 적용한 웹 서버의 설계 및 구현

  • 유서희 (서강대학교 컴퓨터공학과) ;
  • 강동현 (서강대학교 컴퓨터공학과) ;
  • 이권용 (서강대학교 컴퓨터공학과) ;
  • 박성용 (서강대학교 컴퓨터공학과)
  • Published : 2010.01.15

Abstract

As the number of user increases according to the improvement of the network, the multi-thread schemes are used to process the service requests of several users who are connected simultaneously. The static thread pool scheme has the problem of occupying a static amount of system resources. On the other hand, the dynamic thread pool scheme can control the number of threads according to the users' requests. However, it has disadvantage that this scheme cannot react to the requests which are larger than the maximum value assigned. In this paper, a web server using a learning-based dynamic thread pool scheme is suggested, which will be running on 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 scheme with the web server apache worker MPM (Multi-processing Module). Unlike previous schemes, 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. The required number of threads is set by comparing with the previously learned objects. Then, the similar objects are selected to decide the number of the threads according to the request, and they create the threads. In this paper, the response time has decreased by modifying the number of threads dynamically, and the system resources can be used more efficiently by managing the number of threads according to the requests.

네트워크의 발전에 따라 사용자들이 늘어나게 되면서 웹 서버들은 동시에 접속하는 다수 사용자의 서비스 요청을 처리할 수 있는 다중 쓰레드 기법을 활용하고 있다. 고정된 쓰레드 풀 기법은 고정적인 시스템 자원을 점유해야 하는 문제점이 있다. 반면에 동적으로 쓰레드 풀 기법인 워터마크 쓰레드 풀기법은 사용자의 요청량에 따라 쓰레드 수를 적절하게 조절하지만, 지정한 최대값을 넘는 요청량에 대해서는 응답이 제때에 이루이지지 않는 단점이 있다. 따라서 본 논문에서는 다양한 요청량이 존재하는 다중 쓰레드 환경의 서버 프로그래밍을 위한 학습 기반의 동적 쓰레드 풀 기법을 적용한 웹 서버를 제안한다. 제안하는 기법은 쓰레드 풀을 사용하는 웹 서버 중 아파치(Apache) worker 다중 처리 모듈(Multi processing Module)에 AR(Auto Regressive) 기법을 통해 다음 주기의 작업 요청량을 예측하고 사전에 쓰레드를 생성한다. 기존 기법과 달리, 일정주기의 증감 추세가 없는 작업 요청량에도 필요한 쓰레드의 수를 정확하게 설정하기 위해 최근접 이웃(K-Nearest Neighbor) 알고리즘을 사용하여 작업 요청량에 따른 쓰레드의 수를 사전에 학습한다. 필요한 쓰레드의 수를 설정하기 위해 사전에 학습 되어진 개체들과 비교하여 유사한 개체를 선택하여 예측된 작업 요청량에 따른 쓰레드의 수를 결정하고 쓰레드를 생성한다. 본 논문에서는 필요한 쓰레드의 수를 동적으로 변경함으로써 사용자 응답 시간을 빠르게 하고, 사용자의 요청량에 맞게 쓰레드 수를 관리함으로써 시스템 자원의 활용도를 높일 수 있다.

Keywords

References

  1. A. Silberschatz, P. Galvin, G. Gagne, Operating System Principles, 7th edition, p.136, 2006.
  2. Yibei Ling, Tracy Mullen, and Xiaola Lin, Analysis of Optimal Thread Pool Size, ACM SIGOPS Operating Systems Review, vol.34, Issue 2, pp.42-55, February 14, 2000.
  3. D. Schmidt and S. Vinoski, "Object Interconnections: Comparing Alternative Programming Techniques for Multi-threaded CORBA Servers," SIGS C++ Report magazine, vol.8, no.4, April 1996.
  4. DongHyun Kang, Saeyoung Han, SeoHee Yoo, Sungyong Park, Prediction-based Dynamic Thread Pool Scheme for Efficient Resource Usage, 2008 IEEE 8th International Conference on Computer and Information Technology Workshops, pp.159-164, 2008.
  5. G. Coulouris, J. Dollimore, T. Kindberg, Distributed Systems Concepts and Design, 4th edition, p.235, 2005.
  6. A. Silberschatz, P. Galvin, G. Gagne, Operating System Principles, 7th edition, p.156, 2006.
  7. Apache 2.2.10, www.apache.org
  8. AutoRegressive, http://local.wasp.uwa.edu.au/~pbourke/ miscellaneous/ar/
  9. Jian Zhang and Renato J. Figueiredo, Adaptive Predictor Integratin for System Performance Prediction, IPDPS 2007, IEEE, pp.1-10, 2007. 3.
  10. 이창환, 정보이론을 이용한 K-최근접 이웃 알고리즘에서의 속성 가중치 계산, 정보과학회 논문지, 소프트웨어 및 응용 제 32권 제9호, pp.920-926, 2005. 9.
  11. 웹서버 요청량, http://graphs.eluna.org/
  12. httperf, http://www.hpl.hp.com/research/linux/httperf/