linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* very poor performance / a lot of writes to disk with space_cache (but not with space_cache=v2)
@ 2018-09-19  8:43 Tomasz Chmielewski
  2018-09-19  9:33 ` Qu Wenruo
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Tomasz Chmielewski @ 2018-09-19  8:43 UTC (permalink / raw)
  To: Btrfs BTRFS

I have a mysql slave which writes to a RAID-1 btrfs filesystem (with 
4.17.14 kernel) on 3 x ~1.9 TB SSD disks; filesystem is around 40% full.

The slave receives around 0.5-1 MB/s of data from the master over the 
network, which is then saved to MySQL's relay log and executed. In ideal 
conditions (i.e. no filesystem overhead) we should expect some 1-3 MB/s 
of data written to disk.

MySQL directory and files in it are chattr +C (since the directory was 
created, so all files are really +C); there are no snapshots.


Now, an interesting thing.

When the filesystem is mounted with these options in fstab:

defaults,noatime,discard


We can see a *constant* write of 25-100 MB/s to each disk. The system is 
generally unresponsive and it sometimes takes long seconds for a simple 
command executed in bash to return.


However, as soon as we remount the filesystem with space_cache=v2 - 
writes drop to just around 3-10 MB/s to each disk. If we remount to 
space_cache - lots of writes, system unresponsive. Again remount to 
space_cache=v2 - low writes, system responsive.


That's a huuge, 10x overhead! Is it expected? Especially that 
space_cache=v1 is still the default mount option?


Tomasz Chmielewski
https://lxadm.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-09-20 13:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-19  8:43 very poor performance / a lot of writes to disk with space_cache (but not with space_cache=v2) Tomasz Chmielewski
2018-09-19  9:33 ` Qu Wenruo
2018-09-19 12:00 ` Remi Gauvin
2018-09-19 17:58 ` Hans van Kranenburg
2018-09-19 20:04   ` Martin Steigerwald
2018-09-19 20:11     ` Hans van Kranenburg
2018-09-19 20:30       ` Nikolay Borisov
2018-09-20  0:55       ` Qu Wenruo
2018-09-20  7:46 ` Duncan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).