Glimpse making everything 50x slower

2019-03-20 19:34发布

问题:

Ive been using glimpse to try to address some slow page issues, only to discover that glimpse is the cause. The page requests are 30000+ seconds, without glimpse they are instant. So I've been chasing ghosts.

How can I use glimpse to see how long everything takes when it is causing such speed differences.

Do I have something configured wrong or is it always this slow

回答1:

Update your glimpse web.config element to have the following entries:

<glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd">
    <tabs>
        <ignoredTypes>
            <add type="Glimpse.Mvc.Tab.ModelBinding, Glimpse.Mvc3" />
            <add type="Glimpse.Mvc.Tab.Metadata, Glimpse.Mvc3" />
        </ignoredTypes>
    </tabs>
    <inspectors>
        <ignoredTypes>
            <add type="Glimpse.Mvc.Inspector.ModelBinderInspector, Glimpse.Mvc3" />
        </ignoredTypes>
    </inspectors>
</glimpse>


回答2:

Go to /Glimpse.axd and uncheck all the Glimpse addons/tabs. It will give you the XML config needed to copy & paste into your web.config. In my case, it was Routes, probably due to extensive use of attribute routing. Others have mentioned Cache and Metadata, so start by ignoring all, then comment out a few at a time until you find what slows down Glimpse.

Note that the below config may not work for you, if you have different addons or versions installed.

  <glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd">
    <tabs>
      <ignoredTypes>
<!--        <add type="Glimpse.Ado.Tab.SQL, Glimpse.Ado" />-->
<!--        <add type="Glimpse.AspNet.Tab.Cache, Glimpse.AspNet" />-->
<!--        <add type="Glimpse.AspNet.Tab.Configuration, Glimpse.AspNet" />-->
<!--        <add type="Glimpse.AspNet.Tab.Environment, Glimpse.AspNet" />-->
<!--        <add type="Glimpse.AspNet.Tab.Request, Glimpse.AspNet" />-->
        <add type="Glimpse.AspNet.Tab.Routes, Glimpse.AspNet" />
<!--        <add type="Glimpse.AspNet.Tab.Server, Glimpse.AspNet" />-->
<!--        <add type="Glimpse.AspNet.Tab.Session, Glimpse.AspNet" />-->
<!--        <add type="Glimpse.Core.Tab.Timeline, Glimpse.Core" />-->
<!--        <add type="Glimpse.Core.Tab.Trace, Glimpse.Core" />-->
<!--        <add type="Glimpse.Mvc.Tab.Execution, Glimpse.Mvc5" />-->
<!--        <add type="Glimpse.Mvc.Tab.Metadata, Glimpse.Mvc5" />-->
<!--        <add type="Glimpse.Mvc.Tab.Views, Glimpse.Mvc5" />-->
<!--        <add type="Glimpse.NLog.NLogTab, Glimpse.NLog" /> -->
      </ignoredTypes>
    </tabs>
    <runtimePolicies>
    </runtimePolicies>
  </glimpse>