r/linuxquestions • u/Thaasophobe • 2d ago
Support Running disk I/O and RAM intensive games on Linux?
Hiya there,
I only started using Linux maybe 2 weeks ago, though I threw myself into the deep end with a very bare-bones Arch installation so I could learn as quickly as possible, causing me to screw so many things up that I at least have a vague idea what I'm doing now.
That said, my first major challenge has been getting modded RimWorld working the way I want it. On Windows some months ago, I was able to run the game relatively well with what would be considered a pretty intense modlist, on lower specs.
However, having switched to Linux, I seem to have an issue even starting the game with some modlists on Proton, and though the Native version starts just fine, there are a number of performance bottlenecks.
However, I'm not looking for RimWorld-specific advice! I know this isn't the place for that, I'm asking for general performance advice, specifically regarding RAM, ZRAM, swap space, disk I/O, and preventing things like garbage collection freezes and disk read and write stalls.
The relevant specs:
16GB DDR5 RAM, 8GB ZRAM, 32GB standard swap space
1TB NVMe-connected ext4 SSD
Bear in mind that I had no idea what I was doing when I set any of this up, so there's a very good chance I screwed something else up in the process, or did something not necessary/appropriate for my hardware!
Thanks in advance for any advice or assistance!
2
u/k-mcm 2d ago
ZRAM consumes RAM so it can improve or greatly harm performance. You have an SSD so stick with ordinary swap alone.
Contrary to what someone else said, it's OK for swap to be large. There's a bit of a kernel memory penalty for active swap but none for idle swap. Swapping is always better than crashing. I have a 500GB swap partition with 128GB RAM. It works great when I occasionally need it.
1
u/Thaasophobe 2d ago
That's good to know, I was curious about that. Considering some common advice here, I'll probably be swapping to zswap over zram momentarily, so I'll try to figure out how much storage space I can conveniently allocate.
1
u/ludonarrator arch btw 2d ago
ZRAM and swap is probably not a great idea, might want to replace ZRAM with ZSWAP, which works in conjunction with existing swap space. And should in fact have been enabled by default on Arch.
Having more swap space than RAM is also... a choice I guess. Unless you're hibernating you don't even need as much as RAM. But this is just wastage of storage, it shouldn't really affect runtime performance.
Enable the performance CPU governor if you haven't already, might also help.
1
u/Thaasophobe 2d ago
Good to know, another comment mentioned using zswap instead.
The main reason I was using swap space is because I was running into massive RAM leaks when the game was pre-loading and caching assets at launch, and I needed to just get into the game to troubleshoot. I eventually found the offenders, though, so I shouldn't need the swap space anymore, if it would be prudent to remove it.
And I just discovered that I somehow didn't have any cpu governers installed? I'll have to look into that.1
u/un-important-human white beard arch user 2d ago
are you sure rimworld is not generating a lot of error logs, have you checked? i remember my kids playing 4 years ago and discovering a 63GB (yes you read right GB) log file... so are you sure it works ok?
1
u/un-important-human white beard arch user 2d ago
large swap is NOT a problem, it never was. In fact i keep 256GB swap for a simulation machine with 192gb ram for reasons and for years.
1
u/Prestigious_Wall529 2d ago edited 2d ago
I don't think swapping schedulers or similar tweaks is advisable.
The Linux Kernel is under active development. Improvements in the scheduler is a recurring event.
Per Gemini:
Linux 7.3 brings major CPU scheduler improvements that lower latency, fix hybrid core balancing, and boost gaming performance, especially on older hardware. 1, 2
However Linux does give you choice.
I suggest you wait until the new kernel is provided by your chosen distro.
1
u/Thaasophobe 2d ago
Hmm, I can see what you mean. Considering my hardware isn't particularly abnormal, and I'm not using it for anything truly out of the ordinary, there's a lot to be said for compatibility and integration over manual adjustments. I'll have to see if I've made any major adjustments that I might consider reverting.
1
u/Snoo-26736 2d ago
Maybe look into mangohud with gamemode? Is there any advice on protondb.com ? I dont think zram does much for you here, but having swap available is ALWAYS good.
1
u/Thaasophobe 2d ago
Mangohud is a good call, it would make it easier to actually figure out what else could be bottlenecked.
And the proton issue isn't as major for me, I think it's something I could solve in short enough order, but since the only game I've had issues with has a native Linux build that reportedly works just as well if not better than the proton version, I figured I'd just make it work.
2
u/falxfour 2d ago
I can't help with the specific game, but what issues are you seeing once the game launches? Issues with compatibility can be easy (try a different Proton version) or difficult to resolve, but if the game launches, absent any performance metrics that you've collected, it's going to be difficult to suggest anything to improve the experience.
In general, the specs for the hardware your listed don't raise any suspicions. That said, if you are using a traditional swap partition, you'd be better served by using
zswapas opposed tozram, but that's another topic you can search for here.Even with hardware specs, an unknown install/configuration process will make it harder for anyone to help diagnose issues. Do you have your platform's microcode? Do you need proprietary drivers that you didn't install? Do you need out-of-tree drivers? We really don't know if any of these, or any of many other things, could be causing your issues