┌──[root@liruilongs.github.io]-[/proc/sys/fs] └─$yum -y install tuned Updating Subscription Management repositories. Unable to read consumer identity This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. Last metadata expiration check: 1:07:01 ago on Sun 01 Oct 2023 03:03:42 PM CST. Package tuned-2.13.0-6.el8.noarch is already installed. Dependencies resolved. Nothing to do. Complete! ┌──[root@liruilongs.github.io]-[/etc/tuned] └─$systemctlenable tuned --now
┌──[root@liruilongs.github.io]-[/etc/tuned] └─$tuned-adm active Current active profile: virtual-guest
/etc/tuned/目录下包含有active_profile文件,该文件记录当前激活的调优方案
tuned-adm list 可以列出可用的配置文件列表,以及当前激活的配置文件
可以看到,当前激活的配置文件为 Current active profile: virtual-guest,virtual-guest
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
┌──[root@liruilongs.github.io]-[/proc/sys/fs] └─$tuned-adm list Available profiles: - accelerator-performance - Throughput performance based tuning with disabled higher latency STOP states - balanced - General non-specialized tuned profile - desktop - Optimize for the desktop use-case - hpc-compute - Optimize for HPC compute workloads - intel-sst - Configure for Intel Speed Select Base Frequency - latency-performance - Optimize for deterministic performance at the cost of increased power consumption - network-latency - Optimize for deterministic performance at the cost of increased power consumption, focused on low latency network performance - network-throughput - Optimize for streaming network throughput, generally only necessary on older CPUs or 40G+ networks - powersave - Optimize for low power consumption - throughput-performance - Broadly applicable tuning that provides excellent performance across a variety of common server workloads - virtual-guest - Optimize for running inside a virtual guest - virtual-host - Optimize for running KVM guests Current active profile: virtual-guest ┌──[root@liruilongs.github.io]-[/proc/sys/fs] └─$
┌──[root@hp-ProLiant-SL270s-Gen8-SE]-[/sys/kernel/cgroup] └─$ tuned-adm list Available profiles: - accelerator-performance - Throughput performance based tuning with disabled higher latency STOP states - atomic-guest - Optimize virtual guests based on the Atomic variant - atomic-host - Optimize bare metal systems running the Atomic variant - balanced - General non-specialized tuned profile - cpu-partitioning - Optimize for CPU partitioning - default - Legacy default tuned profile - desktop - Optimize for the desktop use-case - desktop-powersave - Optmize for the desktop use-case with power saving - enterprise-storage - Legacy profile for RHEL6, for RHEL7, please use throughput-performance profile - hpc-compute - Optimize for HPC compute workloads - intel-sst - Configure for Intel Speed Select Base Frequency - laptop-ac-powersave - Optimize for laptop with power savings - laptop-battery-powersave - Optimize laptop profile with more aggressive power saving - latency-performance - Optimize for deterministic performance at the cost of increased power consumption - mssql - Optimize for MS SQL Server - network-latency - Optimize for deterministic performance at the cost of increased power consumption, focused on low latency network performance - network-throughput - Optimize for streaming network throughput, generally only necessary on older CPUs or 40G+ networks - optimize-serial-console - Optimize for serial console use. - oracle - Optimize for Oracle RDBMS - postgresql - Optimize for PostgreSQL server - powersave - Optimize for low power consumption - realtime - Optimize for realtime workloads - realtime-virtual-guest - Optimize for realtime workloads running within a KVM guest - realtime-virtual-host - Optimize for KVM guests running realtime workloads - sap-hana - Optimize for SAP HANA - sap-netweaver - Optimize for SAP NetWeaver - server-powersave - Optimize for server power savings - spectrumscale-ece - Optimized for Spectrum Scale Erasure Code Edition Servers - spindown-disk - Optimize for power saving by spinning-down rotational disks - throughput-performance - Broadly applicable tuning that provides excellent performance across a variety of common server workloads - virtual-guest - Optimize for running inside a virtual guest - virtual-host - Optimize for running KVM guests Current active profile: balanced
[main] summary=Optimize for streaming network throughput, generally only necessary on older CPUs or 40G+ networks include=throughput-performance
[sysctl] # Increase kernel buffer size maximums. Currently this seems only necessary at 40Gb speeds. # # The buffer tuning values below do not account for any potential hugepage allocation. # Ensure that you do not oversubscribe system memory. net.ipv4.tcp_rmem="4096 87380 16777216" net.ipv4.tcp_wmem="4096 16384 16777216" net.ipv4.udp_mem="3145728 4194304 16777216" ┌──[root@liruilongs.github.io]-[/usr/lib/tuned] └─$
mail 部分描述了 这个配置文件的作用,以及他引用了 "throughput-performance" 配置文件 include=throughput-performance
[disk] # The default unit for readahead is KiB. This can be adjusted to sectors # by specifying the relevant suffix, eg. (readahead => 8192 s). There must # be at least one space between the number and suffix (if suffix is specified). readahead=>4096
# SCHED_OTHER wake-up granularity. # (default: 1 msec# (1 + ilog(ncpus)), units: nanoseconds) # # This option delays the preemption effects of decoupled workloads # and reduces their over-scheduling. Synchronous workloads will still # have immediate wakeup/sleep latencies. kernel.sched_wakeup_granularity_ns = 15000000
# If a workload mostly uses anonymous memory and it hits this limit, the entire # working set is buffered for I/O, and any more write buffering would require # swapping, so it's time to throttle writes until I/O can catch up. Workloads # that mostly use file mappings may be able to use even higher values. # # The generator of dirty data starts writeback at this percentage (system default # is 20%) vm.dirty_ratio = 40
# Start background writeback (via writeback threads) at this percentage (system # default is 10%) vm.dirty_background_ratio = 10
# PID allocation wrap value. When the kernel's next PID value # reaches this value, it wraps back to a minimum PID value. # PIDs of value pid_max or larger are not allocated. # # A suggested value for pid_max is 1024 * <# of cpu cores/threads in system> # e.g., a box with 32 cpus, the default of 32768 is reasonable, for 64 cpus, # 65536, for 4096 cpus, 4194304 (which is the upper limit possible). #kernel.pid_max = 65536
# The swappiness parameter controls the tendency of the kernel to move # processes out of physical memory and onto the swap disk. # 0 tells the kernel to avoid swapping processes out of physical memory # for as long as possible # 100 tells the kernel to aggressively swap processes out of physical memory # and move them to swap cache vm.swappiness=10 ┌──[root@liruilongs.github.io]-[/usr/lib/tuned] └─$