自從我安裝 Ubuntu 作業系統以來已經過去了很多年。在系統上安裝了一些對性能要求較高的應用程式(如MATLAB、MySQL、Blender、GIMP)后,我注意到系統性能隨著時間的推移而惡化。
我最近一直專注于資料科學、人工智能和機器學習,我一直在使用Kubeflow 之類的工具集。在測驗我開發的軟體時,我意識到系統性能下降,我無法創建必要的隔離環境來正確評估并行運行的 AI 應用程式的結果。
有沒有辦法在 Ubuntu 作業系統中提高系統性能?我需要開發什么解決方案?
uj5u.com熱心網友回復:
出現這種情況的原因是與您之前在系統上安裝但未卸載的應用程式相關聯的服務在啟動時自動啟動。
例如,當您安裝 MySQL Server 時,系統啟動時會自動啟動 MySQL Server 相關的服務。如果你使用的系統是作為實驗室使用的,我認為沒有必要在每次系統啟動時自動運行 MySQL Server 相關服務。當你想使用 MySQL 服務器時,你可以手動啟動 MySQL 服務器相關的服務。
要管理服務,請按照以下步驟操作。
1. 上市服務
# Finding services started at boot
service --status-all
# Listing services started at boot
initctl list
# Listing services (systemd is available in Ubuntu, `systemctl` command active)
sudo systemctl list-unit-files --state=enabled
2. 減少 CPU 負載
可以preload用來安裝常用的應用程式。preload是在后臺運行并分析經常運行的應用程式的守護行程。
# Installing `Preload`
sudo apt-get install -y preload
3. 管理服務
systemd啟動、停止、啟用和禁用“單位”。我們將使用Hddtemp程式來測驗管理服務。
# Installing The Hddtemp
sudo apt-get install hddtemp
# Starting The Hddtemp
sudo systemctl start hddtemp.service
# Restarting The Hddtemp
sudo systemctl restart hddtemp
# Stop The Hddtemp
sudo systemctl stop hddtemp
# Get More Information About A Service
sudo systemctl status hddtemp
4. 管理應用程式(重啟)
# Initialize at boot of the volume
sudo systemctl enable hddtemp
# Both activating and initializing a volume
sudo systemctl enable --now unit
# Disabling a volume
sudo systemctl disable hddtemp
# Find out if a volume is active
sudo systemctl is-enabled unit
五、建議
如果系統中運行的應用程式過多,請關閉您不使用的應用程式(服務、單元)。此外,禁用您不使用并在后臺運行的應用程式。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/387553.html
