I have two different Linux desktops connected to a Synology NAS like so:  /chronicle        nfs rw,hard,intr 0 0

and I am frequently seeing my computer locking up entirely, with the system monitor showing IOWait which is apparently blocking. For instance, a movie playback will freeze, but (most of the time) I can still quit VLC and restart it. I could also copy the movie file to my local SSD, which would (a significant amount of the times I've tried) have pauses in the transfer while doing this IOWait thing. If I do things not involving the NAS share, I'm generally also not experiencing any freezing.

I've tried figuring out why, but I don't understand the man pages and other resources regarding IOWait, poll, and epoll.

What can I do to identify and resolve this issue?

Partial screen dump of my process list


IOWait is not necessarily blocking, but the process doesn't have anything else to do except wait for I/O. A common code pattern is to do file I/O in a non-blocking fashion and then do some other processing while waiting for that to happen. But eventually, you run out of things you can do, so you run poll(2) to look for any of the non-blocking I/O you've requested, which shows up as SyS_poll on your top output. Or you might call epoll(2), which has a different interface, with a more involved setup, but it provides more focused output. Or you might call select(2), which is an older implementation of the concept, but uses a different structure for selecting which file descriptors are being watched. If your file descriptors to watch all have relatively low numbers, select can be more efficient to call than poll. But if your file descriptor set to watch is sparse, or includes some file descriptors that have a high enough number to be unwieldy to select, poll or epoll will be better, depending on whether or not you are watching enough things to merit the setup work of epoll.

Basically, this just means something about your NAS activity is slow, relative to the amount of work that is being requested of it. Assuming that this is all in a localized area (like your house), my first thought would be could your NAS be having some kind of a drive failure? RAID2 through RAID 7 are known for having degraded performance if one of the drives have failed. RAID 6 and RAID 7 are known for having severely degraded performance if two drives have failed.

It's also possible you have some networking misconfiguration. I don't know if network port mismatches are still a thing, but back when I was actually current on networking matters, it was common for autonegotion to fail, such that one device was set to half duplex and another device was set to full, and there would be collisions and network transmission errors as a result.

ifconfig -a

will show how many network errors a unix or Linux box has seen. On Linux, this is the last line of output for each interface. All of the numbers on that line should be 0. If the numbers on that line are increasing relatively rapidly, then you have a significant network problem.

Also, are all of the devices communicating at the full speed of your network? If it's a wired network, fast Ethernet is no longer something we consider fast; most devices these days want to transfer at gigabit speeds or faster. If it's wireless, https://en.wikipedia.org/wiki/IEEE_802.11 tells me that we're now up to 802.11ax. I think my network's a couple versions behind, but it's still fast enough I don't notice it since I don't stream things. But you are, so it's probably a good idea to make sure all of your devices are talking the same speed. That includes the router, even though that's often an overlooked device in a wireless network (at least in my experience - my extended family members don't plug into it so they don't think about it.)

  • But still, hanging video playback for maybe half a minute every 10 or so? That's a lot of waiting. – KlaymenDK Feb 8 at 4:10
  • The CPU load on my NAS is almost nothing, and I did just replace all the drives because of a previous suggestion about a drive failure not showing up on SMART health checks. Obviously, that didn't solve the problem. Also, when not waiting, performance is excellent. – KlaymenDK Feb 8 at 4:12
  • @EdGrimm the difference between poll() and epoll() is not that epoll() is also able to "look for other activity" (both epoll and poll have support for triggering on errors, hangup and urgent data) but the fact the epoll also has a "level triggered" mode and that the programming interface is much nicer and scales much better. inotify(7) is kind of an epoll() able to watch other events than i/o. – Uncle Billy Feb 8 at 4:24
  • @KlaymenDK That's nothing wrong with those poll, epoll and io waits. I suspect a flaky network connection to the NAS or misconfigured nfs for your problems. – Uncle Billy Feb 8 at 4:30
  • @EdGrimm and of course all of select(), poll() and epoll() are able to watch for "network connection request" (which appear as a POLLIN/read event on a listening socket) – Uncle Billy Feb 8 at 4:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.