Skip to content

NFS connection freezing every few seconds

I have 2 Arch boxes on my network. One is my personal rig, the other is my NAS among other things. I have set an NFS server on the NAS that I access with my PC.

Whenever I'm playing a video file, or sometimes just even browsing files on the server, the connection seems to freeze for a few seconds, subsequently freezing every program that is reading files off of the server, (dolphin, mpv, terminals, etc). This repeats every few seconds, to the point that I'm unable to stream anything from the server.

I'm not 100% sure but I think the problem is much more pronounced when I'm doing things that demand high bandwidth (streaming, copying, etc).

The connection between the 2 machines is gbit ethernet.

I have not been able to replicate the behaviour on my laptop (also Arch), over 5G wifi.

An sshfs connection is perfectly stable, so it's probably not a network issue.

systemctl/journalctl/dmesg provide no hints on either the server or the PC.

The NFS configs

/etc/fstab - Server

# /dev/md127
UUID=9001b3fd-9fe6-40d2-bd21-7238ff55c061   /mnt/Achne  ext4    rw,auto 0 2


/mnt/Achne  /srv/nfs    none    bind    0 0

/etc/exports - Server

/srv/nfs        *(rw,sync,no_subtree_check)

/etc/systemd/system/mnt-Achne.mnt - PC

[Unit]
Description=Mount Share at boot

[Mount]
What=192.168.1.3:/srv/nfs
Where=/mnt/Achne
Options=
Type=nfs

[Install]
WantedBy=multi-user.target

Can anybody help me debug this thing? It's been bugging me for weeks.

I used to run OMV5 on the server, until a power failure ruined the boot drive, so I thought I'd switch to Arch since I'm more familiar with it...

IIRC I didn't really change mnt-Achne.mnt, beyond changing the What. So I didn't have any fancy options enabled with OMV. Maybe OMV sets some server-side options that I don't know about.

13 points20 comments
Open on Reddit
About this post
Posted
Archived
Score
13 · 89% up
Kind
Text
ID
pc11ik

Author

6
posts
61
comments
0
media
View profile

20 comments

I have a bug/ticket open on a possibly similar issue - https://bugs.archlinux.org/task/71775 . Been getting some help from linux kernel devs to look at it some as well, but so far no solution. If you feel it's similar to my issue, please chime in and "vote" it up so it can get more attention.

You can try downgrading to a 5.12.x kernel to see if that resolves the issue as well (it seems to be a 5.13 kernel issue for me). To do that you would run the following:

pacman -U https://archive.archlinux.org/packages/l/linux/linux-5.12.15.arch1-1-x86_64.pkg.tar.zst https://archive.archlinux.org/packages/l/linux-headers/linux-headers-5.12.15.arch1-1-x86_64.pkg.tar.zst
5 points

Ok, seems like downgrading the server has indeed fixed the issue, though I'll try it some more in half an hour, sometimes it doesn't show immediately after a reboot.

But I think this might be the longest already so far, so it looks like the kernel is indeed the culprit.

3 points

That definitely sounds like my issue, I'll try the downgrade.

2 points

For those interested, there is 2 patches for the 5.13 kernel that seem to resolve the issue for me. They are linked from the archlinux bugtracker link above. I have also shared a kernel package there that includes both of the fixes which I am testing now.

2 points

why bind mount and not exporting /mnt/Achne directly

2 points

Good question. Don't remember. Let me try the direct method.

2 points

reading the wiki I was somehow tempted to think that only dirs under /srv are exportable, which was of course not true

2 points

Nope. It fixed it at first, but after 2-3 minutes, same thing.

Same things happens when I reboot btw.

2 points

Yeah, I had some problems with NFS (on an OMV server, not Arch, but I don't think that matter much, honestly) on my LAN as well but this setup (in combination with autofs) has proven to be very reliable over the past year or so.

2 points

I don't think any of that helps me unfortunately.

ID mapping isn't an issue since I've managed it manually(by changing UIDs & GIDs).

And autofs takes care of discoverability and mounting when needed if I understand correctly, neither of which are an issue for me.

My woes begin after mounting is done.

Still, thank you for taking the time. And seeing other people's configs might actually help me.

2 points

try disabling mnt-Achne.mnt and mounting the NFS drive manually for once, to make sure it ain’t a systemd bug?

2 points

Is it possible to run a tcpdump/wireshark capture on the NAS (ssh+tmux) or on the PC and see if there are any nfs-related packets being transferred at all during the freeze?

2 points

Wireshark shows a [TCP Retransmission] from the PC at the time of failure, and an [ACK] from the server, nothing more until it unfreezes.

I don't know what to do with that information.

2 points

Can’t guarantee to be able to decipher, but does it help if you post a rough screenshot of the capture?

2 points

take the risk and *(...async...)
unlikely to work though, since streaming reads a lot yet hardly writes anything, but might worth a try

kernel culprit, dismiss

2 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.