【问题标题】:How Can I Improve System Performance in Ubuntu?如何在 Ubuntu 中提高系统性能?
【发布时间】:2022-01-20 19:32:11
【问题描述】:

自从我安装 Ubuntu 操作系统已经过去了好几年。在系统上安装了一些需要高性能的应用程序(如 MATLAB、MySQL、Blender、GIMP)后,我注意到系统性能随着时间的推移而下降。

我最近一直专注于数据科学、人工智能和机器学习,并且一直在使用像 Kubeflow 这样的工具集。在测试我开发的软件时,我意识到系统性能下降,并且我无法创建必要的隔离环境来正确评估并行运行的 AI 应用程序的结果。

有没有办法在 Ubuntu 操作系统中提高系统性能?我需要开发什么解决方案?

【问题讨论】:

    标签: linux performance ubuntu service artificial-intelligence


    【解决方案1】:

    出现这种情况的原因是与您之前在系统上安装但未卸载的应用程序相关的服务在系统启动时会自动启动。

    例如,当您安装 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
    

    建议

    如果系统中运行的应用程序过多,请关闭您不使用的应用程序(服务、单元)。此外,禁用您不使用并在后台运行的应用程序。

    【讨论】:

      猜你喜欢
      • 2010-09-13
      • 1970-01-01
      • 2019-08-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多