Return to

Attempted to increase performance, managed to decrease it instead

I feel like I need some adult supervision here.

Out of the box the VM performance was acceptable, however in cpu intensive games I’m losing a lot of frames compared to bare metal. So, I started to look for solutions.

CPU pinning was easy enough, but if anything performance dropped (I’m using userbenchmark to compare my results).

I had a hard time wrapping my head around hugepages. I set the kernel parameters:

default_hugepagesz=1G hugepagesz=1G hugepages=16

and I stumbled upon this guide:!pages/
However I’m not really sure if those scripts work, there certainly was no discernible difference in performance.

cat /proc/meminfo | grep Huge
AnonHugePages:         0 kB
ShmemHugePages:        0 kB
FileHugePages:         0 kB
HugePages_Total:      16
HugePages_Free:       16
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:    1048576 kB
Hugetlb:        16777216 kB

I also added <feature policy='require' name='topoext'/> under cpu in the configuration guide.

qemu in /etc/libvirt/hooks
vm-mem-requirements in /etc/libvirt/hooks

2700x (stock)
32GB RAM, split between Guest and Host
1660Ti - Guest
RX 570 - Host

If anyone could enlighten my dumb ass about all this I would appreciate it a lot.
Btw people have already helped me a lot on this forum and I love you all.

1 Like

I’ve done some further testing and it turns out the <feature policy='require' name='topoext'/> line was to blame for the performance loss. This is quite strange as it is suggested to use this in order to enable AMD Hyperthreading.

Then again it didn’t make much sense to me in the first place since SMT seemed to be working out of the box anyway.

I still don’t know why the isolation script doesn’t work. I definitely don’t want to use the static isolation with kernel parameters, since most of the time I am not using the VM.

1 Like

Welcome, to the latest entry in my blog post of incompetence.

I got the isolation hook to work by uninstalling cpuset and installing cpuset-git from the aur. When the VM is started, all the host processes are moved to cores 0-3, the VM claims the rest and I’m a happy camper, right?

Well no. Somehow the host processes still impact the guest. Watching a 1080p stream on a second monitor makes Insurgency Sandstorm nearly unplayable, with stuttering and fps drops under 60 (with no load on the Host I get a solid 100+ fps).

I don’t really know how to proceed. I’m thinking, maybe it’s PCI-E lane related? Then again, I don’t actually know anything about PCIE lanes or how they work so :slight_smile:

Also, I think the information in my previous post is wrong. I have performance all over the place and It’s likely that I simply misinterpreted the topoext line as a culprit off of one data point.


I went and did some more testing. Instead of a twitch stream (which puts the 4 host processors around 30% each), I hit them with stress --cpu 4 which put them at 100% while playing Insurgency.

I dropped about 15 frames but I was still able to play and it was not nearly as bad as the twitch stream. What does it mean :thinking:

1 Like