Laggy CLI since updating to 7.4.2 Topic is solved

Having issues with your DietPi installation or found a bug? Post it here.
Reds
Posts: 34
Joined: Thu Feb 20, 2020 5:59 pm

Re: Laggy CLI since updating to 7.4.2

Post by Reds »

I've done some more digging and this is a more low level issue than I thought. Its network packet loss. Running a ping alongside an SSH session, the SSH lag corresponds to the packet loss. Both my 2x Pi4 and 1 x86 box all connected to the same switch via ethernet. I have swapped out cables and the switch but this does not resolve the problem.

The root of the problem seems to be with Apps that are configured to use an NFS and/or SMB mount as their target directory or working directory. All works fine after a reboot but within hours, when these Apps start to use their network mounts, network connectivity starts to become intermittent and packet loss occurs. To be clear, this is not the Apps saturating the network link, the packet loss occurs when the Apps are idle and just polling the network mounts. Apps include nzbget, qbittorrent, PlexMediaCenter. If I stop these Apps using Dietpi-Services the packet loss is immediately gone. When I start them, the packet loss returns.


How best to proceed here?
User avatar
Joulinar
Posts: 5617
Joined: Sat Nov 16, 2019 12:49 am

Re: Laggy CLI since updating to 7.4.2

Post by Joulinar »

hmm would be good to know if and how the network interface is utilized. You could install a tool like iftop to get it displayed

Code: Select all

apt install iftop
iftop -n
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Reds
Posts: 34
Joined: Thu Feb 20, 2020 5:59 pm

Re: Laggy CLI since updating to 7.4.2

Post by Reds »

Eth0 is only about 3% utilised during the packet loss.

I've narrowed things down further:
  • On the x86 box qbittorrent is the culprit. If I stop the service the packet loss disappears. If it has no active jobs, there is no packet loss. As soon as you start a torrent with the default connection settings, the packet loss starts. I moved all Torrents activity off the NFS mount to a local disk and this did not make a difference. I found a guide on tuning the qBittorrent connections settings are now the packet loss is gone. Perhaps local system resources were impacted with the default Connection settings? .
  • On the Pi4, the culprit is PlexMediaServer. If I stop the service using Dietpi-Services, the packet loss disappears. If I restart it, the packet loss returns after about 20mins. PMS is configured to look at a locally mounted SMB share on a NAS for its content.
I'm still researching / troubleshooting this one.
User avatar
Joulinar
Posts: 5617
Joined: Sat Nov 16, 2019 12:49 am

Re: Laggy CLI since updating to 7.4.2

Post by Joulinar »

@MichaIng
Maybe you are interested in these interesting topic.

@Reds
strange behaviour, there needs to be something keeping your system busy :?

can you share your qbittorrent adjustments pls?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Reds
Posts: 34
Joined: Thu Feb 20, 2020 5:59 pm

Re: Laggy CLI since updating to 7.4.2

Post by Reds »

OK, I've got this sussed now. I don't know how or why this conflict exists but PMS likes to broadcast its presence on the LAN it's connected to on a regular basis. My Draytek Router has IGMP Snooping enabled. If I turn that off, all the packet loss problems are gone. Turn it back on, they return.

I don't know exactly what PMS is doing without reviewing a packet trace but its interfering with IGMP. Thankfully I don't need any IGMP so I've disabled it to resolve the issue.
Last edited by Reds on Wed Aug 18, 2021 3:35 pm, edited 1 time in total.
User avatar
Joulinar
Posts: 5617
Joined: Sat Nov 16, 2019 12:49 am

Re: Laggy CLI since updating to 7.4.2

Post by Joulinar »

probably something to ask PMS what they are doing?

Strange you are the only one reporting it as PMS is used by a larger amount of people. Probably it has something to do with your local IT (router)
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Reds
Posts: 34
Joined: Thu Feb 20, 2020 5:59 pm

Re: Laggy CLI since updating to 7.4.2

Post by Reds »

Yes, agreed. Not a DietPi / Debian problem. DrayTek routers are very feature rich afford enterprise like devices but I accept they are niche devices for use in the home. Scanning through the official Plex Forums, I can see IGMP mentioned a lot. Hopefully this thread will help others if they were to hit the same issue.
User avatar
Joulinar
Posts: 5617
Joined: Sat Nov 16, 2019 12:49 am

Re: Laggy CLI since updating to 7.4.2

Post by Joulinar »

I will mark one of your last statements as solution to make it clear for other where the challenge is coming from (even if not fully solved from our side)
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
MichaIng
Site Admin
Posts: 3212
Joined: Sat Nov 18, 2017 6:21 pm

Re: Laggy CLI since updating to 7.4.2

Post by MichaIng »

Interesting indeed. I just started to read a bit deeper into broadcast and multicast traffic when learning that DLNA (e.g. ReadyMedia) uses broadcast traffic and the question how to route such through a VPN for remote DLNA communication.

IGMP is a multicast group management protocol while Plex likely uses some mDNS (multicast DNS, like Avahi, using UDP port 5353) to broadcast its hostname, but that shouldn't interfere if an IGMP-capable router :?. A little search reveals that it also uses SSDP for local network discovery (also via multicast, via UDP port 1900, the same which DLNA uses, as UPnP, both are based on). And then probably Plex also has some video broadcasting features?

tcpdump could help to catch all packets, what is coming from where in which frequency. Probably there is some loop :?.
Post Reply