Win2K3, profiler v5.2.0.44 "Error stopping W3SVC"

jaap.q42jaap.q42 Posts: 36 Bronze 2
I'm running profiler 5.2.0.44, I start profiling using:
ASP.NET (hosted in IIS)
profile child process [checked]
monitor disposal of object [checked]
Original port (IIS will restart).
-> Start Profiling

I wait for the website to start and wait for the first page to load in the browser. Performance counters are working and show consitent behavior each profiling session.

-> Take memory snapshot

An error occurs:
"Error stopping W3SVC"
Error stopping W3SVC
RedGate.Profiler.Engine.Startup.IIS.IISException
stack trace: 
  at RedGate.Profiler.Engine.Startup.IISActuators.IISServiceRestarterActuator`1.StopServicesInOrder()
  at RedGate.Profiler.Engine.Startup.IISActuators.IISServiceRestarterActuator`1.StopProfilingIIS()
  at RedGate.Profiler.Engine.Startup.IIS.IISStarter`1.StopProfilingIIS()
  at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
  at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
rethrown at [0]: 
  at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
  at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
  at RedGate.Profiler.Engine.Startup.IIISActuator`1.StopProfilingIIS()
  at RedGate.Profiler.Engine.Startup.Sessions.IISSession`1.Stop()
  at RedGate.Memory.Controller.Session.ProfilerSession.Stop()
  at RedGate.Memory.Controller.Session.ProfilerSessionThreader.Stop()
  at RedGate.Memory.Controller.ConceptManagers.ProfilingProgressManager.ProfilingProgressManager.m_State_Session_SnapshotCompleted(Object sender, EventArgs e)
  at RedGate.Memory.Controller.Session.ProfilerSessionThreader.<>c__DisplayClass16.<backer_SnapshotCompleted>b__15()
  at RedGate.Memory.Controller.WorkQueue.WorkQueue.Run()

Caused by:

Timed out starting 'W3SVC'
RedGate.Profiler.Engine.Startup.IIS.ServiceUtilitiesException
  at RedGate.Profiler.Engine.Startup.IIS.ServiceUtilities.StopService(String serviceName)
  at RedGate.Profiler.Engine.Startup.IISActuators.IISServiceRestarterActuator`1.StopServicesInOrder()

