How do I disable hyperthreading?

AiroSam

New Member
Jan 13, 2021
13
0
1
30
Proxmox VE 6.3-3
Dell PowerEdge R630
Intel Xeon Processor E5-2680 V3

Typing lscpu in Shell shows 2 Thread(s) per core. I'd like it to be just 1. I'm running a RouterOS VM and I've seen a lot of suggestions to disable hyperthreading to improve CPU efficiency.

Thanks for your time!
 
Last edited:
Hi,

you can add nosmt (or even nosmt=force) to the kernel command line on boot.
https://pve.proxmox.com/pve-docs/chapter-sysadmin.html#sysboot_edit_kernel_cmdline

Alternatively you may disable it on an already booted system by writing to /sys/devices/system/cpu/smt/control, e.g.:

Bash:
echo off >/sys/devices/system/cpu/smt/control
# check if succeeded
cat /sys/devices/system/cpu/smt/control
(above off can be replaced by forceoff if not working, may give you some hiccups as the kernel needs to schedule away some threads)
 
Last edited:
Hi,

you can add nosmt (or even nosmt=force) to the kernel command line on boot.
https://pve.proxmox.com/pve-docs/chapter-sysadmin.html#sysboot_edit_kernel_cmdline

Alternatively you may disable it on an already booted system by writing to /sys/devices/system/cpu/smt/control, e.g.:

Bash:
echo off >/sys/devices/system/cpu/smt/control
# check if succeeded
cat /sys/devices/system/cpu/smt/control
(above off can be replaced by forceoff if not working, may give you some hiccups as the kernel needs to schedule away some threads)

Am I correct to assume that using the echo off >/sys/devices/system/cpu/smt/control code will not force the node to still have smt disabled after a reboot? The only way to do that is to use the kernel command line on boot?
 
Am I correct to assume that using the echo off >/sys/devices/system/cpu/smt/control code will not force the node to still have smt disabled after a reboot? The only way to do that is to use the kernel command line on boot?
yes, changes using the /sys interface are only applied to the current boot and lost on reboot.

Using the command line thing makes it permanent, alternatively you could use a startup script to write to the /sys path.
 
yes, changes using the /sys interface are only applied to the current boot and lost on reboot.

Using the command line thing makes it permanent, alternatively you could use a startup script to write to the /sys path.

I see. What if I was to just disable Hyperthreading in the Dell BIOS? Would that have any averse side effects within Proxmox?
 
Sorry for hijacking this thread, but as the OP seems to use a Mikrotik CHR and solve performance problems I'd like to jump in and ask pretty much in the same direction. We tried some CHRs in our setup and they are aweful in terms of performance. Even with their P-Unlimited license they are not able to follow a 1 GBit/s virtual interface which is used to around 100-200 MBit/s _in one direction_ (the other almost "empty" with around 10 MBit/s).
We tried just about everything thinkable, 8 vCPUs, CPU affinity for exclusive CPU usage and the like. But simply they have just bad performance. I wonder if there is anybody here having a CHR with consistent routing performance of above 200 MBit/s with no RX-drops on the interfaces. Ours is a setup without any firewall rules. We see no reason for this behaviour aside completely incompetent programming on Mikrotik side.
Standard linux guests with old and new kernels have no problems at all, of course.
 
  • Like
Reactions: AiroSam

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!