My software RAID can write 800 MB/s sustained. I see that happening when cat /proc/meminfo |grep Writeback:
returns > 2 GB. However, most of the time the writeback is round 0.5 GB which gives a performance around 200 MB/s.
There is plenty of data to be written. cat /proc/meminfo |grep Dirty:
says the dirty cache is 90 GB.
As I understand Dirty is what needs to be written, whereas Writeback is what is actively being written to disk. So there may be blocks in Dirty that are located on the disk just next to blocks in Writeback, and these will not be written in the same go.
This can explain why I get much worse performance if Writeback is small as the time spent seeking is much longer that the time spent writing a few extra MB.
So my question is: Can I somehow tell the kernel to move more data from Dirty to Writeback more aggressively and thus increase Writeback?
-- Edit --
This is during low performance:
$ cat /proc/meminfo
MemTotal: 264656352 kB
MemFree: 897080 kB
Buffers: 72 kB
Cached: 233751012 kB
SwapCached: 0 kB
Active: 3825364 kB
Inactive: 230327200 kB
Active(anon): 358120 kB
Inactive(anon): 47536 kB
Active(file): 3467244 kB
Inactive(file): 230279664 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 204799996 kB
SwapFree: 204799996 kB
Dirty: 109921912 kB
Writeback: 391452 kB
AnonPages: 404748 kB
Mapped: 12428 kB
Shmem: 956 kB
Slab: 21974168 kB
SReclaimable: 21206844 kB
SUnreclaim: 767324 kB
KernelStack: 5248 kB
PageTables: 7152 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 337128172 kB
Committed_AS: 555272 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 544436 kB
VmallocChunk: 34124336300 kB
HardwareCorrupted: 0 kB
AnonHugePages: 0 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
DirectMap4k: 149988 kB
DirectMap2M: 17649664 kB
DirectMap1G: 250609664 kB
cat /proc/sys/vm/dirty_background_ratio
1
Lowering dirty_writeback_centisecs only chops up Dirty in even smaller bits.