Linux에서 TLP로 노트북 배터리 수명을 최적화하는 방법
There are quite a few tools exists to power saving and battery life extension in Laptops. We already have looked at two tools namely Laptop Mode Tools and Powertop that improves the Linux Laptop battery performance. Today we will discuss yet another Laptop power management utility named TLP. TLP is a feature-rich commandline tool to optimize Laptop battery life in Linux.
Table of Contents
What is TLP?
TLP is an advanced power management tool for Linux. Its goal is to improve battery life on laptops running Linux without the need for complex configurations.
TLP requires zero configuration. TLP comes with a default configuration that's already optimized for battery life. It implements Powertop's recommendations out of the box. So users can simply install it and forget about it.
Some of the things TLP handles include:
- Power source-dependent configuration (whether you're running on battery or AC power)
- Processor frequency scaling including "turbo boost" / "turbo core"
- Power-saving settings for your hard disk or SSD
- Runtime power management for PCI(e) bus devices
- Wi-Fi power saving mode
- And more.
TLP will apply these settings automatically depending on your power source. It's a great tool for Linux laptop users who want to maximize their battery life with minimal hassle.
TLP takes care of everything. Even though TLP's default settings are just enough to provide optimal battery life, it is highly customizable to fulfill a specific requirement.
Install TLP in Linux
TLP is packaged for many Linux distributions including Arch Linux, Debian, Fedora, Gentoo, openSUSE and Ubuntu.
To install TLP in Arch Linux and its variants, run:
$ sudo pacman -S tlp tlp-rdw
If you're using Thinkpad, you need to install any one of the following packages. If you don't know exactly which package to install, run tlp-stat -b command as sudo or root user. It will guide you which package to install.
- acpi_call-lts (Community) – This is an optional external kernel module for the LTS kernel. It provides battery recalibration for ThinkPad models from the year 2011 onwards, such as the T420/X220 and newer models.
- tp_smapi (Community) – This is an optional external kernel module. It provides battery charge thresholds and recalibration for ThinkPads made before the year 2011. It also provides specific tlp-stat -b output for models made until the year 2011.
- tp_smapi-lts (Community) – This is optional. Use it instead of tp_smapi when the LTS kernel is installed.
Install the appropriate package using your preferred package manager or with the following command:
$ sudo pacman -S acpi_call
Replace acpi_call with acpi_call-lts, tp_smapi or tp_smapi-lts where suitable.
On Debian:
$ sudo apt install tlp tlp-rdw
If you are using any Thinkpad model Laptops, you may need to install any one of the following packages. The output of tlp-stat -b will guide you which package to install.
- acpi-call-dkms (main) – This is an optional external kernel module that provides battery recalibration for ThinkPad models from the year 2011 onwards, such as the T420/X220 and newer.
- tp-smapi-dkms (main) – This is an optional external kernel module. It provides battery charge thresholds and recalibration for ThinkPads made before the year 2011. It also provides specific tlp-stat -b output for models made until the year 2011.
Install the appropriate package using your preferred package manager or with the following command:
$ sudo apt install acpi-call-dkms
Replace 'acpi-call-dkms' with 'tp-smapi-dkms' as needed.
On Fedora:
$ sudo dnf install tlp tlp-rdw
If you use any Thinkpad model Laptops, install any one of the following packages. The dependencies of following packages are not available in the default repositories. So, first enable RPM Fusion repository in Fedora and then install the appropriate packages. If you don't know which package to install, run tlp-stat -b command as sudo or root user.
- kernel-devel (Fedora repo) – This is required to build the kernel module from the akmod package.
- akmod-tp_smapi (ThinkPad Extras repo) – This is an optional external kernel module source that provides battery charge thresholds and recalibration.
On openSUSE:
$ sudo zypper install tlp tlp-rdw
For Thinkpads, install the appropriate packages.
- acpi_call – This is an optional external kernel module that provides battery recalibration for ThinkPad models from the year 2011 onwards, such as the T420/X220 and newer.
- tp_smapi – This is an optional external kernel module. It provides battery charge thresholds and recalibration for ThinkPads made before the year 2011. It also provides specific tlp-stat -b output for models made until the year 2011.
On Ubuntu:
To install TLP in Ubuntu and its derivatives, add the TLP official PPA:
$ sudo add-apt-repository ppa:linrunner/tlp
And install TLP using command:
$ sudo apt install tlp tlp-rdw
For Thinkpad Laptops, install the appropriate packages:
- acpi-call-dkms (PPA or universe) – This is an optional external kernel module that provides battery recalibration for ThinkPad models from the year 2011 onwards, such as the T420/X220 and newer.
- tp-smapi-dkms (universe) – This is an optional external kernel module. It provides battery charge thresholds and recalibration for ThinkPads made before the year 2011. It also provides specific tlp-stat -b output for models made until the year 2011.
You can install the appropriate package either using your preferred package manager or with the following command:
$ sudo apt install acpi-call-dkms
If necessary, replace 'acpi-call-dkms' with 'tp-smapi-dkms'.
Again if you don't know which package to install, run tlp-stat -b command as sudo or root.
Enable and start TLP service
After installing TLP on your Linux machine, make sure it is enabled on startup and start the service using commands:
$ sudo systemctl enable tlp.service
$ sudo systemctl start tlp.service
You should also mask the following services to avoid conflicts and assure proper operation of TLP's Radio Device Switching options:
$ sudo systemctl mask systemd-rfkill.service
$ sudo systemctl mask systemd-rfkill.socket
Optimize Laptop Battery Life with TLP in Linux
As I already mentioned, TLP requires NO configuration. It works out of the box! The default settings are well optimized for better Laptop battery life. You can view these default settings in the TLP default configuration file, which is located at /etc/tlp.conf.
To view the current TLP configurion, system information, active power saving settings and battery data, run:
$ sudo tlp-stat
Sample output:
--- TLP 1.3.1 -------------------------------------------- +++ Configured Settings: defaults.conf L0004: TLP_ENABLE="1" defaults.conf L0005: TLP_PERSISTENT_DEFAULT="0" defaults.conf L0006: DISK_IDLE_SECS_ON_AC="0" defaults.conf L0007: DISK_IDLE_SECS_ON_BAT="2" defaults.conf L0008: MAX_LOST_WORK_SECS_ON_AC="15" defaults.conf L0009: MAX_LOST_WORK_SECS_ON_BAT="60" defaults.conf L0010: CPU_ENERGY_PERF_POLICY_ON_AC="balance_performance" defaults.conf L0011: CPU_ENERGY_PERF_POLICY_ON_BAT="balance_power" defaults.conf L0012: SCHED_POWERSAVE_ON_AC="0" defaults.conf L0013: SCHED_POWERSAVE_ON_BAT="1" defaults.conf L0014: NMI_WATCHDOG="0" defaults.conf L0015: DISK_DEVICES="nvme0n1 sda" defaults.conf L0016: DISK_APM_LEVEL_ON_AC="254 254" defaults.conf L0017: DISK_APM_LEVEL_ON_BAT="128 128" defaults.conf L0018: DISK_IOSCHED="keep keep" defaults.conf L0019: SATA_LINKPWR_ON_AC="med_power_with_dipm max_performance" defaults.conf L0020: SATA_LINKPWR_ON_BAT="med_power_with_dipm min_power" defaults.conf L0021: AHCI_RUNTIME_PM_TIMEOUT="15" defaults.conf L0022: PCIE_ASPM_ON_AC="default" defaults.conf L0023: PCIE_ASPM_ON_BAT="default" defaults.conf L0024: RADEON_POWER_PROFILE_ON_AC="default" defaults.conf L0025: RADEON_POWER_PROFILE_ON_BAT="default" defaults.conf L0026: RADEON_DPM_PERF_LEVEL_ON_AC="auto" defaults.conf L0027: RADEON_DPM_PERF_LEVEL_ON_BAT="auto" defaults.conf L0028: WIFI_PWR_ON_AC="off" defaults.conf L0029: WIFI_PWR_ON_BAT="on" defaults.conf L0030: WOL_DISABLE="Y" defaults.conf L0031: SOUND_POWER_SAVE_ON_AC="0" defaults.conf L0032: SOUND_POWER_SAVE_ON_BAT="1" defaults.conf L0033: SOUND_POWER_SAVE_CONTROLLER="Y" defaults.conf L0034: BAY_POWEROFF_ON_AC="0" defaults.conf L0035: BAY_POWEROFF_ON_BAT="0" defaults.conf L0036: BAY_DEVICE="sr0" defaults.conf L0037: RUNTIME_PM_ON_AC="on" defaults.conf L0038: RUNTIME_PM_ON_BAT="auto" defaults.conf L0039: RUNTIME_PM_DRIVER_BLACKLIST="amdgpu mei_me nouveau nvidia pcieport radeon" /etc/tlp.conf L0323: USB_AUTOSUSPEND="0" defaults.conf L0041: USB_BLACKLIST_BTUSB="0" defaults.conf L0042: USB_BLACKLIST_PHONE="0" defaults.conf L0043: USB_BLACKLIST_PRINTER="1" defaults.conf L0044: USB_BLACKLIST_WWAN="0" defaults.conf L0045: USB_AUTOSUSPEND_DISABLE_ON_SHUTDOWN="0" defaults.conf L0046: RESTORE_DEVICE_STATE_ON_STARTUP="0" defaults.conf L0047: RESTORE_THRESHOLDS_ON_BAT="0" defaults.conf L0048: NATACPI_ENABLE="1" defaults.conf L0049: TPACPI_ENABLE="1" defaults.conf L0050: TPSMAPI_ENABLE="1" +++ System Info System = Dell Inc. Not Specified Inspiron N5050 BIOS = A05 Release = "Fedora release 34 (Thirty Four)" Kernel = 5.11.17-300.fc34.x86_64 #1 SMP Wed Apr 28 14:21:28 UTC 2021 x86_64 BOOT_IMAGE=(hd0,msdos1)/vmlinuz-5.11.17-300.fc34.x86_64 root=UUID=2dbf3f8b-de51-413e-8872-5fb61c06cb8f ro rootflags=subvol=root rhgb quiet Init system = systemd Boot mode = BIOS (CSM, Legacy) SELinux status = enabled (enforcing) <strong> +++ TLP Status State = enabled RDW state = enabled</strong> Last run = 02:46:11 PM IST, 53 sec(s) ago Mode = battery Power source = battery [...]
Disable USB auto suspend
When TLP is started with default configuration, some USB devices will be automatically suspended to save power when your Laptop is running on battery.
To disable USB autosuspend, edit /etc/tlp.conf file:
$ sudo nano /etc/tlp.conf
Find the following line and set its value as 0.
USB_AUTOSUSPEND=0
You can also exclude specific devices from USB autosuspend (separate with spaces). First, use lsusb command to get the ids. Then, mention the device ids with space-separated like below
USB_BLACKLIST="8078:0014 065d:8023"
Save and close the file by pressing CTRL+O followed by CTRL+X.
Force battery (BAT) configuration
When no power supply is detected, the setting for AC will be used on devices like desktops and embedded hardware. If you want to force the battery (BAT) settings when using TLP on these devices to enable more power saving, edit /etc/tlp.conf file:
$ sudo nano /etc/tlp.conf
Find the following lines and set their values as shown here:
# Operation mode when no power supply can be detected: AC, BAT. TLP_DEFAULT_MODE=BAT # Operation mode select: 0=depend on power source, 1=always use TLP_DEFAULT_MODE TLP_PERSISTENT_DEFAULT=1
For more details, check the TLP website and its GitHub page given at the end.
Frequently Asked Questions
Q1: What is TLP?A: TLP is a power management tool for Linux-based systems. It optimizes battery life by managing system settings such as power source preferences, CPU speed, hard disk spins, and Wi-Fi power saving.
Q2: Does TLP require configuration?A: No, TLP comes pre-configured and generally works well with the default settings. However, users can modify its configuration to better suit their needs.
Q3: How do I install TLP?A: TLP can be installed via the terminal using package management commands like apt for Debian/Ubuntu based systems, or dnf for Fedora systems.
Q4: Can TLP help with overheating issues?A: Yes, TLP can help manage system heat by intelligently controlling system settings that affect power consumption and heat generation.
Q5: How do I check if TLP is running?A: You can check if TLP is running by using the terminal command sudo tlp-stat -s.
Q6: Does TLP work on all laptops?A: TLP is designed to work with most modern laptops, but its effectiveness may vary depending on the specific model and hardware.
Q7: Can I use TLP on desktop systems?A: While TLP is primarily designed for laptops, it can also be used on desktop systems for some of its features. However, the benefits on a desktop may be less noticeable.
Q8: Is TLP free to use?A: Yes, TLP is open-source and free to use. It's licensed under GPLv2.
Conclusion
TLP is one of the recommended application that you should install on your Linux laptop. It is also worth mentioning that you should not use multiple power saving utilities simultaneously. The TLP’s settings get overwritten by the other tools settings and vice versa, so you may not get optimal result. It is always recommended to use only TLP and remove other similar tools.
Resources:
- TLP website
- TLP GitHub Repository
Related read:
- Automatically Optimize CPU Speed And Power With Auto-cpufreq In Linux
- CPU Power Manager – Control And Manage CPU Frequency In Linux
- How To Check Laptop Battery Status And Level In Terminal In Linux
Featured image by mohamed Hassan from Pixabay.
위 내용은 Linux에서 TLP로 노트북 배터리 수명을 최적화하는 방법의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

Video Face Swap
완전히 무료인 AI 얼굴 교환 도구를 사용하여 모든 비디오의 얼굴을 쉽게 바꾸세요!

인기 기사

뜨거운 도구

메모장++7.3.1
사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전
중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기
강력한 PHP 통합 개발 환경

드림위버 CS6
시각적 웹 개발 도구

SublimeText3 Mac 버전
신 수준의 코드 편집 소프트웨어(SublimeText3)

인터넷은 단일 운영 체제에 의존하지 않지만 Linux는 이에 중요한 역할을합니다. Linux는 서버 및 네트워크 장치에서 널리 사용되며 안정성, 보안 및 확장 성으로 인기가 있습니다.

Linux 운영 체제의 핵심은 명령 줄 인터페이스이며 명령 줄을 통해 다양한 작업을 수행 할 수 있습니다. 1. 파일 및 디렉토리 작업 LS, CD, MKDIR, RM 및 기타 명령을 사용하여 파일 및 디렉토리를 관리합니다. 2. 사용자 및 권한 관리는 UserAdd, Passwd, CHMOD 및 기타 명령을 통해 시스템 보안 및 리소스 할당을 보장합니다. 3. 프로세스 관리는 PS, Kill 및 기타 명령을 사용하여 시스템 프로세스를 모니터링하고 제어합니다. 4. 네트워크 운영에는 Ping, Ifconfig, SSH 및 기타 명령이 포함되어 있으며 네트워크 연결을 구성하고 관리합니다. 5. 시스템 모니터링 및 유지 관리 Top, DF, Du와 같은 명령을 사용하여 시스템의 작동 상태 및 리소스 사용을 이해합니다.

Linux 관리자의 평균 연봉은 미국에서 $ 75,000 ~ $ 95,000, 유럽에서는 40,000 유로에서 60,000 유로입니다. 급여를 늘리려면 다음과 같이 할 수 있습니다. 1. 클라우드 컴퓨팅 및 컨테이너 기술과 같은 새로운 기술을 지속적으로 배울 수 있습니다. 2. 프로젝트 경험을 축적하고 포트폴리오를 설정합니다. 3. 전문 네트워크를 설정하고 네트워크를 확장하십시오.

Linux 시스템 관리자의 주요 작업에는 시스템 모니터링 및 성능 조정, 사용자 관리, 소프트웨어 패키지 관리, 보안 관리 및 백업, 문제 해결 및 해상도, 성능 최적화 및 모범 사례가 포함됩니다. 1. 상단, HTOP 및 기타 도구를 사용하여 시스템 성능을 모니터링하고 조정하십시오. 2. 사용자 ADD 명령 및 기타 명령을 통해 사용자 계정 및 권한을 관리합니다. 3. APT 및 YUM을 사용하여 소프트웨어 패키지를 관리하여 시스템 업데이트 및 보안을 보장합니다. 4. 방화벽을 구성하고 로그를 모니터링하고 데이터 백업을 수행하여 시스템 보안을 보장합니다. 5. 로그 분석 및 공구 사용을 통해 문제를 해결하고 해결합니다. 6. 커널 매개 변수 및 응용 프로그램 구성을 최적화하고 모범 사례를 따라 시스템 성능 및 안정성을 향상시킵니다.

Linux의 주요 용도에는 다음이 포함됩니다. 1. 서버 운영 체제, 2. 임베디드 시스템, 3. 데스크탑 운영 체제, 4. 개발 및 테스트 환경. Linux는이 분야에서 뛰어나 안정성, 보안 및 효율적인 개발 도구를 제공합니다.

가상화 지원에서 Linux와 Windows의 주요 차이점은 다음과 같습니다. 1) Linux는 KVM과 Xen을 제공하며, 높은 커스터마이징 환경에 적합한 뛰어난 성능과 유연성을 제공합니다. 2) Windows는 친숙한 인터페이스를 통해 Hyper-V를 통한 가상화를 지원하며 Microsoft 소프트웨어에 의존하는 기업에 적합한 Microsoft Ecosystem과 밀접하게 통합됩니다.

