none
Avicode agent causing slow initial app response

    Question

  • A new application was recently developed that we've noticed on its first call of the day takes about fifteen to twenty seconds to pull up a page.  If we turn off Avicode monitoring, kill the app and try it again, it comes up in less than five seconds.  This is repeatable across multiple environments.  It sparked further investigation, and we can see that in many applications, when Avicode is running the applications start up slower.  Is this expected behaviour, and if so, what's the cause?

    Tuesday, February 07, 2012 3:06 PM

All replies

  • Hi,

    I have several ideas what it could be related to. It may deal with gathering application friendly name while starting monitoring. Agent tries to use WMI to get friendly names, if fails it retries with ADSI. Though you might have issues (or just request to WMI/ADSI takes much time) with those providers on current server.

    You can check whether that's the root of the problem by disabling WHController:

    1.  Open “ServerAgent.config” (by default it’s located here: “C:\Program Files\AVIcode\Intercept\Agent\v5.7.491\Configuration”).

    2.  Find and comment the following line:

    <!--<ss:controller clsid="WHController.WebHostController.1" iid="{677FCD85-1031-4D3F-AD01-5AF3D1F172E3}"/>-->

    3.  Save file, close it and restart Intercept Service to apply changes.

    4.  IISRESET to load application with new monitored settings.

    5.  Check the application response.

    I should make you aware that current scenario (disabling WHController) has a side-affect: in this case Agent won't resolve friendly application name and you will receive events with the Source similar to the following:

    Though there is a solution how to rename such sources to something friendly on SEViewer side. 

    Another idea is that it may take much on instrumentation of the stack.

    In this case you should increase sensitivity threshold and disable unnecessary namespaces (check: if you have "All Namespaces" enabled, disable this firstly).


    Igor Savchenko, VIAcode Consulting LLC (http://www.viacode.com/solutions)




    Tuesday, February 07, 2012 4:05 PM
  • Hello,

    In Addition to Igor: if it's only a "first start" problem you might not need to disable All Namespaces in "Namespaces" section - only disable namespaces in Exception Tracking section. AVIcode should not instrument any methods in the Namespaces to measure the execution time, so even "All Namespaces" here will not affect startup/JIT time. Exception Tracking namespaces are another story because they require the instrumentation of the code.

    There is also another question: Does app load a lot of assemblies during start-up? If so, AVIcode may check those pieces of the compiling code to see if something should be instrumented and it will slow down the first request wihch typically intiates the modules loading. Anyway, this perf issue should not go out of the first-time request / first-time assembly load - the subsequent requests will use the compiled code.


    Dmitry Matveev

    Tuesday, February 07, 2012 10:43 PM
  • I tested commenting out that line, and it did not affect the first load of the app.  I'm checking with development now on the assemblies.  We have not added any namespace values, so whatever is on by default is what Avicode is currently using.
    Wednesday, February 08, 2012 3:08 PM
  • The fact that it impacts start up is normal, the fact that it triples start-up is not normal, in most cases. Avicode intercepts start up to attach to the frameworks APIs and then based on configs attaches to method calls to time and wait for errors. large assemblies and namespaces being configured can impact this start up but also keep in mind not all deve.opment styles and practices are equal. 

    In many cases this is a descision between it's okay to impact since the app rarely starts vs the value of the monitoring. The same thought around the depth of detail being collected may impact ongoing performance so you may dial it up or down based on the value it brings versus it's impact.

    Dmitry is spot on about assembly load, does it do any dynamic loading? And even so, is the cost worth it or do we need to dial it's depth back, and will it be enough to help. 


    Shawn Gibbs

    Thursday, February 09, 2012 2:10 PM
    Moderator
  • Can someone take a look at the code here and see if there's anything in it that would cause Avicode to make the app take so long to come up on it's initial call?

    <?xml version="1.0" encoding="utf-8" ?>
    - <wsdl:definitions xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://www.harleysvillegroup.com/VOIPService" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" targetNamespace="http://www.harleysvillegroup.com/VOIPService" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
    - <wsdl:types>
    - <s:schema elementFormDefault="qualified" targetNamespace="http://www.harleysvillegroup.com/VOIPService">
    - <s:element name="GetCallerInfo">
    - <s:complexType>
    - <s:sequence>
      <s:element minOccurs="0" maxOccurs="1" name="policyOrBillingAccountNumber" type="s:string" />
      </s:sequence>
      </s:complexType>
      </s:element>
    - <s:element name="GetCallerInfoResponse">
    - <s:complexType>
    - <s:sequence>
      <s:element minOccurs="0" maxOccurs="1" name="GetCallerInfoResult" type="tns:CallerInfo" />
      </s:sequence>
      </s:complexType>
      </s:element>
    - <s:complexType name="CallerInfo">
    - <s:complexContent mixed="false">
    - <s:extension base="tns:WebMethodResponse">
    - <s:sequence>
      <s:element minOccurs="0" maxOccurs="1" name="BillingAccountNumber" type="s:string" />
      <s:element minOccurs="0" maxOccurs="1" name="InsuredName" type="s:string" />
      <s:element minOccurs="0" maxOccurs="1" name="BillingAddress" type="s:string" />
      <s:element minOccurs="0" maxOccurs="1" name="PhoneNumber" type="s:string" />
      <s:element minOccurs="0" maxOccurs="1" name="EmailAddress" type="s:string" />
      <s:element minOccurs="0" maxOccurs="1" name="AgencyCode" type="s:string" />
      <s:element minOccurs="0" maxOccurs="1" name="AgencyName" type="s:string" />
      <s:element minOccurs="0" maxOccurs="1" name="AgencyPhone" type="s:string" />
      </s:sequence>
      </s:extension>
      </s:complexContent>
      </s:complexType>
    - <s:complexType name="WebMethodResponse">
    - <s:sequence>
      <s:element minOccurs="0" maxOccurs="1" name="ReturnCd" type="s:string" />
      <s:element minOccurs="0" maxOccurs="1" name="ErrorInfo" type="tns:ErrorInfo" />
      </s:sequence>
      </s:complexType>
    - <s:complexType name="ErrorInfo">
    - <s:sequence>
      <s:element minOccurs="0" maxOccurs="1" name="ReturnMsg" type="s:string" />
      <s:element minOccurs="0" maxOccurs="1" name="ErrorCd" type="s:string" />
      </s:sequence>
      </s:complexType>
      </s:schema>
      </wsdl:types>
    - <wsdl:message name="GetCallerInfoSoapIn">
      <wsdl:part name="parameters" element="tns:GetCallerInfo" />
      </wsdl:message>
    - <wsdl:message name="GetCallerInfoSoapOut">
      <wsdl:part name="parameters" element="tns:GetCallerInfoResponse" />
      </wsdl:message>
    - <wsdl:portType name="VOIPServicesSoap">
    - <wsdl:operation name="GetCallerInfo">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Returns Caller's Information based on billing account number</wsdl:documentation>
      <wsdl:input message="tns:GetCallerInfoSoapIn" />
      <wsdl:output message="tns:GetCallerInfoSoapOut" />
      </wsdl:operation>
      </wsdl:portType>
    - <wsdl:binding name="VOIPServicesSoap" type="tns:VOIPServicesSoap">
      <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
    - <wsdl:operation name="GetCallerInfo">
      <soap:operation soapAction="http://www.harleysvillegroup.com/VOIPService/GetCallerInfo" style="document" />
    - <wsdl:input>
      <soap:body use="literal" />
      </wsdl:input>
    - <wsdl:output>
      <soap:body use="literal" />
      </wsdl:output>
      </wsdl:operation>
      </wsdl:binding>
    - <wsdl:binding name="VOIPServicesSoap12" type="tns:VOIPServicesSoap">
      <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
    - <wsdl:operation name="GetCallerInfo">
      <soap12:operation soapAction="http://www.harleysvillegroup.com/VOIPService/GetCallerInfo" style="document" />
    - <wsdl:input>
      <soap12:body use="literal" />
      </wsdl:input>
    - <wsdl:output>
      <soap12:body use="literal" />
      </wsdl:output>
      </wsdl:operation>
      </wsdl:binding>
    - <wsdl:service name="VOIPServices">
    - <wsdl:port name="VOIPServicesSoap" binding="tns:VOIPServicesSoap">
      <soap:address location="http://webapps/VOIPServices/voipservices.asmx" />
      </wsdl:port>
    - <wsdl:port name="VOIPServicesSoap12" binding="tns:VOIPServicesSoap12">
      <soap12:address location="http://webapps/VOIPServices/voipservices.asmx" />
      </wsdl:port>
      </wsdl:service>
      </wsdl:definitions>
    Wednesday, February 15, 2012 2:43 PM