Closed Ansore closed 2 years ago
can you please paste here your /proc/cpuinfo
?
what happens if you run it with --hz=10
? does CPU usage get lower?
thank you for your reply.
here is cat /proc/cpuinfo
:
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 165
model name : Intel(R) Core(TM) i5-10400 CPU @ 2.90GHz
stepping : 3
microcode : 0xf0
cpu MHz : 4300.000
cache size : 12288 KB
physical id : 0
siblings : 12
core id : 0
cpu cores : 6
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 22
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts md_clear flush_l1d arch_capabilities
vmx flags : vnmi preemption_timer posted_intr invvpid ept_x_only ept_ad ept_1gb flexpriority apicv tsc_offset vtpr mtf vapic ept vpid unrestricted_guest vapic_reg vid ple shadow_vmcs pml ept_mode_based_exec
bugs : spectre_v1 spectre_v2 spec_store_bypass swapgs itlb_multihit
bogomips : 5802.42
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:
processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 165
model name : Intel(R) Core(TM) i5-10400 CPU @ 2.90GHz
stepping : 3
microcode : 0xf0
cpu MHz : 4300.000
cache size : 12288 KB
physical id : 0
siblings : 12
core id : 1
cpu cores : 6
apicid : 2
initial apicid : 2
fpu : yes
fpu_exception : yes
cpuid level : 22
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts md_clear flush_l1d arch_capabilities
vmx flags : vnmi preemption_timer posted_intr invvpid ept_x_only ept_ad ept_1gb flexpriority apicv tsc_offset vtpr mtf vapic ept vpid unrestricted_guest vapic_reg vid ple shadow_vmcs pml ept_mode_based_exec
bugs : spectre_v1 spectre_v2 spec_store_bypass swapgs itlb_multihit
bogomips : 5802.42
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:
# 12 processor
if I run dragonfly with --hz=10
, CPU usage wile be negligible.
top - 22:56:02 up 14:05, 1 user, load average: 1.05, 1.42, 1.49
Threads: 13 total, 0 running, 13 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.7 us, 0.2 sy, 0.0 ni, 99.1 id, 0.1 wa, 0.0 hi, 0.0 si, 0.0 st
top - 22:58:03 up 14:07, 1 user, load average: 0.91, 1.21, 1.40
Threads: 13 total, 0 running, 13 sleeping, 0 stopped, 0 zombie
%Cpu(s): 1.2 us, 0.2 sy, 0.0 ni, 98.4 id, 0.1 wa, 0.1 hi, 0.0 si, 0.0 st
MiB Mem : 31769.7 total, 4604.4 free, 11940.3 used, 15225.0 buff/cache
MiB Swap: 4096.0 total, 4096.0 free, 0.0 used. 14235.5 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
137699 ansore 20 0 1368624 37088 24896 S 0.3 0.1 0:00.15 Proactor2
137702 ansore 20 0 1368624 37088 24896 S 0.3 0.1 0:00.15 Proactor5
137703 ansore 20 0 1368624 37088 24896 S 0.3 0.1 0:00.16 Proactor6
137707 ansore 20 0 1368624 37088 24896 S 0.3 0.1 0:00.15 Proactor10
137696 ansore 20 0 1368624 37088 24896 S 0.0 0.1 0:00.01 dragonfly
137697 ansore 20 0 1368624 37088 24896 S 0.0 0.1 0:00.16 Proactor0
137698 ansore 20 0 1368624 37088 24896 S 0.0 0.1 0:00.16 Proactor1
137700 ansore 20 0 1368624 37088 24896 S 0.0 0.1 0:00.14 Proactor3
137701 ansore 20 0 1368624 37088 24896 S 0.0 0.1 0:00.14 Proactor4
137704 ansore 20 0 1368624 37088 24896 S 0.0 0.1 0:00.15 Proactor7
137705 ansore 20 0 1368624 37088 24896 S 0.0 0.1 0:00.15 Proactor8
137706 ansore 20 0 1368624 37088 24896 S 0.0 0.1 0:00.15 Proactor9
137708 ansore 20 0 1368624 37088 24896 S 0.0 0.1 0:00.00 Proactor11
So we need to set the appropriate clock frequency?
DF runs a periodic task handler, a cron job 1000 times a second on each thread.
This cron job is pretty lightweight but its high frequency causes CPU usage to be somewhat high. The fact that you run it in debug mode amplifies the problem as well. It's not important for production workloads. For localdev environments you can pass --hz=10
or --hz=100
to alleviate the problem.
Duplicate of https://github.com/dragonflydb/dragonfly/issues/66
Thank you.
The CPU consumption of dragonfly seems to be high without any opetation.
operater system:
archlinux
kernel version:5.18.3-arch1-1
build:htop:![Screenshot_20220612_154641](https://user-images.githubusercontent.com/17881025/173224995-d4932d0c-f100-4248-bb08-576d927501e9.png)
top of dragonfly process:
the dragonfly process's backtrace:
Is this cased by Proactor idling that loads to execessive CPU usage?