我真的很惱火,即使我有足夠的 RAM 和 CPU 可以利用,但一次無法完成幾項工作 - 所以這是磁碟使用情況,例如當我使用 WinRAR 或其他磁碟提取大檔案時 -寫飢餓的東西。
我希望能夠限制這一點,假設為 20%,因此 WinRAR 最多只會使用磁碟寫入能力的 20%,這應該會導致
“即使我正在解壓一個大檔案,我的作業系統也不再掛起,並且能夠執行多任務”
在執行此類磁碟密集型工作時。
如果您知道如何透過應用程式限制磁碟的 I/O,那麼這將非常有幫助!
我的作業系統:Windows 7 Ultimate x64。我嘗試設定進程親和力和優先級,但沒有運氣。
答案1
在流程瀏覽器,除了常規的Normal 8
,Below normal 6
,Idle 4
優先級之外,還有一個附加Background 4
級別,它表示它有Low I/O and Memory Priority
。根據對應的欄位Background 4
得出I/O 優先權。Very Low
這應該可以實現你想要的。
我相信它可以在 Vista 及以上版本中使用,因為維基百科建議然後新增了 I/O 優先權。
從您的評論來看,您似乎也想從命令列執行此操作。我不確定 Process Explorer 中是否可用,但是Ps工具在這方面可能有一些有用的東西。我知道PsExec
可以讓您啟動低優先順序的進程。如果沒有,那麼編寫命令列程式或腳本來設定正在運行的進程的優先權應該不會太困難。
答案2
@AlexandrZarubkin 的評論應該受到更多關注。指向a的指針俄文論壇 habr.com有很大幫助。特羅特爾製作了一個註冊表文件,允許在資源管理器中右鍵單擊啟動可執行文件時永久更改優先級:
該文字應儲存為.reg
檔案並匯入到 Windows 註冊表中:
Windows Registry Editor Version 5.00
;Copyright 2016 Trottle
;This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3.
;This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
;See <http://www.gnu.org/licenses/> for more details.
[-HKEY_CLASSES_ROOT\exefile\shell\Bpc]
[HKEY_CLASSES_ROOT\exefile\shell\Bpc]
"HasLUAShield"=""
"MUIVerb"="Set base priority"
"subcommands"=""
[HKEY_CLASSES_ROOT\exefile\shell\Bpc\shell\01low]
"MUIVerb"="Idle CPU, lowest IO, low paging"
"Icon"="comres.dll,9"
[HKEY_CLASSES_ROOT\exefile\shell\Bpc\shell\01low\command]
@="cmd /q /c echo Windows Registry Editor Version 5.00>%%TEMP%%\\pr.reg & echo.>>%%TEMP%%\\pr.reg & for /f \"delims=<\" %%i in (\"%1\") do echo [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options\\%%~nxi\\PerfOptions]>>%%TEMP%%\\pr.reg & echo.>>%%TEMP%%\\pr.reg & echo \"CpuPriorityClass\"=dword:00000001>>%%TEMP%%\\pr.reg & echo.>>%%TEMP%%\\pr.reg & echo \"IoPriority\"=dword:00000000>>%%TEMP%%\\pr.reg & echo.>>%%TEMP%%\\pr.reg & echo \"PagePriority\"=dword:00000001>>%%TEMP%%\\pr.reg & regedit /s %%TEMP%%\\pr.reg & del %%TEMP%%\\pr.reg & msg * %~ni priority is set to IDLE"
[HKEY_CLASSES_ROOT\exefile\shell\Bpc\shell\02below]
"MUIVerb"="Below normal CPU, low IO"
"Icon"="comres.dll,12"
[HKEY_CLASSES_ROOT\exefile\shell\Bpc\shell\02below\command]
@="cmd /q /c echo Windows Registry Editor Version 5.00>%%TEMP%%\\pr.reg & echo.>>%%TEMP%%\\pr.reg & for /f \"delims=<\" %%i in (\"%1\") do echo [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options\\%%~nxi\\PerfOptions]>>%%TEMP%%\\pr.reg & echo.>>%%TEMP%%\\pr.reg & echo \"CpuPriorityClass\"=dword:00000005>>%%TEMP%%\\pr.reg & echo.>>%%TEMP%%\\pr.reg & echo \"IoPriority\"=dword:00000001>>%%TEMP%%\\pr.reg & echo.>>%%TEMP%%\\pr.reg & echo \"PagePriority\"=->>%%TEMP%%\\pr.reg & regedit /s %%TEMP%%\\pr.reg & del %%TEMP%%\\pr.reg & msg * %~ni priority is set to BELOW NORMAL"
[HKEY_CLASSES_ROOT\exefile\shell\Bpc\shell\03above]
"Icon"="comres.dll,8"
"MUIVerb"="Above normal CPU"
[HKEY_CLASSES_ROOT\exefile\shell\Bpc\shell\03above\command]
@="cmd /q /c echo Windows Registry Editor Version 5.00>%%TEMP%%\\pr.reg & echo.>>%%TEMP%%\\pr.reg & for /f \"delims=<\" %%i in (\"%1\") do echo [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options\\%%~nxi\\PerfOptions]>>%%TEMP%%\\pr.reg & echo.>>%%TEMP%%\\pr.reg & echo \"CpuPriorityClass\"=dword:00000006>>%%TEMP%%\\pr.reg & echo.>>%%TEMP%%\\pr.reg & echo \"IoPriority\"=->>%%TEMP%%\\pr.reg & echo.>>%%TEMP%%\\pr.reg & echo \"PagePriority\"=->>%%TEMP%%\\pr.reg & regedit /s %%TEMP%%\\pr.reg & del %%TEMP%%\\pr.reg & msg * %~ni priority is set to ABOVE NORMAL"
[HKEY_CLASSES_ROOT\exefile\shell\Bpc\shell\04high]
"MUIVerb"="High CPU"
"Icon"="comres.dll,16"
"CommandFlags"=dword:00000040
[HKEY_CLASSES_ROOT\exefile\shell\Bpc\shell\04high\command]
@="cmd /q /c echo Windows Registry Editor Version 5.00>%%TEMP%%\\pr.reg & echo.>>%%TEMP%%\\pr.reg & for /f \"delims=<\" %%i in (\"%1\") do echo [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options\\%%~nxi\\PerfOptions]>>%%TEMP%%\\pr.reg & echo.>>%%TEMP%%\\pr.reg & echo \"CpuPriorityClass\"=dword:00000003>>%%TEMP%%\\pr.reg & echo.>>%%TEMP%%\\pr.reg & echo \"IoPriority\"=->>%%TEMP%%\\pr.reg & echo.>>%%TEMP%%\\pr.reg & echo \"PagePriority\"=->>%%TEMP%%\\pr.reg & regedit /s %%TEMP%%\\pr.reg & del %%TEMP%%\\pr.reg & msg * %~ni priority is set to HIGH"
[HKEY_CLASSES_ROOT\exefile\shell\Bpc\shell\06ask]
"MUIVerb"="Show current priorities"
"Icon"="shell32.dll,23"
[HKEY_CLASSES_ROOT\exefile\shell\Bpc\shell\06ask\command]
@="cmd /q /c for /f \"delims=<\" %%i in (\"%1\") do reg query \"HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options\\%%~nxi\\PerfOptions\" /s | msg *"
[HKEY_CLASSES_ROOT\exefile\shell\Bpc\shell\07default]
"MUIVerb"="Restore to default"
"Icon"="comres.dll,4"
[HKEY_CLASSES_ROOT\exefile\shell\Bpc\shell\07default\command]
@="cmd /q /c echo Windows Registry Editor Version 5.00>%%TEMP%%\\pr.reg & echo.>>%%TEMP%%\\pr.reg & for /f \"delims=<\" %%i in (\"%1\") do echo [-HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options\\%%~nxi\\PerfOptions]>>%%TEMP%%\\pr.reg & regedit /s %%TEMP%%\\pr.reg & del %%TEMP%%\\pr.reg & msg * %~ni priority is restored to default"
; If you do not want to have uninstaller you can skip next part:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\BpcSubMenu]
"DisplayName"="'Set base priority' submenu"
"DisplayIcon"="imageres.dll,73"
"UninstallString"="cmd /q /c echo Windows Registry Editor Version 5.00>%TEMP%\\pr.reg & echo.>>%TEMP%\\pr.reg & echo [-HKEY_CLASSES_ROOT\\exefile\\shell\\Bpc]>>%TEMP%\\pr.reg & echo.>>%TEMP%\\pr.reg & echo [-HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\BpcSubMenu]>>%TEMP%\\pr.reg & regedit /s %TEMP%\\pr.reg & del %TEMP%\\pr.reg"
"DisplayVersion"="1.1"
"URLInfoAbout"="http://habrahabr.ru/post/317802/"
"NoModify"=dword:00000001
"NoRepair"=dword:00000001
優先值列表
IoPriority Value Priority
0 Very Low
1 Low
2 Normal
3 High
4 Critical (only for memory io)
PagePriority Value Priority
0 Idle
1 Very Low
2 Low
3 Background
4 Background
5 Normal