Adding a cpu in a virtual machine.



  • Hi all. I did a quick search but couldn't find any detailed info so I hope someone here can help.

    I am new to the linux world so I need step by step help :)

    I have a vmware esx vm running newest version of pfsense - unfortunately it was installed with one vcpu and I need to assign one more. I have already done that in the vm but I need to tell pfsense to pick it up.

    How do I do that?



  • you need to have the smp kernel installed.  If it's installed, it should be just add a cpu within the visualization software.  No different than adding a cpu for a windows host.
      I believe smp is the default in 2.0.



  • Thx :)

    Ok, next question is then how do I check that it actually uses the extra cpu?
    I haven't found anywhere in the gui where it is shown and when looking at pftop and top I couldn't see it either.

    When I just look at it the cpu usage doens't seem to change when adding the second cpu. That's why I thought I needed to do something to enable it.



  • type dmesg at console to see your boot log.

    If you have more then one cpu it will show:
    SMP: AP CPU #1 Launched!
    SMP: AP CPU #2 Launched!

    if you run top, the column C shows CPUS in use.

    last pid: 35623;  load averages:  0.00,  0.00,  0.00  up 40+15:31:32  10:10:06
    144 processes: 1 running, 143 sleeping
    CPU:  0.0% user,  0.0% nice,  0.0% system,  0.0% interrupt,  100% idle
    Mem: 2954M Active, 55M Inact, 1312M Wired, 392K Cache, 1054M Buf, 19G Free
    Swap: 4096M Total, 4096M Free

    PID USERNAME  THR PRI NICE  SIZE    RES STATE  C  TIME  WCPU COMMAND
    11618 root        1  44    0  443M  437M bpf    14 299:40  0.00% /usr/sbin/tc
    11844 root        1  44    0  5832K  1040K piperd  0  29:26  0.00% logger -t pf
    17762 root        1  44    0  5836K  1504K select  0  9:29  0.00% /usr/local/s
    38447 root        1  76  20  8292K  1736K wait    1  5:41  0.00% /bin/sh /var
    18125 root        1  44    0 14772K  2796K select  1  4:04  0.00% /usr/sbin/sy
    22358 root        1  44    0  9348K  2128K kqread 12  1:12  0.00% /usr/local/l
    58623 root        1  44    0 87700K 51424K nanslp  8  0:58  0.00% MailScanner:
    22543 root        1  44    0 25764K  6372K kqread  0  0:39  0.00% /usr/local/s
    35157 postfix    1  44    0 85652K 51100K nanslp  2  0:33  0.00% MailScanner:
    9765 postfix    1  44    0 85652K 51096K nanslp  8  0:33  0.00% MailScanner:
    56478 postfix    1  44    0 85652K 51100K nanslp  8  0:33  0.00% MailScanner:
    39386 postfix    1  44    0 85652K 51096K nanslp  8  0:33  0.00% MailScanner:
    16797 postfix    1  44    0 85652K 51092K nanslp  8  0:33  0.00% MailScanner:
    14133 postfix    1  44    0 85652K 51100K nanslp  2  0:33  0.00% MailScanner:
    52777 postfix    1  44    0 85652K 51096K nanslp  8  0:33  0.00% MailScanner:



  • If you installed with the uniprocessor kernel you will need to switch it to the SMP kernel:

    http://doc.pfsense.org/index.php/Switching_Kernels



  • Thank you all for the help - it was exactly what I needed.
    My Vm is now running 2 vcpu's and everything looks as it should.


Log in to reply