Author |
Topic |
bertcord
Starting Member
7 Posts |
Posted - 2005-09-21 : 10:50:04
|
I would like to save performance information using perfmon.exe using the CounterLogs functionality. I am currently running a clustered SQL2000 SP4 machine running on Windows 2003 Advanced x64. When starting perfmon.exe I noticed that the SQL counters are not available, after some messing around I found another copy of perfmon.exe in C:\WINDOWS\SysWOW64\perfmon.exe. If I start this executable I can now see the SQL Server performance counters. And can interactively watch performance. The problem arises when I attempt to create a CounterLog. I can create the counter log and add the SQLServer counters but it does not log the SQLCounters. Looking in the event log I get the following messages The service was unable to add the counter '\\BEDB3\SQLServer:General Statistics\User Connections' to the test log or alert. This log or alert will continue, but data for that counter will not be collected. The error returned is: The specified object is not found on the system. Anyone know how to get this working? Bert |
|
eyechart
Master Smack Fu Yak Hacker
3575 Posts |
Posted - 2005-09-21 : 12:09:33
|
I'll test this when I get in to work today. I've noticed a few problems like this when running 32bit software (like SQL Server) in the 64bit environment.-ec |
 |
|
bertcord
Starting Member
7 Posts |
Posted - 2005-09-25 : 10:52:28
|
did you get a chance to check this out. ? Anyone else figure out how to do this?ThanksBert |
 |
|
eyechart
Master Smack Fu Yak Hacker
3575 Posts |
Posted - 2005-10-03 : 14:40:33
|
I get the same error. I'm going to look into this a bit more.-ec |
 |
|
eyechart
Master Smack Fu Yak Hacker
3575 Posts |
Posted - 2005-10-03 : 15:36:51
|
I think you have found a bug in how the perfmon works in the x64 environment.check this article from sysinternals http://www.sysinternals.com/blog/2005/09/multi-platform-images.html. Also, read the comments at the bottom. I used tools from this article (filemon and process explorer) to try and determine what is going on.it looks like the 32bit perfmon kicks off the 64bit smlogsvc.exe process instead of the 32bit version found in SYSWOW64. This returns an error of course, because the 32bit SQL counters are only available to be seen by the 32bit versions of perfmon and smlogsvc. btw, there is in fact a smlogsvc.exe in the syswow64 directory, it just isn't called properly.I'll open a ticket with microsoft on this.-ecEDIT:I have submitted a ticket to microsoft. I'll update this thread with any new information. |
 |
|
eyechart
Master Smack Fu Yak Hacker
3575 Posts |
Posted - 2005-10-12 : 19:46:25
|
this has been filed as a bug (#472556 if I understood correctly)The problem is as I suspected, the 32bit version of perfmon spawns a 64bit application (smlogsvc.exe) when you use the counterlogs functionality. This fails because the 32bit counters are not accessable from 64bit apps. It incorrectly runs the 64bit version of smlogsvc.exe even though there is a 32bit version in the SySWOW64 directory.You can clearly see this by performing a filemon trace while you attempt to start the counterlog trace (sysinternals rules btw).At this point there is no hotfix to resolve the problem, although it was suggested that we could use the command line tool typeperf as a workaround (see the docs here for examples http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/nt_command_typeperf.mspx)HTH-ec |
 |
|
bertcord
Starting Member
7 Posts |
Posted - 2005-10-18 : 11:38:29
|
Thanks alot...just realized you had posted a response....Now we just need MS to fix it....Are you going to SQL Connections in Vegas...I owe you a drink.Thanks againBert |
 |
|
eyechart
Master Smack Fu Yak Hacker
3575 Posts |
Posted - 2005-10-18 : 12:42:08
|
quote: Originally posted by bertcord Thanks alot...just realized you had posted a response....Now we just need MS to fix it....Are you going to SQL Connections in Vegas...I owe you a drink.Thanks againBert
I have requested a hotfix, so we will see what happens. MS has also tried to contact me regarding another workaround, but I was out of the office. I don't yet have the details on what this might be, but hopefully sometime today I can touch base with the tech and see what he has in mind. I'll post here with any new information.re: SQL Connections, not going to be there unfortunately :(-ec |
 |
|
bertcord
Starting Member
7 Posts |
Posted - 2006-01-11 : 19:00:09
|
The workaroudn that I am using for this is as follows1) Stop the Performance Logs & Alerts service from services.msc2) Open up the registry editor (regedit.exe), browse down to HKLM\System\CurrentControlSet\Services\Sysmonlog.3) Change the ImagePath from the default value to %SystemRoot%\syswow64\smlogsvc.exe.( This would launch the 32-bit service on starting the Counter logs)4) Open the 32-bit Perfmon from Start - Run - %SystemRoot%\syswow64\perfmon.exe, & add the SQL counter objects to a Counter log.5) Set the various parameters of the Counter log, & start it to collect the data. |
 |
