webcache performance degradation

I see an interesting slowdown in webcache speed as it fills up eg to 1GB from 8GB, as tested with RouterOS v6.6 on a RB951G with a ‘fast’ USB3 stick (obviously operating at USB2 speed; it can maintain 75MB/s read and 18MB/s write).

The slowdown manifests as large latency spikes of 1000-4000ms, which sounds like it relates to webcache management behaviour over the filesystem, over USB.

If the webcache process is open-source, I may have a look at producing a stand-alone reproducer and see if I can optimise performance and send some patches to the upstream maintainer. Normis, what mount options and IO scheduler are used internally for USB disks formatted in RouterOS?

If ext4, journal_async_commit eliminates the need for double barriers, which is expensive on flash; at a higher-level, F2FS is optimal for managed flash and behaves well on rotational media also.