티스토리 뷰
worker process 는 클라이언트로부터 요청받는 이벤트를 처리하는 프로세스이며 다음과 같은 특징이 있다.
- 각 worker process는 싱글 스레드로 동작한다.
- non-blocking 방식으로 요청을 처리하여 Context Switching을 최소화 한다.
설정 및 확인
nginx.conf
worker_processes number | auto;
worker process 확인하기
//worker_processes 설정 하지 않았을 때 프로세스 확인
root@79f15debee4d:/# ps -ef
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 13:03 ? 00:00:00 nginx: master process nginx -g daemon off;
nginx 26 1 0 13:03 ? 00:00:00 nginx: worker process
//worker_processes auto; 설정 시 프로세스 확인
root@79f15debee4d:/# ps -ef
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 13:22 ? 00:00:00 nginx: master process nginx -g daemon off;
nginx 26 1 0 13:22 ? 00:00:00 nginx: worker process
nginx 27 1 0 13:22 ? 00:00:00 nginx: worker process
nginx 28 1 0 13:22 ? 00:00:00 nginx: worker process
nginx 29 1 0 13:22 ? 00:00:00 nginx: worker process
추가로
* nginx의 worker_processes default는 1이다.
따라서 worker_processes를 설정하지 않으면 자동으로 1개의 워커 프로세스가 할당된다.
* auto 로 설정 할 시 nginx 가 자동으로 워커 프로세스를 할당한다.
worker_processes의 최적의 값은 CPU 코어 수, 하드디스크 드라이브 수, 로드 패턴을 비롯한 여러 요인에 따라 달라질 수 있다.
참고
'Server > Nginx' 카테고리의 다른 글
Nginx 의 기능에 대하여 (0) | 2024.12.11 |
---|
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- Security
- 다중화
- fail-fast
- 고정 세션
- 인스턴스변수
- object
- 추상클래스
- java
- Spring
- 로드 밸런서
- nginx
- syncronized
- 자동구성
- Hash
- HashSet
- 티스토리챌린지
- Sticky Session
- @conditional
- fail-safe
- HashMap
- 오블완
- Red-Black Tree
- nosql
- Caching
- spring boot
- JPA
- 인터페이스
- Load Balancer
- 정적변수
- AutoConfiguration
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
글 보관함