input lag, gaming while having other apps in background ?

Everything about latency. Tips, testing methods, mouse lag, display lag, game engine lag, network lag, whole input lag chain, VSYNC OFF vs VSYNC ON, and more! Input Lag Articles on Blur Busters.
Post Reply
mello
Posts: 251
Joined: 31 Jan 2014, 04:24

input lag, gaming while having other apps in background ?

Post by mello » 07 Nov 2017, 09:01

Just curious. Does anyone know if there is any measurable difference in input lag between these 2 scenarios:

- playing the game while all other apps are closed
- playing the game while having a lot of apps running in background

Of course the requirment is, no stutter, no fps drops and high or desirable fps are being maintained.
To be more specific i will use my case as an example. No actvity, game has not been launched yet, no mouse or keyboard input:

- CPU usage between 20-40% with occasional drops to ~15% and jumps to ~45%
- 160 processes in total (Firefox, 2xChrome, Thunderbird and some other apps, few of them taking all that CPU power all the time but all of them have process priority set to "Below Normal")
- 60-70% Physical Memory Usage (out of 32GB RAM)

Is there any negative impact in such a scenario ? Both in terms of total input lag and lag randomness ? In theory, it shouldn't be as long as there is no negative impact creating stutter, fps drops, and there are still CPU and RAM resources available at all times, right ?

User avatar
Chief Blur Buster
Site Admin
Posts: 11647
Joined: 05 Dec 2013, 15:44
Location: Toronto / Hamilton, Ontario, Canada
Contact:

Re: input lag, gaming while having other apps in background

Post by Chief Blur Buster » 07 Nov 2017, 10:39

The answer isn't an easy yes-vs-no. It can be yes, and it can be no.

The short answer is to be safe: Don't run too many background apps. Just in case.

Random CPU fluctuations (surges of background processing) will slow frame rate down in your foreground game, which means more lag -- almost everyone is familiar with lower framerates having more lag. More render per frame, more lag. Simple. And it can get annoying if you've got random stutters throwing off your aiming because a background virus scanner suddenly decided to begin scanning. Random stutters = random lag too.

But what's not so clear-cut is when everything is perfectly smooth. A game engine may be intentionally idling a bit of time for any reason (e.g. waiting for a disk access, or waiting for an input update). That's processor cycles that a background app can harmlessly use without slowing down a game. Big whoop, no problemo.

However, if a background task processes during a time when the game could be rendering instead, you may have just injected some minor lag without knowing it. Such as a web browser (displaying a game walkthrough FAQ webpage with a CPU-consuming advertisement) -- that's not a good idea to do during competitive gameplay. If you need to display a walkthrough on a 2nd monitor, try using Windows Notepad or some app that doesn't steal background cycles. Not important for offline RTS play. But could be bad for your competitive CS:GO or PUBG play to display a big browser window with lots of tabs on your 2nd monitor, unwittingly slowing your game down by 5% and adding lag randomness (caused by framerate randomization caused by random CPU cycles occuring in a browser window). Just best practices.

Generally, the answer is a yes-or-no. Hard to say. Just use common sense: Don't run too much stuff in background.

Simple troubleshooting can be done by using Windows Task Manager being displayed on a 2nd monitor while you play your game. Making sure they use 0.0% CPU when idling. A static Windows Notepad window is perfectly fine, if you're displaying a game FAQ document. But any app that uses big surges of CPU/disk access (random surges to a few percent or more) are undesirable. For example, sudden Dropbox random background syncing or a scanner app that likes to wake up too much during a game, etc. This usually doesn't matter in a fun game at home but you certainly don't want to worry about these at a professional CS:GO tournament.
Head of Blur Busters - BlurBusters.com | TestUFO.com | Follow @BlurBusters on Twitter

Image
Forum Rules wrote:  1. Rule #1: Be Nice. This is published forum rule #1. Even To Newbies & People You Disagree With!
  2. Please report rule violations If you see a post that violates forum rules, then report the post.
  3. ALWAYS respect indie testers here. See how indies are bootstrapping Blur Busters research!

User avatar
RealNC
Site Admin
Posts: 3741
Joined: 24 Dec 2013, 18:32
Contact:

Re: input lag, gaming while having other apps in background

Post by RealNC » 07 Nov 2017, 17:26

Active applications can have an effect on latency. "Sleeping" ones will not.

Background processes are usually in two states. "Active" and "sleeping."

