Continous / CommandLine profiling [v7.4.0.77]
joe123
Posts: 11
Good news : So I finally managed to convince the wallet holders to splurge, and now we have paid licenses for ants - hooray!
Bad news: Now I have to put into practise the wodnerful things I said it could do.
From what I gahtered when I spoke last the continous profiling was semi dropped, or at least has been put ont he backburner, which is a real shame, because that would be a fantastic metric to be able to capture.
As is, what I thought I coudl do meanwhile is if only briefly, be able to remote launch Ants on a production server remotely, stress test the server for 10 or so minutes, tell ants to stop and send myself the files.. seems simple enough.
First issue : OOPS! command line doesnt support debugging IIS.. never mind, you can use a pre-saved project, right? Just have to set up localhost as the default and...
Z:\datos\Visual Studio 2012\Projects\StressTest\StressTest>"C:\Program Files\Red
Gate\ANTS Performance Profiler 7\Profile.exe" /project:ProfileLocalhostProject.app7 /xml:antstmp.xml /csv:antstmp.csv /data:antstmp.app7 /site:0
ANTS Performance Profiler Command Line Utility V7.4.0.77
==============================================================================
Copyright © Red Gate Software Ltd 2010-2012
== Initialising profiler
log4net:WARN XmlHierarchyConfigurator: Unable to set property [securityContext]
on object [log4net.Appender.FileAppender] using value [log4net.Util.NullSecurity
Context.Instance] (with acceptable conversion types)
Will attempt to record SQL and File I/O events for this session
Using the settings from the project file 'ProfileLocalhostProject.app7'
Preparing session
Starting IIS Profiling Host
Initializing ...
Error while starting IIS
Error while starting IIS
Error while trying to launch the application process
Exception
=========
RedGate.Profiler.Engine.Exceptions.CannotStartSessionException:
Could not start IIS.
en ?§♣.↑▬♣.Launch()
en ↓☼♣.¶?☻.►‼(Licence )
en ↓☼♣.¶?☻.??♥(String[] )
Caused by RedGate.Profiler.Engine.Exceptions.CannotStartIisSessionException:
Could not start IIS.
en ?§♣.◄↑♣.§↔♣()
en ?§♣.↑▬♣.Launch()
Caused by RedGate.Profiler.Engine.Exceptions.CannotStartIisSessionException:
Ambiguous site selection. Could not determine which site should be profiled.
en ?→►.↓?►.??♥()
en ?§♣.↑▬♣.??♥(↔←► )
en ?§♣.◄↑♣.§↔♣()
Caused by RedGate.Profiler.Engine.Startup.IIS.IISException:
Ambiguous site selection. Could not determine which site should be profiled.
Server stack trace:
en RedGate.Profiler.Engine.Startup.IIS.IISUtilities.↨⌂♣(Uri )
en RedGate.Profiler.Engine.Startup.IIS.IIS7Utilities.↑⌂♣(Uri )
en RedGate.Profiler.Engine.Startup.IIS.IIS7Utilities.▬⌂♣(Uri )
en ↔▬♣.▲▬♣.StartProfilingIIS(String , String )
en RedGate.Profiler.Engine.Startup.IIS.IISStarter`1.StartProfilingIIS(String
currentUserName, String subprocessVariableValue)
en System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(
IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInCont
ext, Object[]& outArgs)
en System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMes
sage msg, Int32 methodPtr, Boolean fExecuteInContext)
Exception rethrown at [0]:
en System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage req
Msg, IMessage retMsg)
en System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgDa
ta, Int32 type)
en RedGate.Profiler.Engine.Startup.IIISActuator`1.StartProfilingIIS(String cu
rrentUserName, String subprocessVariableValue)
en ?→►.↓?►.??♥()
hmm .. " Ambiguous site selection. Could not determine which site should be profiled"
Thats a bummer, as the help /? for the commandline "profile.exe" doesnt seem to have a /site switch.
So.... I guess the question is, how do I go about this? What are my options?
Bad news: Now I have to put into practise the wodnerful things I said it could do.
From what I gahtered when I spoke last the continous profiling was semi dropped, or at least has been put ont he backburner, which is a real shame, because that would be a fantastic metric to be able to capture.
As is, what I thought I coudl do meanwhile is if only briefly, be able to remote launch Ants on a production server remotely, stress test the server for 10 or so minutes, tell ants to stop and send myself the files.. seems simple enough.
First issue : OOPS! command line doesnt support debugging IIS.. never mind, you can use a pre-saved project, right? Just have to set up localhost as the default and...
Z:\datos\Visual Studio 2012\Projects\StressTest\StressTest>"C:\Program Files\Red
Gate\ANTS Performance Profiler 7\Profile.exe" /project:ProfileLocalhostProject.app7 /xml:antstmp.xml /csv:antstmp.csv /data:antstmp.app7 /site:0
ANTS Performance Profiler Command Line Utility V7.4.0.77
==============================================================================
Copyright © Red Gate Software Ltd 2010-2012
== Initialising profiler
log4net:WARN XmlHierarchyConfigurator: Unable to set property [securityContext]
on object [log4net.Appender.FileAppender] using value [log4net.Util.NullSecurity
Context.Instance] (with acceptable conversion types)
Will attempt to record SQL and File I/O events for this session
Using the settings from the project file 'ProfileLocalhostProject.app7'
Preparing session
Starting IIS Profiling Host
Initializing ...
Error while starting IIS
Error while starting IIS
Error while trying to launch the application process
Exception
=========
RedGate.Profiler.Engine.Exceptions.CannotStartSessionException:
Could not start IIS.
en ?§♣.↑▬♣.Launch()
en ↓☼♣.¶?☻.►‼(Licence )
en ↓☼♣.¶?☻.??♥(String[] )
Caused by RedGate.Profiler.Engine.Exceptions.CannotStartIisSessionException:
Could not start IIS.
en ?§♣.◄↑♣.§↔♣()
en ?§♣.↑▬♣.Launch()
Caused by RedGate.Profiler.Engine.Exceptions.CannotStartIisSessionException:
Ambiguous site selection. Could not determine which site should be profiled.
en ?→►.↓?►.??♥()
en ?§♣.↑▬♣.??♥(↔←► )
en ?§♣.◄↑♣.§↔♣()
Caused by RedGate.Profiler.Engine.Startup.IIS.IISException:
Ambiguous site selection. Could not determine which site should be profiled.
Server stack trace:
en RedGate.Profiler.Engine.Startup.IIS.IISUtilities.↨⌂♣(Uri )
en RedGate.Profiler.Engine.Startup.IIS.IIS7Utilities.↑⌂♣(Uri )
en RedGate.Profiler.Engine.Startup.IIS.IIS7Utilities.▬⌂♣(Uri )
en ↔▬♣.▲▬♣.StartProfilingIIS(String , String )
en RedGate.Profiler.Engine.Startup.IIS.IISStarter`1.StartProfilingIIS(String
currentUserName, String subprocessVariableValue)
en System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(
IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInCont
ext, Object[]& outArgs)
en System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMes
sage msg, Int32 methodPtr, Boolean fExecuteInContext)
Exception rethrown at [0]:
en System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage req
Msg, IMessage retMsg)
en System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgDa
ta, Int32 type)
en RedGate.Profiler.Engine.Startup.IIISActuator`1.StartProfilingIIS(String cu
rrentUserName, String subprocessVariableValue)
en ?→►.↓?►.??♥()
hmm .. " Ambiguous site selection. Could not determine which site should be profiled"
Thats a bummer, as the help /? for the commandline "profile.exe" doesnt seem to have a /site switch.
So.... I guess the question is, how do I go about this? What are my options?
Comments
It may be all you need to do is run Profiler as Administrator.
If that doesn't work, you can try using more specific bindings, ie try reconfiguring the site to bind to a specific TCP port and specify that port in the URL that you supply to ANTS.
The project already has "localhost, restart on same port, port 80 " etc. saved, and as far as I can tell there is no way to override this information in the command line parameters (there isnt even a way to specify you want to profile IIS if you don't use a project file), so the question remains.. If i need to specify which site it refers to... HOW do I do that?
Also, just to clarify, ANTS will only profile web applications running on the local IIS installation. It can't profile web applications hosted on another server. That could also be the cause of your problem.
However as the Continuous profiling mode still seems to be in beta, or at least not very well publicised, the issue and "solution" we are trying to implement is the following:
Problem:
We host and provide web services to various clients who have different peak times of use. We are constantly developing new bits and pieces, and we cannot allow the web service performance to slip, therefore regular stress testing is a necessary evil.
When we do said testing, we take one production server out of the load balancer, stress it with an in-house program, and then return it to the load balancer none the wiser.
Aim:
What we would like to be able to do, is from that in-house program send a message to the server to "start" ants, perform our load testing, collect the results, "stop" ants.
So basically the same process as before, but with profiling activated. In a way that is automated. I notice the memory profiler has an API for interacting with it, but the performance profiler doesn't seem to ( unless I am just looking in the wrong place).
My question is, given the tools that are available, how can I accomplish this goal?
Can you test the web configuration on that server?
I would upload a screenshot but it would appear I am operating in semi retarded mode today and cant find the button to do so.
On a production server, yes I would imagine the host would be the prime differencing factor, but in localhost there basically ISN'T a nice way of dealing with this, so we stop one site and start the other as needed.
Is there a way to post semi private information? I could send you the <sites> section for the applicationHost.config so you could see what I meant, but I'm not too sure my employers would be amused with me posting said information in a public forum
Various sites have this binding info, verbatim:
<bindings>
<binding protocol="http" bindingInformation="*:80:" />
</bindings>
The currently active site i.e the one I want at the moment has the following information ( and in this case is the first in the list)
<bindings>
<binding protocol="http" bindingInformation="*:80:" />
<binding protocol="net.tcp" bindingInformation="808:*" />
<binding protocol="net.pipe" bindingInformation="*" />
<binding protocol="net.msmq" bindingInformation="localhost" />
<binding protocol="msmq.formatname" bindingInformation="localhost" />
</bindings>
Also all the deactivated sites have the attribute
serverAutoStart="false"
whereas the active one has
serverAutoStart="true"
Of course all this guessing could be avoided if the ants commandline start would just take a /site parameter that could pass in the site id ;P
Why is it that it is only supported through the ui / project files? Is the setup really that complex?
I don't think this is strictly the fault of ANTS - all it does is spin up a copy of w3wp.exe, and in order for it to do this it needs a host configuration file that only contains information for one website or w3wp will not start the site. You'd have to remove the ambiguous site from the IIS configuration.
The other option would be to use the development web server - all that needs is to be shown the website's folder location. It does needa dedicated, unused TCP port, though.
And assuming there really is no way to do that via command line, Is it possible to publish a list of messages the ui window will respond to so at least we can use the Win32 API / SendMessage to simulate someone pushing the relevant buttons?
Also.. whatever happened to the continuous profiling mode?
http://www.red-gate.com/supportcenter/C ... figuration
no longer seems applicable, or at least I cannot find the " Continuous Profiling Configuration Tool." link
Continuous Profiling was an idea hoping to solve all of the problems people have with ANTS trying to launch IIS - it was implemented as an IIS module in the website that collected profiling data continuously and displayed it on another website in the same server.
Unfortunately it was never technically finished (for instance, no line-level timings, HTTP/SQL profiling, etc) and there was little feedback from users about it, so it looks to have died off.
We are looking at approaching website profiling in a different way now, which will be more relevant to the problems faced by ASP .NET developers.