java.net.ConnectException: Operation timed out

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

java.net.ConnectException: Operation timed out

minjaekim
안녕하세요.
nGrinder을 쓰다가 궁금한 점이 생겨서 글을 쓰게 되었습니다.
현재 8G 4core Mac mini(yosemite)에서 테스트 중인데요.

아래의 코드로 테스트를 진행중이며
Agent 1개, 프로세스 10개, 쓰레드 700개로 총 7000명의 가상유저를 생성하여
스크립트를 10회 실행하였습니다.

이때 성공 61,516회 실패 8,484가 발생하여
로그를 열어본 결과 java.net.ConnectException: Operation timed out이라는 에러가 발생하였습니다.
이 에러가 어떠한 상황에서 발생하는 에러인지 알고싶습니다.
감사합니다.

from net.grinder.script import Test
from net.grinder.plugin.http import HTTPRequest

from net.grinder.script.Grinder import grinder
from HTTPClient import NVPair
from java.util import Random, Date

test1 = Test(1, "JSON POST TEST")

requestGet = test1.wrap(HTTPRequest(url="http://myip"))
 

class TestRunner:
    def __init__(self):
        print "Init"

    def __call__(self):
        grinder.statistics.delayReports = 1
        url= "myurl"
        json="""{
    "k": "v",
   "k": "v",
   "k": "v",
   "k": "v",
   "k": "v"
}"""
        result = requestGet.POST(url, json,   ( NVPair('Content-Type', 'application/json'), ))
        grinder.sleep(1000)
       
        if result.statusCode > 200 or result.text == "null":
            grinder.statistics.forLastTest.success = 0
        else :
            grinder.statistics.forLastTest.success = 1

======================================================

net.grinder.scriptengine.jython.JythonScriptExecutionException: Java exception calling TestRunner
        result = requestGet.POST(url, json,   ( NVPair('Content-Type', 'application/json'), ))
        File "/Users/kimminjae/.ngrinde-agent-2/file-store/admin/current/RestAPI2.py", line 30, in __call__
java.net.ConnectException: Operation timed out
        at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1.7.0_71]
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) ~[na:1.7.0_71]
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) ~[na:1.7.0_71]
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) ~[na:1.7.0_71]
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.7.0_71]
        at java.net.Socket.connect(Socket.java:579) ~[na:1.7.0_71]
        at java.net.Socket.connect(Socket.java:528) ~[na:1.7.0_71]
        at java.net.Socket.<init>(Socket.java:425) ~[na:1.7.0_71]
        at java.net.Socket.<init>(Socket.java:241) ~[na:1.7.0_71]
        at HTTPClient.HTTPConnection.getSocket(HTTPConnection.java:3408) ~[grinder-httpclient-3.9.1.jar:na]
        at HTTPClient.HTTPConnection.sendRequest(HTTPConnection.java:3089) ~[grinder-httpclient-3.9.1.jar:na]
        at HTTPClient.HTTPConnection.handleRequest(HTTPConnection.java:2883) ~[grinder-httpclient-3.9.1.jar:na]
        at HTTPClient.HTTPConnection.setupRequest(HTTPConnection.java:2675) ~[grinder-httpclient-3.9.1.jar:na]
        at HTTPClient.HTTPConnection.Post(HTTPConnection.java:1177) ~[grinder-httpclient-3.9.1.jar:na]
        at net.grinder.plugin.http.HTTPRequest$8.doRequest(HTTPRequest.java:923) ~[grinder-http-3.9.1.jar:na]
        at net.grinder.plugin.http.HTTPRequest$AbstractRequest.getHTTPResponse(HTTPRequest.java:1276) ~[grinder-http-3.9.1.jar:na]
        at net.grinder.plugin.http.HTTPRequest.POST(HTTPRequest.java:918) ~[grinder-http-3.9.1.jar:na]
        at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source) ~[na:na]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_71]
        at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_71]
        at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:186) ~[jython-standalone-2.5.3.jar:na]
        at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:204) ~[jython-standalone-2.5.3.jar:na]
        at org.python.core.PyObject.__call__(PyObject.java:441) ~[jython-standalone-2.5.3.jar:na]
        at org.python.core.PyObject.__call__(PyObject.java:447) ~[jython-standalone-2.5.3.jar:na]
        at org.python.core.PyMethod.__call__(PyMethod.java:154) ~[jython-standalone-2.5.3.jar:na]
        at org.python.pycode._pyx1.__call__$3(/Users/kimminjae/.ngrinde-agent-2/file-store/admin/current/RestAPI2.py:38) ~[na:na]
        at org.python.pycode._pyx1.call_function(/Users/kimminjae/.ngrinde-agent-2/file-store/admin/current/RestAPI2.py) ~[na:na]
        at org.python.core.PyTableCode.call(PyTableCode.java:165) ~[jython-standalone-2.5.3.jar:na]
        at org.python.core.PyBaseCode.call(PyBaseCode.java:301) ~[jython-standalone-2.5.3.jar:na]
        at org.python.core.PyBaseCode.call(PyBaseCode.java:194) ~[jython-standalone-2.5.3.jar:na]
        at org.python.core.PyFunction.__call__(PyFunction.java:387) ~[jython-standalone-2.5.3.jar:na]
        at org.python.core.PyMethod.instancemethod___call__(PyMethod.java:220) ~[jython-standalone-2.5.3.jar:na]
        at org.python.core.PyMethod.__call__(PyMethod.java:211) ~[jython-standalone-2.5.3.jar:na]
        at org.python.core.PyMethod.__call__(PyMethod.java:206) ~[jython-standalone-2.5.3.jar:na]
        at org.python.core.PyObject.invoke(PyObject.java:3555) ~[jython-standalone-2.5.3.jar:na]
        at org.python.core.PyInstance.instance___call__(PyInstance.java:351) ~[jython-standalone-2.5.3.jar:na]
        at org.python.core.PyInstance.__call__(PyInstance.java:342) ~[jython-standalone-2.5.3.jar:na]
        at org.python.core.PyObject.__call__(PyObject.java:371) ~[jython-standalone-2.5.3.jar:na]
        at net.grinder.scriptengine.jython.JythonScriptEngine$JythonWorkerRunnable.run(JythonScriptEngine.java:250) ~[grinder-core-3.9.1.jar:na]
        at net.grinder.engine.process.GrinderThread.run(GrinderThread.java:118) ~[grinder-core-3.9.1.jar:na]
Reply | Threaded
Open this post in threaded view
|

Re: java.net.ConnectException: Operation timed out

Gisoo.Gwon
부하를 받는 테스트 대상서버가 해당 요청을 처리하지 못해서 발생하는 time out입니다.
서버에는 아무런 에러로그가 남지 않았나요?