Active ones will get CPU time from the operating system. That means the game can be frozen for a few milliseconds in order to give the other application some CPU time.

A sleeping process will not get CPU time (or will get very, very little of it.) A process is sleeping when it is doing nothing other than waiting for an event (like input from the user, or a signal from the operating system.) There's dozens of sleeping processes running in parallel by default on Windows (you can see them in the task manager.) But since they're sleeping only occasionally wake up, they don't have any effect on latency.

Active processes, however, can have an effect on latency. On multi-core CPUs, you're mostly still fine even with a few of them running. As you increase the amount of active processes however, there will be noticeable latency spikes.

Note that most active processes are switching between sleeping and active state very rapidly. Processes that are active 100% of the time are very rare, and are usually non-interactive processes that process a lot of data. Like a video encoder, for example. Most of the time, the CPU utilization of a process corresponds to the amount of time it's active. A 10% CPU use usually means that process is on average 10% of the time active and 90% of the time sleeping. This is a rough estimate, however.

TL;DR: Like Chief said, just don't run applications you don't need while gaming and you'll be fine. A media player and a browser are fine (usually, unless you have a "heavy" page open in the browser that can eat up CPU time). But don't have a dozen of apps open while playing. It's usually detrimental to performance and latency.
SteamGitHubStack Overflow
The views and opinions expressed in my posts are my own and do not necessarily reflect the official policy or position of Blur Busters.

mello
Posts: 251
Joined: 31 Jan 2014, 04:24

Re: input lag, gaming while having other apps in background

Post by mello » 08 Nov 2017, 05:04

Chief Blur Buster wrote: The short answer is to be safe: Don't run too many background apps. Just in case.
Just to be clear, gaming is only my side hobby, i play mainly for fun and have no aspirations and goals to climb the ladder and become a professional gamer. But that doesn't mean that i don't like to play competitively, at the matter of fact i do and i like to win. But i do many other things on my PC, besides gaming, things that are job related, and some other stuff that i do in my free time that is not related to gaming in any way. And because of that i don't like to close everything just because i want to play at a certain time, especially not when few apps are running on my PC 24/7 and they do use 20-40% of my CPU processing power at all times. Gaming is not the prority for me, but my performance when i game kinda is, so there is that.
Chief Blur Buster wrote: Random CPU fluctuations (surges of background processing) will slow frame rate down in your foreground game, which means more lag -- almost everyone is familiar with lower framerates having more lag. More render per frame, more lag. Simple. And it can get annoying if you've got random stutters throwing off your aiming because a background virus scanner suddenly decided to begin scanning. Random stutters = random lag too.
This is what happened long time ago when i bought i5 for the first time, which had 2 cores and 4 threads. I got stuttering and fps drops, because there were apps running in background that were taking too much CPU processing power. I quickly recognized the problem and bought i7-4790K basically when it came out. This was the best decision i could make at that time, because when i switched CPU it instanly fixed the problem, no more stuttering and fps drops.

This is also why i recommend CPU upgrade to people with stuttering problems. I am aware that there are people who turn on PC, launch the game, and turn PC off when they are done, these people might get away with CPUs with less cores and threads, but other people that do many other things on their PCs besides gaming will definitely benefit from more cores/threads.
Chief Blur Buster wrote: But what's not so clear-cut is when everything is perfectly smooth. A game engine may be intentionally idling a bit of time for any reason (e.g. waiting for a disk access, or waiting for an input update). That's processor cycles that a background app can harmlessly use without slowing down a game. Big whoop, no problemo.
This is exactly what i am interested in, gaming and having other apps in the background, but no stutter, no fps drops and high or desirable fps are being maintained.
Chief Blur Buster wrote: Generally, the answer is a yes-or-no. Hard to say. Just use common sense: Don't run too much stuff in background.
Thats what i thought. It looks like it may have some effect even if you don't really notice it, but there is definitely a breaking point when real problems starts to occur (stutter, fps drops = increased lag). I suspect the solution is simple, more cores/threads = the less chance for having an interference. My question is also partially related to things that i want to change. I know that, eventually, i want to change the CPU (probably not to 6/12 but to something with 8/16 cores/threads), although Devil's Canyon is still quite strong and good enough for my needs. On the other hand i am also thinking about having two seperate PCs, one strickly for gaming, and the other one for everything else that i do.

Also, i suspect that some streamers might have lag problems while gaming and streaming at the same time, so both of your answers might be somewhat helpful for them too.

Post Reply