惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 叶小钗
爱范儿
爱范儿
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
博客园 - 聂微东
雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 三生石上(FineUI控件)
T
Tailwind CSS Blog
博客园 - Franky
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园_首页
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 司徒正美
月光博客
月光博客
大猫的无限游戏
大猫的无限游戏
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The Cloudflare Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理
宝玉的分享
宝玉的分享
罗磊的独立博客
Jina AI
Jina AI

LWN.net comments

tcmalloc's weird hack [LWN.net] Fixed? [LWN.net] mpd [LWN.net] Userspace AX.25 [LWN.net] RIP [LWN.net] My two cents... [LWN.net] pipx [LWN.net] Tragedy [LWN.net] A young man destined for glory [LWN.net] And 'less' won't let you search [LWN.net] A great loss [LWN.net] Sad and shocking news [LWN.net] Easy migration from Clementine [LWN.net] Sad coincidence [LWN.net] GNOME is actually usable thanks to Seth et al [LWN.net] Sad news :( [LWN.net] armhf supports preempt_rt [LWN.net] MusicBrainz accurracy [LWN.net] On open source maintainership [LWN.net] Let's stop here [LWN.net] Not a new thing [LWN.net] uv is indeed great pgmoneta Some comments on this on a Postgres blog feed [LWN.net] uv [LWN.net] going to Debian [LWN.net] Upgrading 64-bit-capable systems to 64-bit kernels? [LWN.net] Free Software foundations Maintainers can wait for code review but not for publish review? A reasonably extreme point of view [LWN.net]
Buffer Bloat - NFS style [LWN.net]
neilbrown · 2026-06-27 · via LWN.net comments

> .... but he thinks there needs to be a way for the virtual filesystem (VFS) layer to slow down writers. Neil Brown had told Lever that there already was a mechanism to do that.....

The VFS (or maybe the MM) estimates the throughput of each "backing device" and throttles writes when they risk using more than a fair share of the dirty threshold for that one backing device (slower devices get a smaller share). This, as Jan mentioned, works nicely for local applications.

It works for nfsd threads too in that they will be throttled, but they aren't the source of the problem, they are the messenger. If the NFS client keeps sending WRITE requests, more and more nfsd threads will be throttled trying to write, until we run out of threads. With the latest kernels we set a high limit and dynamically grow the thread pool to this limit, so this can be lots of threads each with (e.g.) 1MB of data being written. Once we run out of threads the receive-queue on the socket fills up, and if the client used "nconnect" there might be 16 sockets each of which will have a full receive queue. Then the xmit queues on the client will fill up. Then the applications on the client will start being throttled....

Or maybe the client-side applications will be throttled earlier. Data that hasn't been acknowledged as "safe" the server is accounted as dirty data on the client and should throttle the client application based on measured throughput.

So if the server has a larger dirty-threshold than the sum of the dirty thresholds for all the active clients, then the client applications should get throttled before the server hits the threshold and starts throttling nfsd threads. But if the clients have a larger total dirty threshold, then they will swamp the server's dirty pool and I guess that creates the situation that Chuck sees as problematic.

This feels a lot like "buffer bloat" which affected wifi and similar network links until it was fixed. As I understand it, the various buffers were much bigger than the link could handle in a "reasonable" time, much like the situation where the clients have more total buffer space than the server and generate more load than it can handle. The solution for buffer bloat was (I think) to better estimate end-to-end throughput and limit the total outstanding queue size. Possibly a similar solution would help NFS.

The current throttling is based on a number of bytes or fraction of available memory size. I have occasionally wondered if it would be better to limit it based on time-to-flush. As a throughput estimate is already available, we could limit the number of dirty pages for each "bdi" to the amount of memory which can be flushed in N seconds. When I first looked into the dirty threshold many years ago it was because NFS clients would take a very long to time to fsync a file, and it needs to do this to respond to "stat" - because to get an accurate mtime, it needs to flush pending writes, then ask the server what the timestamp is. So "ls -l" would take a very long time. The work-around was to reduce the dirty-threshold substantially. I really wanted to set a "maximum time that stat() is allowed to take" but I had to set a "maximum number of dirty bytes". If throttling was time-to-flush based, I would have been able to have more meaningful control...