Wie kann die Festplattennutzung (Schreiben/E/A) durch die Anwendung begrenzt werden? (NICHT die Speicherplatznutzung)

Wie kann die Festplattennutzung (Schreiben/E/A) durch die Anwendung begrenzt werden? (NICHT die Speicherplatznutzung)

Es ärgert mich wirklich, dass ich mehrere Jobs nicht gleichzeitig erledigen kann, obwohl ich noch viel RAM und CPU übrig habe – es liegt also an der Festplattennutzung, wenn ich beispielsweise große Archive mit WinRAR oder anderen Programmen extrahiere, die viel Speicherplatz auf der Festplatte benötigen.

Ich möchte dies auf 20% begrenzen können, sodass WinRAR nur 20% der Schreibkapazität meiner Festplatte nutzt, was zu folgendem Ergebnis führen sollte:

„Keine Hänger mehr bei meinem Betriebssystem und die Möglichkeit zum Multitasking, selbst wenn ich ein großes Archiv entpacke“

bei der Ausführung solcher datenträgerintensiver Jobs.

Wenn Sie wissen, wie Sie den E/A einer Festplatte nach Anwendung begrenzen, ist das eine große Hilfe!

Mein Betriebssystem: Windows 7 Ultimate x64. Ich habe versucht, Prozessaffinität und -priorität einzustellen, aber ohne Erfolg.

Antwort1

InProcess Explorer, zusätzlich zur regulären Normal 8, Below normal 6, Idle 4Prioritätsstufe gibt es eine zusätzliche Background 4Stufe, die besagt, dass sie Low I/O and Memory Priority. Background 4Ergebnisse in Very LowE/A-Priorität hat, entsprechend der entsprechenden Spalte. Damit sollte das gewünschte Ergebnis erzielt werden.

Ich glaube, es ist in Vista und höher verfügbar, wieWikipedia schlägt vordass damals eine I/O-Priorisierung hinzugefügt wurde.

Aus Ihrem Kommentar geht hervor, dass Sie dies auch über die Befehlszeile tun möchten. Ich bin nicht sicher, ob dies im Process Explorer verfügbar ist, aberPsToolskönnte diesbezüglich etwas Nützliches haben. Ich weiß, PsExecdass Sie damit Prozesse mit niedriger Priorität starten können. Falls nicht, sollte es nicht allzu schwierig sein, ein Befehlszeilenprogramm oder Skript zu erstellen, um die Priorität eines laufenden Prozesses festzulegen.

Antwort2

Der Kommentar von @AlexandrZarubkin sollte mehr Aufmerksamkeit erhalten. Der Zeiger auf eineRussischsprachiges Forum habr.comhilft sehr.Gas gebenhat eine Registrierungsdatei erstellt, die es ermöglicht, die Priorität dauerhaft zu ändern, wenn eine ausführbare Datei per Rechtsklick im Explorer gestartet wird: Ausführbare Windows-Datei -> Basispriorität festlegen -> Unterdurchschnittliche CPU, niedrige IO

Dieser Text soll als .regDatei gespeichert und in die Windows-Registrierung importiert werden:

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

Prioritätswerteliste

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

verwandte Informationen