Aborting 오류 관련 문의

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Aborting 오류 관련 문의

sangseok lim
안녕하세요? nGrinder를 처음으로 사용해보려는 newbie입니다.
서버에 10,000 수준의 부하를 생성하기 위해서 agent 3대 (8cpu 32GB)를 준비하였고 테스트 코드를 작성하였습니다.
수행시 아래의 오류가 발생하여서 vuser는 10,000으로 설정되나, 실제  running은 400이하 입니다.

ERROR Aborting thread: {} Java exception creating per-thread TestRunner object
net.grinder.scriptengine.JythonScriptExecutionException: Java exception creating per-thread TestRunner Object
response = self.http_request.POST(self.uri, request_body, headers)

TestRunner의 __init__ 함수에서는 사용자 session을 생성하기 위한 HTTP request를 보냅니다.
그런데 이 함수에서 오류가 발생합니다.

해당 함수를 __call__로 옮기면 위 error가 발생하지 않고 10,000에 가까운 vuser가 running하게 됩니다.

메모리 부족 문제는 아닌 것으로 보이는데, 혹시 위 error가 __init__에서 발생하는 이유를 알수 있을까요?
Reply | Threaded
Open this post in threaded view
|

Re: Aborting 오류 관련 문의

songeunwoo
안녕하세요.

에이전트 Ulimit 설정이 의심이 가는듯 합니다.
해당 장비의 설정을 확인해 보시기 바랍니다.

감사합니다.
Reply | Threaded
Open this post in threaded view
|

Re: Aborting 오류 관련 문의

sangseok lim
ulimit에서 nofile과 noproc는 65536으로 이미 설정되어 있습니다.
답변 감사드립니다.
Reply | Threaded
Open this post in threaded view
|

Re: Aborting 오류 관련 문의

songeunwoo
안녕하세요.

에이전트의 설정이 문제가 아니라면 서버쪽의 동시 커넥션 설정을 확인해 보아야 할거 같습니다.
그리구 init에서 session을 생성하는 부분에서 에러가 난다구 이야기 주셨느데,
로그인이 정상적으로 되어 지는지 부터 확인이 되어야 할듯 합니다.
record를 사용하지 않으시고 wrap을 사용 하시는 분들도 계시던데 이것도 테크 해보시기 바랄게요.

혹시나 도움이 될까하여 login sample 아래 붙여 드립니다.

# _*_ coding: utf8 _*_
from HTTPClient import NVPair, Cookie, CookieModule, CookiePolicyHandler
from net.grinder.plugin.http import HTTPPluginControl, HTTPRequest
from net.grinder.script import Test
from net.grinder.script.Grinder import grinder

# Set up a cookie handler to log all cookies that are sent and received.
class MyCookiePolicyHandler(CookiePolicyHandler):
    def acceptCookie(self, cookie, request, response):
        return 1

    def sendCookie(self, cookie, request):
        return 1

CookieModule.setCookiePolicyHandler(MyCookiePolicyHandler())

test1 = Test(1, "login example")
request1 = HTTPRequest(url="http://please_modify_this.com")
test1.record(request1)
HTTPPluginControl.followRedirects = True   ## 주석 해제 followRedirects True

class TestRunner:
    def __init__(self):
        # Login URL
        request1 = HTTPRequest(url="https://please_modify_this.com")
        ##### reset to the all cookies #####
        threadContext = HTTPPluginControl.getThreadHTTPClientContext()
        self.cookies = CookieModule.listAllCookies(threadContext)
        for c in self.cookies: CookieModule.removeCookie(c, threadContext)

        # do login
        result = request1.POST("https://please_modify_this.com/login.login", ( NVPair("id", "your_id"),NVPair("pw", "your_pw")));
        grinder.logger.warn("%d." %  result.getStatusCode())

        ##### save to the login info in cookies #####
        self.cookies = CookieModule.listAllCookies(threadContext)

    def __call__(self):
        grinder.statistics.delayReports = 1
        ##### Set to the cookies for login #####
        threadContext = HTTPPluginControl.getThreadHTTPClientContext()
        for c in self.cookies: CookieModule.addCookie(c,threadContext)

        ##### Request with login #####
        result = request1.GET("https://check_mypage.com")

        if result.getStatusCode() == 200 :
            return
        elif result.getStatusCode() in (301, 302) :
            grinder.logger.warn("Warning. The response may not be correct. The response code was %d." %  result.getStatusCode())
            return
        else :
            raise


감사합니다.