19
submitted 2 days ago* (last edited 2 days ago) by bjoern_tantau@swg-empire.de to c/linux_gaming@lemmy.world

I'd like to disable some services that might decrease my gaming performance while a game is running. Stuff like search indexing, automatic updates, filesystem tasks.

Has anyone done something in that direction?

My spontaneous idea was to use gamemode to switch to a systemd target that disables those services. Although I'm not sure if systemd targets actually can disable services or if they can only start them. Might also be a little overengineered.

If I don't get a better idea I will just run a start and stop script with gamemode to handle all that. Although I'm not sure if that would be able to stop system services. Will cross that bridge when I get there.

Edit: While I can automatically stop services by starting a target they aren't started again after stopping the target. I guess I will just use some simple start-gaming and stop-gaming scripts.

top 10 comments
sorted by: hot top controversial new old
[-] Zaphod@discuss.tchncs.de 11 points 2 days ago

I don't think we have any of those things Linux, that's why we're there. Except file indexing, but I only know of Baloo which is annoying if you're on KDE. But i can be easily turned off

[-] sugar_in_your_tea@sh.itjust.works 11 points 2 days ago

Automatic updates are absolutely a thing on some distros, but you can change the schedule to be outside your gaming time.

[-] moody@lemmings.world 11 points 2 days ago* (last edited 2 days ago)

outside your gaming time.

I know all those words, but they don't make sense in that order

[-] bjoern_tantau@swg-empire.de 3 points 2 days ago

I have made a service for automatic updates and deduplication myself. And if someone uses their gaming rig for something like database programming they could use this to start and stop a heavy database as well.

Linux is as light or heavy as you want it to be.

[-] BrianTheeBiscuiteer@lemmy.world 3 points 2 days ago

As far as base services go Linux doesn't really have that many that would be resource hogs.

For giving CPU preference to your game you can use nice. For keeping pages of memory from being invalidated you could maybe use mlock but I have no experience with that tool. Unnecessary use of the GPU would probably be the biggest drag. For your distro or desktop environment you should see if it has a "game mode" or any settings you can toggle that normally use the GPU.

[-] bjoern_tantau@swg-empire.de 1 points 2 days ago

gamemode is a simple program to do all that stuff for you. Calling it is built into some games like those by Feral Interactive. And it is available in game helpers like Heroic and Lutris.

It also has the ability to run custom commands when starting and quitting your games. I'll be using those.

[-] prole 1 points 2 days ago

Bazzite runs gamemode by default

[-] maxwellfire@lemmy.world 2 points 2 days ago* (last edited 2 days ago)

I think if you switch back to the original target that depends on those services they should start again?

Like systemctl isolate yourtarget.target and then a systemctl isolate graphical.target to return to normal operation

Isolate will stop any services that aren't required by the dependency chain.

Some of these might be user services though, in which case you'd need to create a user target

It's possible that you don't need to use isolate though, and can just start a target that conflicts and then instead of stopping it, start graphical.target

[-] bjoern_tantau@swg-empire.de 2 points 2 days ago* (last edited 2 days ago)

Yes, you're right!

In my case starting timers.target stops my gaming.target and restarts all the timers gaming.target had stopped.

Edit: I don't want to use isolate because I'd rather blacklist the services I don't want.

[-] maxwellfire@lemmy.world 2 points 2 days ago

Sorry for the series of edits. Yeah, just starting timers.target or graphical.target again when you're done without using isolate seems like a pretty good strategy!

this post was submitted on 30 Apr 2025
19 points (100.0% liked)

Linux Gaming

18242 readers
380 users here now

Discussions and news about gaming on the GNU/Linux family of operating systems (including the Steam Deck). Potentially a $HOME away from home for disgruntled /r/linux_gaming denizens of the redditarian demesne.

This page can be subscribed to via RSS.

Original /r/linux_gaming pengwing by uoou.

No memes/shitposts/low-effort posts, please.

Resources

WWW:

Discord:

IRC:

Matrix:

Telegram:

founded 2 years ago
MODERATORS