Comments
8 comments
-
This problem is going to be a knowledge base article for 4.0, though we hope to improve the error reporting to make this problem easier to diagnose in future releases.
The problem is due to the service not being able to write results out to the ANTS results directory - for example because it is running as LocalService - which causes it to fail on startup. There are a few things you can do to rectify this problem:
The best solution to this problem is to ensure that the directory that ANTS is using can be written to by the service you are profiling. By default this is C:\Documents and settings\<user>\Local Settings\Application Data\Red Gate\ANTS Performance Profiler 4 on XP. Setting the security so that Everyone has Full Control will ensure that anything can be profiled, though you may prefer to just add the service user. If you want to use a different directory, you can change it by setting the RGTEMP environment variable to whichever directory you want ANTS to use.
An alternative is to change the user that the service is configured to run as: LocalSystem services will typically have no problems, as will ones configured to run as your own user account. -
Hi Andrew!
I have checked out the access permissions to ANTS results directory and it seems that the Windows service account has full control over this resource.
Also, I have set the environment variable RGTEMP to a new directory.
Nevertheless, I still cannot profile a Windows service. The process RedGat.Profiler.UI.exe is loading the CPU up to 50% and nothing happens.
Best regards,
Paulo -
Hmm, that sounds like it might be something new, then. ANTS should create a log file in the results directory: do there appear to be any errors reported in there?
Is the service already running when you try to start profiling? If so, you could try stopping it in the services manager to see if that fixes the problem.
Does the service appear to be running in task manager while ANTS is hung? It's possible it has launched but hasn't signalled that it has finished starting. ANTS will wait quite a long time for the service to finish starting and may appear to be hung during this time. There is an issue in RC0 that could cause some unexpected exceptions, which could in turn be affecting your service startup in some way (this will be fixed in the final release).
Can you monitor any performance counters for the service when it's running normally using perfmon? Some strange behaviour is possible if the registry entries for the performance counters has become corrupted.
Can you profile standard desktop applications without an issue? -
Hi Andrew!
See below my answers for your questions.
Best Regards,
Paulo
"do there appear to be any errors reported in there?"
No, there isn't any errors reported.
"Is the service already running when you try to start profiling?"
No, the service had been stopped before profiling.
"Does the service appear to be running in task manager while ANTS is hung?"
There is no indication in the task manager that the service is running.
"Can you monitor any performance counters for the service when it's running normally using perfmon?"
Yes, I can monitor any performance counters for the service.
"Can you profile standard desktop applications without an issue?"
Yes, I have no problem profiling standard desktop applications. -
Hi again,
Except for the service not starting, it sounds like everything is set up as it should be. I do have another couple of questions, though:
Can you profile another service? It doesn't matter if it's .NET or not, or a system service - the ANTS profiler service itself should do - does the profiler start it successfully? No performance counters will show until the service starts running .NET code, but ANTS should be able to start (or restart) any service.
Does your service have a display name that differs from the service name? This is something that is set in the service installer object. -
Hi Andrew!
I couldn't profile any other Windows service even simple services.
Also, I have tried services that have the same display and service names, but the profiler couldn't start the service and loaded the CPU.
Best,
Paulo -
Unfortunately, I'm not sure what can cause this at the moment. We just use the ServiceController class to stop and start the services, and something about your system's configuration is presumably interfering with it somehow. The timeout we apply to starting services is 5 minutes: does anything happen if you leave the profiler for that long, or does it continue to hang?
If you're on Vista, are you running ANTS as administrator? Running with reduced privileges will cause ANTS to be unable to start a service: however, when I try this I do get an error message reporting the problem. -
Hi Andrew!
I have figure out what is wrong with my environment.
As I am evaluating several profiler tools, one of them left the environment variable Cor_Profiler set to its own COM component CLSID and it seems that the ANTS 4 wasn't aware of it.
I suggest that ANTS 4 should recognize this kind of problem and alert that something is wrong instead of waiting forever without notice. By the way, I have waited longer than the 5 minutes that you have recommended and nothing happened.
Thanks for your help!
Paulo
Add comment
Please sign in to leave a comment.
I don't know if I am missing something, but I couldn't profile a Windows service application using ANTS Profiler 4.
The status bar displays the message "Starting service 'MyService'" and nothing happens. The service process doesn't get started.
Best regards,
Paulo