|
eyechart
Master Smack Fu Yak Hacker
3575 Posts |
Posted - 2007-01-24 : 21:59:51
|
I never updated this thread with the official word from Microsoft. here is the email I got from PSS regarding this issue. Pretty much the same as Bert had posted earlier.quote: Following are the steps that could resolve the issue of “Unable to set 32-bit SQL counter objects in Counter logs in 32-bit Perfmon”1) Stop the Performance Logs & Alerts service from services.msc2) Open up the registry editor (regedit.exe), browse down to HKLM\System\CurrentControlSet\Services\Sysmonlog.3) Change the ImagePath from the default value to %SystemRoot%\syswow64\smlogsvc.exe.( This would launch the 32-bit service on starting the Counter logs)4) Open the 32-bit Perfmon from Start – Run - %SystemRoot%\syswow64\perfmon.exe, & add the SQL counter objects to a Counter log.5) Set the various parameters of the Counter log, & start it to collect the data. P.S: Please backup the registry before you attempt any modifications.
-ec |
 |
|
bfos7215
Starting Member
9 Posts |
Posted - 2007-01-25 : 09:48:15
|
Quick question that isn't too important:What is the folder SYSWOW64 supposed to be for? It kind of threw me off for a second, because the name made me think that it was a folder for 64-bit. |
 |
|
eyechart
Master Smack Fu Yak Hacker
3575 Posts |
Posted - 2007-01-25 : 11:21:41
|
quote: Originally posted by bfos7215 Quick question that isn't too important:What is the folder SYSWOW64 supposed to be for? It kind of threw me off for a second, because the name made me think that it was a folder for 64-bit.
SYSWOW64 holds the 32bit versions of software located in SYSTEM32 folder. I know, it is backwards and confusing.So, if you wanted to capture the SQL 2000 32bit performance counters, you would need to run the perfmon located in SYSWOW64. If you run the regular perfmon (by typing perfmon at the RUN line or a command prompt) you will actually run the 64bit version - which will not be able to see the 32bit SQL counters.-ec |
 |
|
bfos7215
Starting Member
9 Posts |
Posted - 2007-01-25 : 13:22:58
|
OK, this still isn't completely working.I made the registry change, but I still can't seem to have the log file saved to a SQL Server as I'd like. I get the following error:The service was unable to open the log file SQL:DEV_system_admin!DEV_Counters_000028 for log DEV_Counters and will be stopped. Check the log folder for existence, spelling, permissions, and ensure that no other logs or applications are writing to this log file. You can reenter the log file name using the configuration program. This log will not be started. The error returned is: The returned data is valid.If I save it to a binary file I don't get the error. I've tried using both the 64-bit and 32-bit version of perf-mon to start the counter log and i get the same error both times.One difference, is that on the 32-bit version, the only system DSN I can choose is "LocalServer", while I get the actual system DSN's i have on the server to choose from when I run the 64-bit version. But, I get the same error when I start the log from both versions. |
 |
|
eyechart
Master Smack Fu Yak Hacker
3575 Posts |
Posted - 2007-01-25 : 14:31:08
|
quote: Originally posted by bfos7215 OK, this still isn't completely working.I made the registry change, but I still can't seem to have the log file saved to a SQL Server as I'd like. I get the following error:The service was unable to open the log file SQL:DEV_system_admin!DEV_Counters_000028 for log DEV_Counters and will be stopped. Check the log folder for existence, spelling, permissions, and ensure that no other logs or applications are writing to this log file. You can reenter the log file name using the configuration program. This log will not be started. The error returned is: The returned data is valid.If I save it to a binary file I don't get the error. I've tried using both the 64-bit and 32-bit version of perf-mon to start the counter log and i get the same error both times.One difference, is that on the 32-bit version, the only system DSN I can choose is "LocalServer", while I get the actual system DSN's i have on the server to choose from when I run the 64-bit version. But, I get the same error when I start the log from both versions.
you did all 5 steps right?-ec |
 |
|
bfos7215
Starting Member
9 Posts |
Posted - 2007-01-25 : 15:23:50
|
quote: Originally posted by eyechartyou did all 5 steps right?-ec
Yah. If I save it to a file, it logs the 32-bit counters. It just errors when trying to save it to a SQL Server.And, the error before completing the 5 steps, was about not being able to add each 32-bit counter to the log. Now, the error is on opening the log file for SQL Server. |
 |
|
eyechart
Master Smack Fu Yak Hacker
3575 Posts |
Posted - 2007-01-25 : 15:46:44
|
quote: Originally posted by bfos7215Yah. If I save it to a file, it logs the 32-bit counters. It just errors when trying to save it to a SQL Server.And, the error before completing the 5 steps, was about not being able to add each 32-bit counter to the log. Now, the error is on opening the log file for SQL Server.
ok, I see. I just save the counterlog to disk and not to SQL, so I never ran across that problem. -ec |
 |
|
bfos7215
Starting Member
9 Posts |
Posted - 2007-01-25 : 16:14:20
|
What format do you recommend saving, if you save to file?I still want to figure a way to get it saved to SQL, so the data can be queried and summarized, but I'm just curious how you do it. |
 |
|
eyechart
Master Smack Fu Yak Hacker
3575 Posts |
Posted - 2007-01-25 : 16:29:18
|
I just use the standard binary log format. -ec |
 |
|
bfos7215
Starting Member
9 Posts |
|
|