Win2K3, profiler v5.2.0.44 "Error stopping W3SVC"

Memory profiling for .NET developers

Win2K3, profiler v5.2.0.44 "Error stopping W3SVC"

Postby jaap.q42 » Wed Jan 13, 2010 9:24 pm

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"

Code: Select all
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()
jaap.q42
 
Posts: 26
Joined: Thu Dec 17, 2009 3:21 pm

Postby jaap.q42 » Wed Jan 13, 2010 9:28 pm

I've tried this with and without:
<gcServer enabled="false" />
in aspnet.config
jaap.q42
 
Posts: 26
Joined: Thu Dec 17, 2009 3:21 pm

Postby Brian Donahue » Fri Jan 15, 2010 1:38 pm

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.
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am

Postby jaap.q42 » Fri Jan 15, 2010 2:47 pm

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.q42
 
Posts: 26
Joined: Thu Dec 17, 2009 3:21 pm

Postby jaap.q42 » Fri Jan 15, 2010 4:20 pm

Hi Brian,

When I use port 8013 I get an error taking a snapshot:

Code: Select all
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...
jaap.q42
 
Posts: 26
Joined: Thu Dec 17, 2009 3:21 pm

Postby AndrewH » Fri Jan 15, 2010 6:04 pm

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.
AndrewH
 
Posts: 134
Joined: Thu Aug 17, 2006 3:44 pm

Postby jaap.q42 » Fri Jan 15, 2010 7:26 pm

I'm running fine right now, but suddenly (not pressed any button for a long time):

Code: Select all
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()


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.q42
 
Posts: 26
Joined: Thu Dec 17, 2009 3:21 pm

Postby jaap.q42 » Fri Jan 15, 2010 7:45 pm

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.q42
 
Posts: 26
Joined: Thu Dec 17, 2009 3:21 pm

Postby jaap.q42 » Fri Jan 15, 2010 7:53 pm

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.
jaap.q42
 
Posts: 26
Joined: Thu Dec 17, 2009 3:21 pm

Postby Chris.Allen » Thu Jan 28, 2010 12:14 pm

How are your tests going now Jaap?
Chris.Allen
 
Posts: 594
Joined: Thu Mar 12, 2009 4:17 pm

Postby jaap.q42 » Thu Feb 11, 2010 1:12 pm

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.
jaap.q42
 
Posts: 26
Joined: Thu Dec 17, 2009 3:21 pm


Return to ANTS Memory Profiler Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests