nGrinder는 네이버가 개발한 오픈소스 분산 부하 테스트 플랫폼입니다. 웹 UI 기반으로 Controller와 Agent를 관리하고, Groovy/Jython 스크립트로 복잡한 시나리오를 손쉽게 구성할 수 있습니다.
nGrinder는 Naver가 Grinder 프레임워크를 기반으로 개발한 엔터프라이즈급 분산 부하 테스트 플랫폼입니다. 국내 대형 서비스들의 성능 검증에 사용됩니다.
| 특징 | 설명 |
|---|---|
| 웹 UI | 브라우저에서 테스트 설계 · 실행 · 모니터링 |
| 분산 아키텍처 | Controller + 다수 Agent로 대규모 부하 생성 |
| Groovy/Jython | JVM 기반 스크립트로 복잡한 시나리오 구성 |
| 스크립트 레코딩 | HTTP 프록시로 실제 사용자 행동 자동 녹화 |
하나의 Controller에 여러 Agent를 연결하여 수평 확장이 가능합니다.
version: '3'
services:
controller:
image: ngrinder/controller:3.5.9
ports:
- "8080:8080"
- "16001:16001"
- "12000-12009:12000-12009"
volumes:
- ./ngrinder-home:/opt/ngrinder-controller
agent:
image: ngrinder/agent:3.5.9
links:
- controller
environment:
- CONTROLLER_ADDR=controllerdocker-compose up -d
# http://localhost:8080 접속
# 기본 계정: admin / adminAgent를 여러 개 실행하려면 agent 서비스를 scale out 하세요: docker-compose up --scale agent=3 -d
import static net.grinder.script.Grinder.grinder
import static org.junit.Assert.*
import static org.hamcrest.Matchers.*
import net.grinder.script.GTest
import net.grinder.plugin.http.HTTPRequest
import net.grinder.plugin.http.HTTPPluginControl
def test1 = new GTest(1, "API Test")
def request = new HTTPRequest()
test1.record(request)
class TestRunner {
public void __call__() {
def response = request.GET("https://httpbin.org/get")
assertThat(response.statusCode, is(200))
grinder.logger.info("Response: ${response.text}")
}
}import net.grinder.plugin.http.HTTPRequest
import HTTPClient.NVPair
def request = new HTTPRequest()
def headers = [new NVPair("Content-Type", "application/json")] as NVPair[]
class TestRunner {
void __call__() {
def body = '{"username": "user1", "password": "pass1"}'
def response = request.POST(
"https://api.example.com/login",
body.bytes,
headers
)
assert response.statusCode == 200
}
}테스트 실행 중 실시간으로 TPS, 평균 응답시간, 에러율을 모니터링할 수 있습니다.
테스트 완료 후 자동으로 HTML 리포트가 생성됩니다. 주요 지표:
Agent 메모리 조정: Agent 설정에서 -Xms512m -Xmx1024m으로 JVM 힙을 늘려 더 많은 VUser를 처리하세요.
Controller와 Agent, Target Server를 같은 머신에 두면 정확한 결과를 얻을 수 없습니다. 반드시 분리하세요.