according to the above python based benchmark (certainly not perfect) more threads = slower performance? how to boost mondogb performance for massive parallelism? (multi threading many instances etc)
this is the above dwaves codeberg multi threaded benchmark on AMD hardware
filesystem is ext4
neofetch
_,met$$$$$gg. user@debian12DevPython
,g$$$$$$$$$$$$$$$P. ----------------------
,g$$P" """Y$$.". OS: Debian GNU/Linux 12 (bookworm) x86_64
,$$P' `$$$. Host: KVM/QEMU (Standard PC (Q35 + ICH9, 2009) pc-q35-7.2)
',$$P ,ggs. `$$b: Kernel: 6.1.0-28-amd64
$$: $$. - ,d$$' Shell: bash 5.2.15
`"Y$b._ CPU: 10x Cores assigned to kvm vm: AMD Ryzen 5 5600G with Radeon Graphics (8) @ 3.928GHz
Memory: 2685MiB / 7843MiB
time /usr/bin/python3.11 /home/user/git/PYTHON_EXAMPLES_ONLINE_2/benchmark_mongodb_multithread_singledatabase_v1-1.py 100000 100; # run mongodb benchmark, with 100000x records 100x threads
##### results: #####
performance_insert: 3675.52 per second
performance_read: 249.86 per second
performance_change: 208.87 per second
ime /usr/bin/python3.11 /home/user/git/PYTHON_EXAMPLES_ONLINE_2/benchmark_mongodb_multithread_singledatabase_v1-1.py 100000 10; # run mongodb benchmark, with 100000x records 10x threads
echo "scale=5; 5161/(3675/100)"|bc
140.43537
##### results: #####
performance_insert: 5161.50 per second
performance_read: 663.80 per second
performance_change: 696.20 per second
time /usr/bin/python3.11 /home/user/git/PYTHON_EXAMPLES_ONLINE_2/benchmark_mongodb_multithread_singledatabase_v1-1.py 100000 2; # run mongodb benchmark, with 100000x records 2x threads
##### results: #####
performance_insert: 8615.00 per second
performance_read: 4278.50 per second
performance_change: 4639.50 per second
observations:
RAM is not even 50% used
all CPU cores are 30% in use
disk activity according to iotop is max 1.5Mbytes/sec
less threads = faster?
can u confirm this?
how to tune mongodb for performance? (maybe even faster parallelism?)
hardware upgrades: more RAM more CPU faster HD will not help in this scenario…
neofetch
_,met$$$$$gg. user@debian12DevPython
,g$$$$$$$$$$$$$$$P. ----------------------
,g$$P" """Y$$.". OS: Debian GNU/Linux 12 (bookworm) x86_64
,$$P' `$$$. Host: KVM/QEMU (Standard PC (Q35 + ICH9, 2009) pc-q35-7.2)
',$$P ,ggs. `$$b: Kernel: 6.1.0-28-amd64
$$: $$. - ,d$$' Shell: bash 5.2.15
`"Y$b._ CPU: 10x Cores assigned to kvm vm: AMD Ryzen 5 5600G with Radeon Graphics (8) @ 3.928GHz
Memory: 2685MiB / 7843MiB
### basic system info ###
python version: 3.11.2
kernel version: Linux 6.1.0-28-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.119-1 (2024-11-22)
mongodb version: db version v8.0.5
# run mongodb benchmark, with 100000x records 100x threads
time /usr/bin/python3.11 /home/user/git/PYTHON_EXAMPLES_ONLINE_2/benchmark_mongodb_multithread_singledatabase_v1-2.py 100000 100; # (this is more amount of threads cores the machine has)
##### results: #####
performance_insert: 6934.01 per second
performance_read: 63.27 per second
performance_change: 69.29 per second
time /usr/bin/python3.11 /home/user/git/PYTHON_EXAMPLES_ONLINE_2/benchmark_mongodb_multithread_singledatabase_v1-2.py 100000 10; # (this is more amount of threads cores the machine has)
##### results: #####
performance_insert: 6993.00 per second
performance_read: 634.00 per second
performance_change: 675.20 per second
time /usr/bin/python3.11 /home/user/git/PYTHON_EXAMPLES_ONLINE_2/benchmark_mongodb_multithread_singledatabase_v1-2.py 100000 2; # (this is more amount of threads cores the machine has)
##### results: #####
performance_insert: 9660.00 per second
performance_read: 4254.00 per second
performance_change: 4650.00 per second
neofetch
.-/+oossssoo+/-. root@ubuntu2204
`:+ssssssssssssssssss+:` --------------------
-+ssssssssssssssssssyyssss+- OS: Ubuntu 22.04.4 LTS x86_64
.ossssssssssssssssssdMMMNysssso. Host: VMware Virtual Platform None
/ssssssssssshdmmNNmmyNMMMMhssssss/ Kernel: 5.15.0-133-generic
+ssssssssshmydMMMMMMMNddddyssssssss+ Uptime: 7 days, 11 hours, 54 mins
ossyNMMMNyMMhsssssssssssssshmmmhssssssso 2x cores CPU: Intel Xeon E5-2690 v2 (2) @ 2.999GHz
.ssssssssdMMMNhsssssssssshNMMMdssssssss. Memory: 2144MiB / 7937MiB
##### benchmark_mongodb_multithread_singledatabase_v1.py #####
### basic system info ###
python version: 3.10.12
kernel version: Linux 5.15.0-133-generic #144-Ubuntu SMP Fri Feb 7 20:47:38 UTC 2025
mongodb version: db version v6.0.15
time /usr/bin/python3 /scripts/benchmark_mongodb_multithread_singledatabase_v1-2.py 100000 10; # run the benchmark, 100000x records 10x threads
##### results: #####
performance_insert: 2756.60 per second
performance_read: 248.70 per second
performance_change: 251.70 per second
time /usr/bin/python3 /scripts/benchmark_mongodb_multithread_singledatabase_v1-2.py 100000 100; # run the benchmark, 100000x records 100x threads
##### results: #####
performance_insert: 2353.99 per second
performance_read: 22.41 per second
performance_change: 23.54 per second
time /usr/bin/python3 /scripts/benchmark_mongodb_multithread_singledatabase_v1-2.py 100000 2; # run the benchmark, 100000x records 2x threads
##### results: #####
performance_insert: 3479.50 per second
performance_read: 1548.50 per second
performance_change: 1610.00 per second
observations: write performance is much better than read performance
write and read performance but especially read performance get’s better with less threads
how to optimize tune this setup (1x server 1x database) for performance?