Linux를 배우는 것은 어렵지 않습니다. 1.Linux는 UNIX를 기반으로 한 오픈 소스 운영 체제이며 서버, 임베디드 시스템 및 개인용 컴퓨터에서 널리 사용됩니다. 2. 파일 시스템 및 권한 관리 이해가 핵심입니다. 파일 시스템은 계층 적이며 권한에는 읽기, 쓰기 및 실행이 포함됩니다. 3. APT 및 DNF와 같은 패키지 관리 시스템은 소프트웨어 관리를 편리하게 만듭니다. 4. 프로세스 관리는 PS 및 최고 명령을 통해 구현됩니다. 5. MKDIR, CD, Touch 및 Nano와 같은 기본 명령에서 학습을 시작한 다음 쉘 스크립트 및 텍스트 처리와 같은 고급 사용법을 사용해보십시오. 6. 권한 문제와 같은 일반적인 오류는 Sudo 및 CHMod를 통해 해결할 수 있습니다. 7. 성능 최적화 제안에는 HTOP을 사용하여 리소스 모니터링, 불필요한 파일 청소 및 SY 사용이 포함됩니다.

수년 동안 Linux 소프트웨어 배포는 Deb 및 RPM과 같은 기본 형식에 의존하여 각 배포의 생태계에 깊이 뿌리 내 렸습니다. 그러나 Flatpak과 Snap이 등장하여 응용 프로그램 포장에 대한 보편적 인 접근 방식을 약속했습니다. 이 기사는 시험합니다
