指定應用程式只用某幾顆 CPU

今天 SharePoint 莫名掛掉,然後發現是更新時多 CPU 彼此造成更新錯誤,照以下的說明

https://blogs.msdn.microsoft.com/spses/2015/05/12/sharepoint-2010-2013-an-exception-of-type-microsoft-sharepoint-administration-spupdatedconcurrencyexception-was-thrown-while-installing-an-update/

透過 PowerShell 語法解掉

$cmd="start "+""""" /affinity 1 "+"""C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\BIN\Psconfig.exe""" + " -cmd" +  " upgrade" + " -inplace" + " b2b" + " -wait"
cmd.exe /c $cmd

但意外發現 start 可以指定 cpu affinity,這比先前的問題還有趣,可以參照以下的 blog

https://blogs.msdn.microsoft.com/santhoshonline/2011/11/24/how-to-launch-a-process-with-cpu-affinity-set/

image

可以透過 Process Explorer

image

看到 CPU Affinity 真的是 2^0 + 2^4 = 11 (16進位)

image

One Comment

  1. Posted 2016 年 11 月 29 日 at 06:22:43 | Permalink | 回覆

    謝謝分享!

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 變更 )

Twitter picture

You are commenting using your Twitter account. Log Out / 變更 )

Facebook照片

You are commenting using your Facebook account. Log Out / 變更 )

Google+ photo

You are commenting using your Google+ account. Log Out / 變更 )

連結到 %s

%d 位部落客按了讚: