Red Gate forums :: View topic - Profiler not set up right?
Return to RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
ANTS Performance Profiler 6
ANTS Performance Profiler 6 forum

Profiler not set up right?

Search in ANTS Performance Profiler 6 forum
Post new topic   Reply to topic
Jump to:  
Author Message

Joined: 26 Feb 2011
Posts: 1

PostPosted: Sat Feb 26, 2011 1:09 am    Post subject: Profiler not set up right? Reply with quote

So I am trying to run the profiler with a mvc application locally. As soon as I run the profiler it just shows me Directory Listing and is on a different port than when I run the application. Even if I change the port number to listen in on the same one where I am testing - the profiler gives me an error saying that the port is in use.

Could not launch the task to be profiled.
at ..Launch()
at RedGate.Profiler.Session.ProfilerSession.?()

Caused by:

Cannot profile web application on port 52379: the port is already in use - please select a different port
at .?.()
at ..Launch()

Any ideas? I think I am just doing this wrong.
Back to top
View user's profile Send private message
Brian Donahue

Joined: 23 Aug 2004
Posts: 6678

PostPosted: Sat Feb 26, 2011 12:12 pm    Post subject: Reply with quote


The dialog for profiling a website very often leads you down the wrong path. If I can explain what the settings do, this should help.

At the root of the problem, Profiler NEEDS an unused TCP port because it runs an ASP .NET worker process outside of IIS. It launches w3wp from the console and the only bindings it can use this way are TCP port (host headers, etc don't matter).

Since it is launching a listener on this port, it can't be in use - ie IIS cannot also be listening on that port at the same time. To make things worse, the "profile on original port" setting seems to have no effect except to restart IIS, which will fail about 50% of the time. Do not use this. Also, specifying the ASPNET user account is only meant for a specific circumstance on WinXP. Don't use that either.

The address textbox lets you include a port, but this is only for the purpose of allowing Profiler to parse the bindings in IIS to find the website's virtual directory location. The website you are profiling will actually answer on the unused port, by default 8013.

So what you are meant to do is specify the address the site normally runs on in the address textbox, ie http://localhost:80/MyApp and the port Profiler will run it on in the unused port textbox (8013). If you want to invoke the code so Profiler will pick it up, you must tell your browser to open http://localhost:8013/MyApp. Your browser can still open http://localhost:80/MyApp, but that request will be serviced by IIS and not profiled.

If your website must run on the original port, tell profiler unused port (80) and shutdown the website in IIS.

Finally, I don't think the worker process started by Profiler respects the default document you've set and that's how you end up with a directory listing. You just need to click on your default document.

Sorry this dialogue is so misleading. I would personally like very much to have it changed.
Back to top
View user's profile Send private message
Brian Donahue

Joined: 23 Aug 2004
Posts: 6678

PostPosted: Fri Mar 18, 2011 4:22 pm    Post subject: Reply with quote

Just as a follow-up, I've spent the afternoon reviewing the IIS code because it's caused all of our customers such a hassle.

A lot of the issues I've highlighted were based on my understanding of the version 5 code and there have been some significant changes in v6 as far as I can tell.

1. Profile on original port actually does something besides start IIS for no reason - it changes the profiling so any process started by the W3SVC will have profiling hooked in. The IISRESET seems to fail a lot of the time, but this must be for reasons other than the code (ie access rights, etc).

2. ASP .NET Account details - the original purpose of this was in the case where we could not read the information from Machine.config in IIS v5. In Profiler v6, this also has the effect of starting the worker process (w3wp.exe) as the named user. The username and password are used to create a login token to use when launching w3wp.exe.

3. The ANTS Profiler 6 Service is used as a fallback when launching the w3wp.exe process fails.

The complication of this setup makes it extremely difficult for us in support to diagnose any IIS issue. We appreciate your patience if you do run into any IIS issues.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2005 phpBB Group