Sample Header Ad - 728x90

Limit file IO speed

12 votes
4 answers
1499 views
I am looking for a command similar to ionice and trickle and pv -L and tc - but which puts limits on IO to files. ionice looks at block devices on the local machine. I want this to work for file I/O in general. If it does not work for encfs mounted on NFS it is useless to me. trickle shapes the network I/O - not the file system I/O. So if my program accesses a file on encfs, it will have no clue whether this is mounted on top of NFS or a local dir. tc is similar to trickle: It shapes network I/O - not file system I/O. pv -L only works on pipes. I need it to work on all files that the program opens. Think Firefox: It opens files for read and write in multiple threads. I want this: thecommand --read 5M --write 1M firefox to limit firefox to read files at 5 MB/s and write at 1 MB/s. firefox is just an example: I want it to work for any program that opens different files for both reading and writing. I want the limitation to work no matter if firefox is accessing a local file or a file on NFS/tmpfs/encfs/SSHFS/RandomFS. It is OK if it only works on dynamically linked programs (i.e. it is OK if it does some LD_PRELOAD magic). Does such a beast exist?
Asked by Ole Tange (37348 rep)
Oct 7, 2024, 09:18 PM
Last activity: Dec 30, 2024, 10:47 PM