【问题标题】:VSPerf and Azure Cloud ServicesVSPerf 和 A​​zure 云服务
【发布时间】:2012-11-17 22:27:34
【问题描述】:

当我将云服务部署到 Windows Azure 时,它​​会导致许多 VSPerf.exe 实例启动 - 从 1 到 5。

在它们之间,它们消耗了所有 CPU,并且没有一个进程会自行终止。

如果我远程连接到实例并手动终止进程,它们会在下一个请求时重新启动。如果在请求期间进程终止,则请求成功,页面按预期显示和运行。

这与之前的部署的唯一区别是我已经升级到 .NET 4.5,因此将云服务升级到服务器 2012。

这可能是什么原因造成的?

更新

每次启动失败都会记录 2 个事件:

  • VsPerf Tool Error: Error starting data collection with a dedicated process D:\Program Files (x86)\Microsoft Visual Studio 11.0\Team Tools\Performance Tools\VSPerf.

  • .NET Runtime version 4.0.30319.18010 - Loading profiler failed during CoCreateInstance. Profiler CLSID: '{44a86cad-f7ee-429c-83eb-f3cde3b87b70}'. HRESULT: 0x80040111. Process ID (decimal): 1444. Message ID: [0x2504].

更新 2

创建新实例或重新映像计算机后不会出现 VSPerf 问题(至少目前是一个修复(一个烦人且耗时的修复)。

【问题讨论】:

  • 你能解决这个问题吗?我看到了同样的问题:/
  • 恐怕不行,每次部署后我都必须重新映像:(

标签: c# asp.net-mvc azure hosting


【解决方案1】:

检查 Visual Studio 中的 Azure 发布设置,我敢打赌您已在“高级”选项卡上启用了分析。

【讨论】:

  • 正确!非常感谢 - 我从没想过要看那里。讽刺的是,CPU 采样“以低开销监控 CPU 绑定应用程序”被选中!
  • 我也收到了。但是 CPU 采样不应占用 100% 的 CPU。这太疯狂了!
  • 我也有这个,不过CPU采样很有用,我不想去掉。
【解决方案2】:

同样的问题,VSPerf.exe 的 2 个进程在第二个角色实例上消耗 100% 的 CPU。 IIS 在该实例上变得无响应。 4 个月前我们遇到了完全相同的问题,当我们使用 MSFT 支持调试此问题时启用分析时“不知何故”消失了(MSFT 内部有人知道这个问题)。但由于无法重现问题(我们只有屏幕截图),它被丢弃了。

因为我在 5 分钟前再次看到它,并且由于 Azure SDK 2.0 可以轻松获取诊断日志(与 SDK 1.8 中的配置习惯不同),这里有一些有用的东西可以让下一个人理解

核心错误是Application VsPerf Tool Error: Error starting data collection with a dedicated process D:\Program Files (x86)\Microsoft Visual Studio 11.0\Team Tools\Performance Tools\VSPerf.,详细日志(4 个条目)如下。有趣的是,我有 2 个 VSPerf.exe 进程燃烧 100% 的 CPU,并且还有 2 个日志条目....

{555908d1-a6d7-4695-8e1e-26931d2012f4}  Service Control Manager 7011    System  A timeout (30000 milliseconds) was reached while waiting for a transaction response from the iphlpsvc service.  <Event xmlns='http://schemas.microsoft.com/win/2004/08/events/event'><System><Provider Name='Service Control Manager' Guid='{555908d1-a6d7-4695-8e1e-26931d2012f4}' EventSourceName='Service Control Manager'/><EventID Qualifiers='49152'>7011</EventID><Version>0</Version><Level>2</Level><Task>0</Task><Opcode>0</Opcode><Keywords>0x8080000000000000</Keywords><TimeCreated SystemTime='2013-06-23T17:37:25.557218700Z'/><EventRecordID>1269</EventRecordID><Correlation/><Execution ProcessID='520' ThreadID='1104'/><Channel>System</Channel><Computer>RD00155DA909B8</Computer><Security/></System><EventData><Data Name='param1'>30000</Data><Data Name='param2'>iphlpsvc</Data></EventData></Event>   WebApp_IN_1 6/23/2013 5:37 PM   2   520 1104
{555908d1-a6d7-4695-8e1e-26931d2012f4}  Service Control Manager 7011    System  A timeout (30000 milliseconds) was reached while waiting for a transaction response from the Schedule service.  <Event xmlns='http://schemas.microsoft.com/win/2004/08/events/event'><System><Provider Name='Service Control Manager' Guid='{555908d1-a6d7-4695-8e1e-26931d2012f4}' EventSourceName='Service Control Manager'/><EventID Qualifiers='49152'>7011</EventID><Version>0</Version><Level>2</Level><Task>0</Task><Opcode>0</Opcode><Keywords>0x8080000000000000</Keywords><TimeCreated SystemTime='2013-06-23T17:37:56.259560100Z'/><EventRecordID>1270</EventRecordID><Correlation/><Execution ProcessID='520' ThreadID='1104'/><Channel>System</Channel><Computer>RD00155DA909B8</Computer><Security/></System><EventData><Data Name='param1'>30000</Data><Data Name='param2'>Schedule</Data></EventData></Event>   WebApp_IN_1 6/23/2013 5:37 PM   2   520 1104
00000000-0000-0000-0000-000000000000    VSPERF  4100    Application VsPerf Tool Error: Error starting data collection with a dedicated process D:\Program Files (x86)\Microsoft Visual Studio 11.0\Team Tools\Performance Tools\VSPerf. <Event xmlns='http://schemas.microsoft.com/win/2004/08/events/event'><System><Provider Name='VSPERF'/><EventID Qualifiers='57635'>4100</EventID><Level>2</Level><Task>0</Task><Keywords>0x80000000000000</Keywords><TimeCreated SystemTime='2013-06-23T17:40:37.000000000Z'/><EventRecordID>266</EventRecordID><Channel>Application</Channel><Computer>RD00xxxxxxxxx</Computer><Security/></System><EventData><Data>Error starting data collection with a dedicated process D:\Program Files (x86)\Microsoft Visual Studio 11.0\Team Tools\Performance Tools\VSPerf.</Data></EventData></Event> WebApp_IN_1 6/23/2013 5:40 PM   2   0   0
00000000-0000-0000-0000-000000000000    VSPERF  4100    Application VsPerf Tool Error: Error starting data collection with a dedicated process D:\Program Files (x86)\Microsoft Visual Studio 11.0\Team Tools\Performance Tools\VSPerf. <Event xmlns='http://schemas.microsoft.com/win/2004/08/events/event'><System><Provider Name='VSPERF'/><EventID Qualifiers='57635'>4100</EventID><Level>2</Level><Task>0</Task><Keywords>0x80000000000000</Keywords><TimeCreated SystemTime='2013-06-23T17:40:41.000000000Z'/><EventRecordID>267</EventRecordID><Channel>Application</Channel><Computer>RD00xxxxxxxxx</Computer><Security/></System><EventData><Data>Error starting data collection with a dedicated process D:\Program Files (x86)\Microsoft Visual Studio 11.0\Team Tools\Performance Tools\VSPerf.</Data></EventData></Event> WebApp_IN_1 6/23/2013 5:40 PM   2   0   0

【讨论】:

    【解决方案3】:

    我发现最接近解决方法的是创建启动任务

    <Task commandLine="VSPerf.cmd" executionContext="elevated" taskType="background" />
    

    VSPerf.cmd 是一个简单的启动器

    PowerShell -ExecutionPolicy Unrestricted .\VSPerf.ps1
    exit /B 0
    

    对于试图杀死过度活跃的 VSPerf 实例的 PowerShell 脚本:

    function Restart-VSPerf {
        $procs = (
            gwmi -Query "SELECT IDProcess,PercentProcessorTime FROM Win32_PerfFormattedData_PerfProc_Process WHERE Name='vsperf' AND PercentProcessorTime > 25" |
            Foreach-Object { $_pid = $_.IDProcess ; gwmi -Query "SELECT Handle,CommandLine FROM win32_process WHERE Name='vsperf.exe' AND Handle=$_pid" | Select-Object Handle, CommandLine }
        )
        if ($procs) {
            # Get VSPerf path.
            # NB The regex uses conditional matching with an expression, as described in https://msdn.microsoft.com/en-us/library/36xybswe.aspx
            # to ensure that a single capturing group gets the contents of quoted arguments and unquoted arguments.
            $regex = [regex] '^(("?)((?(?<=")[^"]*|[^"\s]*))\2(\s+|$))+$'
            $vsperf = $regex.Match($procs[0].CommandLine).Groups[3].Captures[0].Value
    
            & $vsperf /detach
    
            # Kill
            $procs | Foreach-Object { Stop-Process -Force -Id $_.Handle }
    
            # Restart
            Start-Sleep -s 1
            $procs | Foreach-Object {
                $_args = ($regex.Match($_.CommandLine).Groups[3].Captures[1..99] |  Select-Object -ExpandProperty Value)
                Start-Process $vsperf -ArgumentList "$_args"
            }
        }
    }
    
    while (1) {
        Start-Sleep -s 180
        Restart-VSPerf
    }
    

    它有时会起作用,但并非总是如此。欢迎提出可靠性改进建议。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-11-10
      • 2017-12-13
      • 1970-01-01
      • 2017-01-13
      • 1970-01-01
      • 1970-01-01
      • 2020-04-10
      相关资源
      最近更新 更多