OPNsense Forum

English Forums => Hardware and Performance => Topic started by: Styx on April 19, 2020, 01:36:21 pm

Title: OPNsense on a standalone vmWare host 100% CPU
Post by: Styx on April 19, 2020, 01:36:21 pm
Hi there,
I'm using pfSense vmWare since years and i want to try to replace it with OPNsense instead for lots of reasons ^^.
Actually, i've got 2 VM with OPNsense in HA.
(https://i.postimg.cc/JDDMxCts/Untitled-Diagram.png) (https://i.postimg.cc/cHTCssSB/Untitled-Diagram.png)
Each VM is using 100% of the CPU. I had to limit CPU frequency (https://i.postimg.cc/c4cT8JyG/image.png), but it isn't a solution.
I tried :

I take a look in the System > Activity (https://i.postimg.cc/MKVQ43K6/image.png) , there is only the process "idle" taking early all the CPU ?

(https://i.postimg.cc/4KS505DS/image.png) (https://postimg.cc/4KS505DS)

What can i do ?, ???

Thx for your help and sorry for my english!

EDIT : there aren't additionnal plugins (other than vmware Tools) and this is the same on a single VM without HA
Title: Re: OPNsense on a standalone vmWare host 100% CPU
Post by: phoenix on April 19, 2020, 01:45:32 pm
There is no such process as "idle", that is the state of the processor and shows you that the cpu is idle i.e. nothing is consuming any cpu resources. ;)
Title: Re: OPNsense on a standalone vmWare host 100% CPU
Post by: Styx on April 19, 2020, 02:01:04 pm
Thanks for your answer.

There is no such process as "idle", that is the state of the processor and shows you that the cpu is idle i.e. nothing is consuming any cpu resources. ;)

I would like so.

For me, the idle task is used for process accounting, and also to reduce energy consumption. As far i know, in Linux, one idle task is created for every processor, and locked to that processor; whenever there’s no other process to run on that CPU, the idle task is scheduled.

Anyway, like i've explained before, if the frequency of the VMs is not limited, they will take 100% of the CPU from the ESXi host (as you can see in my previous post, the VM FW1 takes immediately 100% of the host CPU when I suppress the 200Mhz limitation like on FW2).

(https://i.postimg.cc/4KS505DS/image.png) (https://postimg.cc/4KS505DS)

I don't think this is normal...
Title: Re: OPNsense on a standalone vmWare host 100% CPU
Post by: Supermule on April 19, 2020, 02:23:55 pm
What version of OPNsense and can you post pictures of your VM's CPU performance??

Title: Re: OPNsense on a standalone vmWare host 100% CPU
Post by: Styx on April 19, 2020, 02:33:41 pm
What version of OPNsense and can you post pictures of your VM's CPU performance??
Virtualized OPNsenses 20.1 / HA
vmWare ESX standalone host 7.0
(https://i.ibb.co/n15J9X6/Screenshot-20200419-142718.jpg) (https://ibb.co/n15J9X6)
Title: Re: OPNsense on a standalone vmWare host 100% CPU
Post by: Supermule on April 19, 2020, 03:32:13 pm
309 mhz is VERY low.....

Title: Re: OPNsense on a standalone vmWare host 100% CPU
Post by: Styx on April 19, 2020, 05:45:57 pm
309 mhz is VERY low.....
Yes, when a VM is virtualized, there is a gap between ressource provided and really used.
Each pfsense VM are using between 0,06 and 0,1GHz with no limitations.
On the OPNsenses, like I explained before, if I let "unlimited", the VM will take all CPU from all the cores of the esxi host without consideration and will be as slow as actually.

So, like I said, it's not the solution but I set limitations on CPU to 0,3 GHz (where a pfsense use 0,06GHz).

Anyway, remove limitations doesn't make any changes apart stressing the esx host CPUs.

What can I do?

Thanks.
Title: Re: OPNsense on a standalone vmWare host 100% CPU
Post by: Supermule on April 19, 2020, 07:17:18 pm
I think youre wrong...

How many vm's are on that server??

You can easily set the shares on the Vcpu's so that the performance doesnt take a hit like you say.
Title: Re: OPNsense on a standalone vmWare host 100% CPU
Post by: Styx on April 19, 2020, 07:32:50 pm
I think youre wrong...

How many vm's are on that server??

You can easily set the shares on the Vcpu's so that the performance doesnt take a hit like you say.
Only OPNsenses VM are slow in my case even ihfthe esx host deliver all cpu to the OPNsenses VMs without reason.

There are 5 VM (2 Pfsense, 2 OPNsense anf one Windows Server 2019) on the esx host.
I have shut down all Pfsense and windows VM, remove limitations : the esx host and the OPNsenses VM are at 100%.

I may be wrong but I don't think that all vCPU assigned to the VM need to run at 100% on i7 2,7gHz.

Is it possible that there is something to check on OPNsense default parameters or VM parameters which can explain this CPU consumption?

Title: Re: OPNsense on a standalone vmWare host 100% CPU
Post by: Supermule on April 19, 2020, 08:00:13 pm
If you see CPU idle on OPNsense and thats close to 100% then everything is fine. It does nothing so it schedules idle time...

How many cores do you have?
Title: Re: OPNsense on a standalone vmWare host 100% CPU
Post by: Styx on April 19, 2020, 08:04:00 pm
If you see CPU idle on OPNsense and thats close to 100% then everything is fine. It does nothing so it schedules idle time...

How many cores do you have?
You're right. It's the only clue visible on diagnostic page. I shouldn't have mentioned it.
8 cores and I can't explained that cpu goes to 100% with only 2 VM. I believe there is something to change. I've also tried to convert thin to thick storage with FW1 but same result...
Title: Re: OPNsense on a standalone vmWare host 100% CPU
Post by: Supermule on April 19, 2020, 10:33:14 pm
Can you post the CPU performance graph over time on the VM if you click on the performance tab??

Otherwise send me a teamviewer ID and code, I will log on and investigate if that works for you?
Title: Re: OPNsense on a standalone vmWare host 100% CPU
Post by: Styx on April 19, 2020, 11:04:23 pm
Here it is, i just start the VM :
(https://i.ibb.co/4p0gQtT/image.png) (https://ibb.co/4p0gQtT)
(https://i.ibb.co/w7VqN3c/image.png) (https://ibb.co/w7VqN3c)

ESXTOP :
Code: [Select]
9:50:28pm up  6:22, 621 worlds, 7 VMs, 8 vCPUs; CPU load average: 0.71, 0.73, 0.79
PCPU USED(%):  12 4.0  17  25  12 105  41  60 AVG:  34
PCPU UTIL(%):  10 4.6  12  15 9.7  70  28  41 AVG:  24
CORE UTIL(%):  13      26      78      68     AVG:  46

        ID        GID NAME             NWLD   %USED    %RUN    %SYS   %WAIT %VMWAIT    %RDY   %IDLE  %OVRLP   %CSTP  %MLMTD  %SWPWT
     38282      38282 FW1                10  258.86  171.40    0.00  828.48    0.02    0.29   29.53    0.15    0.00    0.00    0.00

So i don't know if there is something on OPNsense or on vmWare but i don't understand why this fork doesn't work well...Maybe should i try to reinstall it in x86 ?
Title: Re: OPNsense on a standalone vmWare host 100% CPU
Post by: Supermule on April 20, 2020, 04:41:13 am
Can you decrease the number of cores to 1 and check if there is an update to Opnsense?

Latest is 20.1.4...
Title: Re: OPNsense on a standalone vmWare host 100% CPU
Post by: Styx on April 20, 2020, 07:53:30 am
I've decrease the number of cores on the VM and OPNsense is now updated to 20.1.4, it seems to keep the same behavior ....  >:(
Maybe do i test with the devel one ?
Title: Re: OPNsense on a standalone vmWare host 100% CPU
Post by: Supermule on April 20, 2020, 07:55:35 am
Leave that for now... we have to get it running as it should on production software.
Title: Re: OPNsense on a standalone vmWare host 100% CPU
Post by: Styx on April 25, 2020, 10:06:19 pm
I've tried :
But no luck, still having CPU host stuck to 100% without high CPU ready values (between 0.01 to 0.9 %)
Here is the CPU consumption (similar in each case mentionned before) :
(https://i.ibb.co/QPNLQ97/image.png) (https://ibb.co/QPNLQ97)

Any ideas ?

Thanks a lot for your help  ;)
Title: Re: OPNsense on a standalone vmWare host 100% CPU
Post by: Supermule on April 25, 2020, 10:47:45 pm
I need to see the system....

And how its configured for ESXi....
Title: Re: OPNsense on a standalone vmWare host 100% CPU
Post by: Styx on April 27, 2020, 04:15:31 pm
To begin, thanks Supermule for your help to see my mistake : my LAN ip subnet was incorrect.

After fixing this, reinstall in 64b with 4 cores for each OPNsense, early all CPU of the ESXi host is used (i7-8559U CPU @ 2.70GHz with 8 logical cores).

Is it normal?

EDIT : I mean, does OPNsense need to use 6GHz with no traffic (where pfsense is using 100MHz)?