Service Virtualization

 View Only
  • 1.  TCP service is not responding after some time

    Posted Dec 02, 2019 01:18 PM
      |   view attached
    Hi Team,

    I have created one TCP service. VSM listens on TCP listener step and construct the response using Java Script step and sends the response back.

    when we send few requests, service is working fine. But when we start the load test, after few minutes Service is not responding. 
    Could you please suggest why this error coming.

    Below are the errors from VSE logs: 12306 is the port virtual service deployed.

    2019-12-02 18:02:41,461Z (13:02) [PortServer:0.0.0.0/0.0.0.0:12306] ERROR com.itko.lisa.vse.sio.PortServer - An error occurred reading from the client.2019-12-02 18:02:41,461Z (13:02) [PortServer:0.0.0.0/0.0.0.0:12306] ERROR com.itko.lisa.vse.sio.PortServer - An error occurred reading from the client.java.io.IOException: An existing connection was forcibly closed by the remote host at sun.nio.ch.SocketDispatcher.read0(Native Method) at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43) at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) at sun.nio.ch.IOUtil.read(IOUtil.java:197) at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380) at com.itko.lisa.vse.sio.NIOSession.readFromSocketChannel(NIOSession.java:189) at com.itko.lisa.vse.sio.PlainSession.readApplicationData(PlainSession.java:64) at com.itko.lisa.vse.sio.NIOSession.handleRead(NIOSession.java:138) at com.itko.lisa.vse.sio.SelectorThread.handleOperations(SelectorThread.java:316) at com.itko.lisa.vse.sio.SelectorThread.run(SelectorThread.java:265) at java.lang.Thread.run(Thread.java:745)

    PFA complete log file.

    Thank You
    Rajasekhar

    Attachment(s)

    zip
    VSE_log.zip   214 KB 1 version


  • 2.  RE: TCP service is not responding after some time
    Best Answer

    Posted Dec 03, 2019 02:17 AM

    Hi,

     

    The logs state that it is the client of your VS – ie. the SUT - that (forcibly) closes the connection. So you need to look into the logs of the SUT for the reason why it closes the connection.

     

    It could be something purely technical, but there is always one attention point which is the "Response for Unknown Conversational Request" and "Response for Unknown Stateless Request", especially when the VSI and VSM are custom as it seems to be in your case. Those 2 responses need to be in an acceptable format for your SUT. In that case you would also have noticed "non-matching" transaction in the inspection view of the portal.

     

    Cheers,

    Danny

    ::DISCLAIMER::

    The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents (with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates. Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of authorized representative of HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any email and/or attachments, please check them for viruses and other defects.






  • 3.  RE: TCP service is not responding after some time

    Broadcom Employee
    Posted Dec 03, 2019 02:35 AM
    Good answer Danny !!!

    --
    regards
    Sankar Natarajan





  • 4.  RE: TCP service is not responding after some time

    Posted Dec 03, 2019 08:56 AM
    Thank you Danny for prompt response. We are not using any VSI in our virtual service. Using only VSM and constructing the response using Java script (fixed response-ASCII format). We could see time out error only at client logs. 
    Initially service responds properly but after some time errors starts and errors keep increasing at client side and finally virtual service stops responding completely. We had to restart the service.
    Are there any performance properties to be setup in local.properties file for TCP service.

    Regards,
    Rajasekhar


  • 5.  RE: TCP service is not responding after some time

    Posted Dec 05, 2019 03:32 AM
    Hi,

    No, to my knowledge there are no performance properties to set up.

    The time-outs at the client side seem to point to the virtual service that slowly deteriorates.

    A JVM that is getting close to its maximum heap space (but not yet reporting OOM errors) could explain the behaviour. The JVM would spend increasingly more and more processing time in garbage collection. This doesn't generate any errors in logs, the JVM just stops processing your code for increasingly longer periods during the GC, resulting in time outs on the client side. If you can give the VSE process more heap space you could validate that the errors start to appear later during the test run because the GC would kick in later.

    Also, it's a custom VSM, does it have a dependency on an external DB? Or some other external service? If so, that external resource needs to have sufficient capacity.

    Do you have the possibility to validate the capacity of your virtual service using DevTest test cases. Meaning can you spin up enough vUsers in one or more Simulators and use a test case to simulate the required number of transactions coming in? In general for performance virtual services this is always a good upfront practice to avoid problems during the actual test runs. Doing an upfront DevTest-only capacity test would guide you more directly to the root cause.



    ------------------------------
    Cheers,
    Danny
    ------------------------------
    Architect
    HCL Enterprise Studio
    ------------------------------
    ------------------------------



  • 6.  RE: TCP service is not responding after some time

    Posted Dec 09, 2019 02:39 PM
    Thank you Danny for the details.

    I have given 8 GB to VSE Process and my VSM does not any dependency on external DB or any service. I am not able to test the service as TCP test step is not available. Could you please suggest a way to test the TCP service from tool.

    Thank You
    Rajasekhar


  • 7.  RE: TCP service is not responding after some time

    Posted Dec 10, 2019 09:25 AM

    Hi,

     

    I understand, I had not thought that far ahead when suggesting to do a simulated capacity test on your performance virtual service.

     

    I am not sure what are the exact requirements of your TCP payload, but for example if it is a string of text you need to send over than add a script step with below code. This piece of code assumes 3 properties exist:  

    • myPayloadProperty ~ which contains your payload
    • vs_ip ~ ip address of your virtual service (coming from config file?)
    • vs_port ~ port of your virtual service (coming from config file?)

     

     

    import java.io.OutputStreamWriter;

    import java.net.Socket;

                                   

    String tcpPayload = testExec.getStateValue("myPayloadProperty");

                                   

    Socket socket = null;

    OutputStreamWriter osw;

    socket = new Socket(vs_ip, vs_port);

    osw = new OutputStreamWriter(socket.getOutputStream(), "UTF-8");

    osw.write(tcpPayload, 0, tcpPayload.length());

    socket.close();

     

     

     

    Cheers,

    Danny

     

    ::DISCLAIMER::

    The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents (with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates. Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of authorized representative of HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any email and/or attachments, please check them for viruses and other defects.






  • 8.  RE: TCP service is not responding after some time

    Posted Dec 10, 2019 03:31 PM
    Thank you Danny. 

    Payload is ASCII text. I will try with your code and update you.

    Regards,
    Rajasekhar