NetworkManager and intermittent lags in Steam Home-streaming

Steam in-home streaming is great. I can play graphics/CPU intensive games on my laptop sitting on my couch. Or I can let the (Windows) laptop run Spelunky while playing at my linux desktop. But I had a problems with it: I kept getting intermittent lagging. A little notice would pop up in the bottom left corner informing me of slow network speeds. Both machines are on wifi for network and so I thought putting the laptop on ethernet would solve the issue. Halving the strain on the air waves should do the trick but it made no difference. Which meant that the problem was likely to be on the linux desktop and it’s wireless connection.

Now, the most characteristic thing about the lags was the regularity with which they occured. I didn’t measure them but I started thinking to myself, “It’s gonna come any minute now…” About every two minutes for ten seconds or so. More than enough to get yourself good and killed in Spelunky. I tried network monitoring to see if I could catch whatever process was stealing Steam’s bandwidth but with no luck.

The reason for this is that it wasn’t a process hogging bandwith per se, it was NetworkManager scanning for networks. This happens at some specific interval and tends to cause a drop in bandwidth, something that is most noticeable in live streaming.