servicetuned start
Redirecting to /bin/systemctl start tuned.service
tuned-adm profile virtual-guest powersave
tuned-adm profile throughput-performance optimize-serial-console
tuned-adm profile cpu-partitioning intel-sst
/etc/tuned/cpu-partitioning-variables.conf 文件中配置 cpu-partitioning 配置文件:具有负载平衡的隔离 CPU、无负载平衡的隔离 CPU、内务处理 CPU。yum install tuned-profiles-cpu-partitioning 命令安装 cpu-partitioning TuneD 配置文件。Isolated CPUs with the kernel’s scheduler load balancing:isolated_cores=2-23Isolated CPUs without the kernel’s scheduler load balancing:no_balance_cores=2,3
tuned-adm profile cpu-partitioning
yuminstalltuned
systemctlenable--nowtuned
yuminstalltuned-profiles-realtime tuned-profiles-nfv
tuned-adm active。Current active profile: virtual-guest
Verfication succeeded, current system settings match the preset profile.See TuneD log file ('/var/log/tuned/tuned.log') for details.
tuned-adm list
Available profiles:- accelerator-performance - Throughput performance based tuning with disabled higher latency STOP states- balanced - General non-specialized tuned profile- cpu-partitioning - Optimize for CPU partitioning- 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- my-profile- 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.- 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- 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 guestsCurrent active profile: virtual-guest
tuned-adm active
Current active profile: virtual-guest
tuned-adm recommendvirtual-guest
tuned-adm profile selected-profile
tuned-adm profile profile1 profile2
reboot
tuned-adm verify
Verfication succeeded, current system settings match the preset profile.See TuneD log file ('/var/log/tuned/tuned.log') for details.
tuned-adm off
systemctl disable--nowtuned
df-h
Filesystem Size Used Avail Use% Mounted ondevtmpfs 830M 0 830M 0% /devtmpfs 845M 24K 845M 1% /dev/shmtmpfs 845M 250M 596M 30% /runtmpfs 845M 0 845M 0% /sys/fs/cgroup/dev/vda1 50G 4.5G 43G 10% /tmpfs 169M 0 169M 0% /run/user/0
fdisk-lu
Disk /dev/vda: 50 GiB, 53687091200 bytes, 104857600 sectorsUnits: sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 262144 bytes / 262144 bytesDisklabel type: dosDisk identifier: 0xe609e297Device Boot Start End Sectors Size Id Type/dev/vda1 2048 104857566 104855519 50G 83 Linux
df -h /dev。Filesystem Size Used Avail Use% Mounted ondevtmpfs 830M 0 830M 0% /dev
du 命令查看指定目录的使用情况。fdisk 命令。gdisk 命令。mkfs
mkfs -t ext4 /dev/sdb1。mkfs /dev/sdb2 2G。fdisk-l
fdisk设备名称
command(mforhelp): d
w 保存退出。cat /sys/block/ 设备 /queue/scheduler 将设备替换为块设备名称。[none] mq-deadline kyber bfq
tuned-adm active
mkdir/etc/tuned/my-profile
devadm info--query=property--name=/dev/device|grep-E'(WWN|SERIAL)'
[root@VM-6-117-centos ~]# udevadm info --query=property --name=/dev/sr0 | grep -E '(WWN|SERIAL)'ID_SERIAL=QEMU_DVD-ROM_QM00002ID_SERIAL_SHORT=QM00002
etc/tuned/my-profile/tuned.conf 配置文件。在该文件中设置,为与 WWN 标识符匹配的设备设置所选磁盘调度程序。[disk]devices_udev_regex=IDNAME=device system unique idelevator=selected-scheduler
tuned-adm profile my-profile
tuned-adm active
Current active profile: my-profile
tuned-adm verify
Verfication succeeded, current system settings match the preset profile.See TuneD log file ('/var/log/tuned/tuned.log') for details.
cat/sys/block/device/queue/scheduler
[root@VM-6-117-centos ~]# cat /sys/block/sr0/queue/schedulermq-deadline kyber [bfq] none
udevadm info--name=/dev/sr0|grep-E'(WWN|SERIAL)'
[root@VM-6-117-centos ~]# udevadm info --name=/dev/sr0 | grep -E '(WWN|SERIAL)'E: ID_SERIAL=QEMU_DVD-ROM_QM00002E: ID_SERIAL_SHORT=QM00002
/etc/udev/rules.d/99-scheduler.rules 文件。ACTION=="add|change", SUBSYSTEM=="block", ENV{ID_SERIAL_SHORT}=="QM00002", ATTR{queue/scheduler}="bfq"
udevadm control --reload-rules
udevadm trigger--type=devices--action=change
cat/sys/block/device/queue/scheduler*
[root@VM-6-117-centos ~]# cat /sys/block/sr0/queue/schedulermq-deadline kyber [bfq] none
echoselected-scheduler>/sys/block/device/queue/scheduler
cat/sys/block/device/queue/scheduler
[root@VM-6-117-centos ~]# cat /sys/block/vda/queue/scheduler[none] mq-deadline kyber bfq
lscpu
[root@VM-6-117-centos ~]# lscpuArchitecture: x86_64CPU op-mode(s): 32-bit, 64-bitByte Order: Little EndianCPU(s): 2On-line CPU(s) list: 0,1Thread(s) per core: 2Core(s) per socket: 1Socket(s): 1NUMA node(s): 1Vendor ID: GenuineIntelBIOS Vendor ID: SmdbmdsCPU family: 6Model: 106Model name: Intel(R) Xeon(R) Platinum 8374C CPU @ 2.70GHzBIOS Model name: 3.0Stepping: 6CPU MHz: 2700.000BogoMIPS: 5400.00Hypervisor vendor: KVMVirtualization type: fullL1d cache: 48KL1i cache: 32KL2 cache: 1280KL3 cache: 58368KNUMA node0 CPU(s): 0,1Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl xtopology cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch cpuid_fault invpcid_single ssbd ibrs ibpb ibrs_enhanced fsgsbase bmi1 hle avx2 smep bmi2 erms invpcid rtm avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 wbnoinvd arat avx512vbmi umip avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq arch_capabilities
top
%Cpu(s): 0.2 us, 0.2 sy, 0.0 ni, 99.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
yuminstallsysstat
pidstat 1[root@VM-6-117-centos ~]# pidstat 1Linux 5.4.119-19-0009.1 (VM-6-117-centos) 08/19/2022 _x86_64_ (2 CPU)03:11:04 PM UID PID %usr %system %guest %wait %CPU CPU Command03:11:05 PM 0 561098 1.00 0.00 0.00 0.00 1.00 0 barad_agent03:11:05 PM UID PID %usr %system %guest %wait %CPU CPU Command03:11:06 PM 0 561098 0.00 1.00 0.00 0.00 1.00 0 barad_agent
yuminstallperf
perftop
6.48% perf [.] __symbols__insert5.21% [kernel] [k] kallsyms_expand_symbol.constprop.14.80% perf [.] rb_next2.48% perf [.] rust_demangle_callback2.42% libc-2.28.so [.] __GI_____strtoull_l_internal2.32% [kernel] [k] vsnprintf2.10% [kernel] [k] number
perfstat-a-Asleepseconds
erf stat -a -A -e cycles sleep seconds。perf report--sortcpu
perf report --sort cpu,comm。perftop--sortcpu
perf top --sort cpu,comm。perf.data 文件,使用以逗号分隔的 CPU 列表。perf record-C0,1sleepseconds
perf record-C0-2sleepseconds
perf report
free。[root@VM-6-117-centos ~]# freetotal used free shared buff/cache availableMem: 1730432 375364 130400 255480 1224668 932144Swap: 0 0 0
vmstat -m。[root@VM-6-117-centos ~]# vmstat -mCache Num Total Size Pagesrpc_inode_cache 46 46 704 23rpc_buffers 16 16 2048 16rpc_tasks 16 16 256 16ext4_groupinfo_4k 420 420 144 28fscrypt_info 0 0 104 39fscrypt_ctx 0 0 64 64bridge_fdb_cache 0 0 128 32ip6-frags 0 0 208 19fib6_nodes 128 128 64 64ip6_dst_cache 32 32 256 16
cat /proc/meminfo。[root@VM-6-117-centos ~]# cat /proc/meminfoMemTotal: 1730432 kBMemFree: 131156 kBMemAvailable: 933048 kBBuffers: 80508 kBCached: 1070344 kBSwapCached: 0 kBActive: 847508 kBInactive: 575192 kBActive(anon): 437152 kBInactive(anon): 90176 kBActive(file): 410356 kBInactive(file): 485016 kBUnevictable: 0 kBMlocked: 0 kB
/proc/meminfo 所包含的信息比 free 等命令要丰富得多。dmidecode 命令。dmidecode-t17
文档反馈