Comments

  • jaap.q42jaap.q42 Posts: 36 Bronze 2
    I've tried this with and without:
    <gcServer enabled="false" />
    in aspnet.config
  • Brian DonahueBrian Donahue Posts: 6,590 New member
    Hi Jaap,

    Unfortunately it's going to be difficult to tell why IIS cannot stop without first checking the system and/or application logs on the computer -- the problem is outside of ANTS Profiler because it's calling Windows APIs to start and stop the service. The WWW Service could be hung for some reason or not responding to a stop request.

    Can I ask, do you need to use the profile on original port option? Using a custom port (8013 recommended) is a quicker and less complicated way of starting the web application on IIS 6.
  • jaap.q42jaap.q42 Posts: 36 Bronze 2
    Hi Brian,

    For my information:
    Why does ANTS profiler need to stop IIS when I press the Take snapshot button? Because that is what happens (IIS was already restarted by the profiler).

    Jaap
  • jaap.q42jaap.q42 Posts: 36 Bronze 2
    Hi Brian,

    When I use port 8013 I get an error taking a snapshot:
    The snapshot failed because .NET did not report every referenced object. This failure is most likely due to a bug in version 2 of the CLR that can be triggered when the garbage collector is operating in 'server mode' and the target application has many large objects.You can work around this bug by manually switching your application to the workstation garbage collector. See the MSDN documentation on the gcServer configuration option for information on how to acheive this.
    

    I added <gcServer enabled="false" /> to
    C:\WINDOWS\microsoft.net\Framework\v2.0.50727\aspnet.config
    and I still get the same error.

    But then I rembered that the system is 64 bits and that there is also a
    C:\WINDOWS\microsoft.net\Framework64\v2.0.50727
    directory.


    After I added gcServer enabled="false" /> to
    C:\WINDOWS\microsoft.net\Framework64\v2.0.50727\aspnet.config
    It worked like a charm. Maybe you can add this 64bit gotcha in some FAQ?



    So for now I'm satisfied with the workaround, but I'm still puzzled why the IIS restart is happening...
  • The profiler is set up so that if a snapshot fails for any reason it tries to shut down the session. The error reporting isn't set up quite right: if the shutdown then fails, the original error is lost and the shutdown error reported instead (I've raised a bug about this; it's incorrect behaviour as the error is secondary and isn't any help in fixing the condition).

    In this case, the profiler is detecting the condition that is caused by the gcServer issue and reporting it as a reason for failing the snapshot to the UI, which then shuts down the session in response.
    Andrew Hunter
    Software Developer
    Red Gate Software Ltd.
  • jaap.q42jaap.q42 Posts: 36 Bronze 2
    I'm running fine right now, but suddenly (not pressed any button for a long time):
    Error stopping W3SVC
    RedGate.Profiler.Engine.Startup.IIS.IISException
    stack trace: 
      at RedGate.Profiler.Engine.Startup.IISActuators.IISServiceRestarterActuator`1.StopServicesInOrder&#40;&#41;
      at RedGate.Profiler.Engine.Startup.IISActuators.IISServiceRestarterActuator`1.StopProfilingIIS&#40;&#41;
      at RedGate.Profiler.Engine.Startup.IIS.IISStarter`1.StopProfilingIIS&#40;&#41;
      at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage&#40;IntPtr md, Object&#91;&#93; args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object&#91;&#93;& outArgs&#41;
      at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage&#40;IMessage msg, Int32 methodPtr, Boolean fExecuteInContext&#41;
    rethrown at &#91;0&#93;: 
      at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage&#40;IMessage reqMsg, IMessage retMsg&#41;
      at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke&#40;MessageData& msgData, Int32 type&#41;
      at RedGate.Profiler.Engine.Startup.IIISActuator`1.StopProfilingIIS&#40;&#41;
      at RedGate.Profiler.Engine.Startup.Sessions.IISSession`1.Stop&#40;&#41;
      at RedGate.Memory.Controller.Session.ProfilerSession.Stop&#40;&#41;
      at RedGate.Memory.Controller.Session.ProfilerSessionThreader.Stop&#40;&#41;
      at RedGate.Memory.Controller.ConceptManagers.ProfilingProgressManager.ProfilingProgressManager.m_State_Session_SnapshotCompleted&#40;Object sender, EventArgs e&#41;
      at RedGate.Memory.Controller.Session.ProfilerSessionThreader.&lt;&gt;c__DisplayClass16.&lt;backer_SnapshotCompleted&gt;b__15&#40;&#41;
      at RedGate.Memory.Controller.WorkQueue.WorkQueue.Run&#40;&#41;
    
    Caused by:
    
    Timed out starting 'W3SVC'
    RedGate.Profiler.Engine.Startup.IIS.ServiceUtilitiesException
      at RedGate.Profiler.Engine.Startup.IIS.ServiceUtilities.StopService&#40;String serviceName&#41;
      at RedGate.Profiler.Engine.Startup.IISActuators.IISServiceRestarterActuator`1.StopServicesInOrder&#40;&#41;
    

    I'm running with gcServer now, so this time, the actual error is also hidden .
    Is there a log file in which the original error is present?
  • jaap.q42jaap.q42 Posts: 36 Bronze 2
    I've found a log file, but I don't see really strange things in the logs.
    Can I send a log file to someone?

    No noticable eventlogs (other than some unhandled exceptions in the website)
  • jaap.q42jaap.q42 Posts: 36 Bronze 2
    Unfortunately I ran this longrunning performance test with IIS restart to confirm that setting Framework64\aspnet.config gcServer="false" works.

    So after the weekend I'll run with custom port again (have to alter load test in order to do that), and hope this error doesn't appear again or if it does, I can post a better stacktrace of the actual error.
  • How are your tests going now Jaap?
  • jaap.q42jaap.q42 Posts: 36 Bronze 2
    Hi Chris,

    I didn't run into the sudden exception anymore. From now on I'll use the "unused port" feature and set it to port 80 (I'll have to disable the site in iis), because of the firewall between the server and the load-test-host.
Sign In or Register to comment.