Solved : The Pernicious USB-stick stall problem - Ubuntu 22.04.05 to some extent.
Plugging in a slow storage device ( a USB stick ) into a Linux machine ( Ubuntu 22.04.05 ) and writing a lot of data to it ( copying an .iso file ). The entire system hangs and the speed of transfer decreases and after some time it halts.
This problem persists today also because the Linux Kernel is busy in matching the rate of creating the dirty memory to the rate at which the memory is writing on the storage device. And when the sync() function is called the kernel, things stop until the entire queue is written. Ultimately resulting in slow transfer rate and system hang.
To prevent it from happening, Linux Dev's have created a set of tweakable knobs under /proc/sys/vm to control what happens when processes create a lot of dirty pages. These knobs are:
领英推荐
Adjusting limits by byte-based threshold :
After these changes i was able to get a constant speed of 5.4 MB/sec. And less halting in a 16GB ram system.