wohali commented on issue #611: URL: https://github.com/apache/couchdb-documentation/issues/611#issuecomment-748535802
I read the links a bit more carefully, so I want to askare you sure this is a problem for btrfs? Have you seen a significant CouchDB performance change when altering the file setting? Alternatively, what does `filefrag` say on those files on a system that has been in production for a while? Unlike traditional SQL databases, CouchDB doesn't do random writes to its database files. It only ever appends to a file. (It is, in fact, a copy-on-write B-tree database itself, just like btrfs.) The link you gave suggests that this is only an issue for files that have lots of random writes. That never happens with CouchDB: it will only ever write to a disk block once. Also, compaction will rewrite the database and all of its views/indexes to new files when necessary. CouchDB 3.x has a fairly aggressive compaction setting, meaning databases will get compacted if they see a lot of writes anyway. In this scenario, given the entire database & index files are rewritten as part of compaction, I wonder how bad the situation really is. If this is really an issue (and I'm not saying it's not, I'd just like to be sure that it is), it is a pretty specific, narrow use case. In general, we don't detect or address this sort of thing automatically at installation or setup time. Given how long CouchDB's been around, and this is the first we're hearing of this, I'm guessing there's either not a problem (see above) or CouchDB+btrfs use in production is limited. (Most deployments I know of use ext4, xfs, or zfs.) ----- I would add this as a callout [at this line](https://github.com/apache/couchdb-documentation/blame/main/src/install/unix.rst#L161), just before the "Installation from source" section. You can use a warning box, [like this one](https://github.com/apache/couchdb-documentation/blame/main/src/install/windows.rst#L26). I would not include the entire script, especially not with all of the moves/etc. We like to treat our users as capable system administrators, it should be enough to provide the basics. So I would say something like: ``` *Note*: On btrfs, performance is improved by disabling copy-on-write for the ``data/`` directory. This is done by moving the old directory aside, creating a new one, then setting `chattr +C` on it. You may want to copy your databases and indexes back over, if you have any data to keep. ``` That's only suggested text, please rewrite however you see fit. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
