Keep-Alive

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Keep-Alive

yskwon
This post was updated on .
서버쪽에는 connection pool 기능이 on 상태입니다.
자체 제작한 클라이언트 프로그램으로 http 접속을 테스트 하였을 때는
keep-alive 기능이 잘 작동 합니다.
그러나 ngrinder agent 를 돌렸을 때는 keep-alive 기능이 작동하지 않습니다.
매번 새로운 connection 을 생성합니다.
ngrinder agent 가 connection 을 생성하지 않고
재사용하도록 하려면 어떤 추가 조치가 필요한지요?

public static NVPair[] headers = [new NVPair("Content-Type", "application/json"),new NVPair("Connection", "Keep-Alive")]

....
@BeforeProcess
...
request = new HTTPRequest()
       
...

@Before
...
request.setHeaders(headers)

...

@Test
...
HTTPResponse result = request.POST(HOSTS.get(r.nextInt(hostSize)), data.getBytes(), headers)