ZM under Proxmox, very bad CPU load?

Previous development branch now released as 1.36
Locked
brononius
Posts: 15
Joined: Thu Aug 16, 2012 5:10 am

ZM under Proxmox, very bad CPU load?

Post by brononius »

I'm running zoneminder 1.35.14 on a ubuntu server 20.04. This is a virtual machine under Proxmox. For the hardware, I've assigned now 2 sockets, 6 cores, 48GB of memory and 1TB sata storage. My CPU under proxmox is shooting up to 500~600% usuage. Slowing down other VM's. So not really the idea.

Once I start using about 4 IP-cameras (I've got 8 in total), the CPU starts to rise above 100% in the hypervisor...
Most camera's (6 of them) are foscam cameras with 720p setting and 32b color.

I lowered all camera's to 320x240 and 24 colors. Then it was a bit better, but seems a bit stupid to have this 'low' quality with this kind of hardware.
When I lower the assigned CPU's, I can't notice a real difference. Except for 1 socket / 1 core. But at that point, zoneminder is generating a lot of error logs concerning performance.


Any idea what I can do to solve/debug this?

My systemload is mostly between 5 and 8...
Schermafdruk van 2020-11-24 16.52.31.png
Schermafdruk van 2020-11-24 16.52.31.png (18.95 KiB) Viewed 1701 times

Some exra technical info:

Code: Select all

root@quasimodo:~# lscpu
Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
Address sizes:                   40 bits physical, 48 bits virtual
CPU(s):                          12
On-line CPU(s) list:             0-11
Thread(s) per core:              1
Core(s) per socket:              6
Socket(s):                       2
NUMA node(s):                    2
Vendor ID:                       GenuineIntel
CPU family:                      15
Model:                           6
Model name:                      Common KVM processor
Stepping:                        1
CPU MHz:                         1999.999
BogoMIPS:                        3999.99
Hypervisor vendor:               KVM
Virtualization type:             full
L1d cache:                       384 KiB
L1i cache:                       384 KiB
L2 cache:                        48 MiB
L3 cache:                        32 MiB
NUMA node0 CPU(s):               0-5
NUMA node1 CPU(s):               6-11
Vulnerability Itlb multihit:     KVM: Vulnerable
Vulnerability L1tf:              Mitigation; PTE Inversion
Vulnerability Mds:               Vulnerable: Clear CPU buffers attempted, no microcode; SMT Host state unknown
Vulnerability Meltdown:          Mitigation; PTI
Vulnerability Spec store bypass: Vulnerable
Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; Full generic retpoline, STIBP disabled, RSB filling
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Not affected
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc nopl xtopology cpuid tsc_known_freq pni cx16 x2apic hypervisor lahf_lm cpuid_f
                                 ault pti
Memory (top) of the virtual machine:
Schermafdruk van 2020-11-24 16.39.32.png
Schermafdruk van 2020-11-24 16.39.32.png (104.86 KiB) Viewed 1704 times

Memory (top) of the hypervisor, PID 25036 is the zoneminder VM.
Schermafdruk van 2020-11-24 16.45.40.png
Schermafdruk van 2020-11-24 16.45.40.png (139.75 KiB) Viewed 1704 times
trumee
Posts: 69
Joined: Tue Mar 08, 2011 3:33 pm

Re: ZM under Proxmox, very bad CPU load?

Post by trumee »

I am running a bunch of cameras in an LXD container with not so much CPU usage. The camera's frame rate are set to less than 10fps. I think Proxmox does support containers, maybe you can try that.
kovaga
Posts: 7
Joined: Wed Nov 27, 2019 6:55 pm

Re: ZM under Proxmox, very bad CPU load?

Post by kovaga »

By default proxmox uses kvm64 for processor Type with very basic set of supported instructions.
Go to configuration of your VM and change processor type to host. This way all the hardware instructions provided by your processor would be accessible by your VM.

Depending on your CPU and ZM settings this will likely reduce your load and CPU usage by 5-10% or even more.
Locked