KJH
Jmeter websocket 테스트 (/w nginx) 본문
ngrinder는 websocket을 지원안하는 듯 하여 jmeter로 선정
순정 jmeter도 지원을 안해줘서 plugin을 설치해야 함
https://jmeter.apache.org/download_jmeter.cgi
Apache JMeter - Download Apache JMeter
Download Apache JMeter We recommend you use a mirror to download our release builds, but you must verify the integrity of the downloaded files using signatures downloaded from our main distribution directories. Recent releases (48 hours) may not yet be ava
jmeter.apache.org
OS에 맞게 편한걸로 설치
Jmeter Plugin 설치
https://jmeter-plugins.org/install/Install/
Install :: JMeter-Plugins.org
Installing Plugins The easiest way to get the plugins is to install Plugins Manager. Then you'll be able to install any other plugins just by clicking a checkbox. If you experience any issues with plugins installation, don't hesitate to ask at Support Foru
jmeter-plugins.org
다운로드한 Jar파일을 Jmeter폴더의 lib/ext 폴더에 추가한다.
Jmeter 재시작 하면 Plugin Manager가 생긴다.
처음엔 Available Plugins에서 WebSocket을 검색하여 설치한다.
websocket 관련 옵션을 확인 가능하다.
Connection을 열고 Write Sampler를 통해 메세지를 보내는 워크플로우를 작성할 수 있다.
Nginx에 고의로 제한을 주며 한계를 확인해보기
worker_processes가 auto 일때 CPU 코어 수 만큼 프로세스를 자동 생성 한다.
## 코어 수 확인 방법
nproc
Socket 요청은 Client, Server의 커넥션이 각각 잡히기에 nginx는 최소 request 수 x 2의 커넥션을 필요로 한다.
worker connection이 부족할 때 생기는 에러
100 worker_connections are not enough
## 늘리는 법
events {
worker_connections 1024;
}
File Descriptor가 부족할때 생기는 에러
accept4() failed (24: No file descriptors available)
## FD 확인하는 CLI
ulimit -n
# 늘리는 법
ulimit -n 100000
포트가 부족할 때 생기는 에
failed (99: Address not available) while connecting to upstream
## 생성 가능한 포트 수 확인하는 CLI
cat /proc/sys/net/ipv4/ip_local_port_range
## 늘리는 법
sudo sysctl -w net.ipv4.ip_local_port_range="32768 60999"
# 계산법
60999 - 32768 + 1 = 28232개
'DevOps' 카테고리의 다른 글
ArgoCD App of Apps, Rollout (0) | 2025.05.02 |
---|---|
GPU Exporter (/w windows) (0) | 2025.04.21 |
Github 특정 Tag를 Fork하기 (0) | 2025.04.16 |
Terraform GitOps(/w Atlantis) (0) | 2025.04.13 |
Nginx Ingress Controller OCSP 설정 (0) | 2025.04.13 |