noauto_da_alloc anyone?

moxfan

Active Member
Aug 28, 2013
104
6
38
Never knew or heard about this switch for ext4 until now.

" Delayed allocation is used by write system call. It delays real block allocation until written data is flushed from memory to disk. Prevent file fragmentation and decrease CPU utilization. Suppress writes to temporary files which exist for short period. There is a trade-off between performance and reliability. There is a known-issue on data loss. If a crash occurs when created or truncated file is closed, or a file is renamed to replace the previous file, data may be lost. To avoid the issue, mount ext4 filesystem with “noauto_da_alloc” option. "

Code:
root@prox2:~# mount -o rw,nobarrier,relatime /dev/sdb2 /test2
root@prox2:~# pveperf /test2
CPU BOGOMIPS:      54277.60
REGEX/SECOND:      2688408
HD SIZE:           98.31 GB (/dev/sdb2)
BUFFERED READS:    156.89 MB/sec
AVERAGE SEEK TIME: 7.10 ms
FSYNCS/SECOND:     1852.49
DNS EXT:           45.66 ms
DNS INT:           1.09 ms
---
root@prox2:~# mount -o rw,nobarrier,relatime,noauto_da_alloc /dev/sdb2 /test2
root@prox2:~# pveperf /test2
CPU BOGOMIPS:      54277.60
REGEX/SECOND:      2618998
HD SIZE:           98.31 GB (/dev/sdb2)
BUFFERED READS:    157.14 MB/sec
AVERAGE SEEK TIME: 7.43 ms
FSYNCS/SECOND:     5231.46  <- Almost triple FSYNCS w/ noauto_da_alloc
DNS EXT:           32.68 ms
DNS INT:           1.03 ms
Do you guys use this switch?
 
i think the text is backwards, here the actual kernel documentation:
auto_da_alloc(*)
noauto_da_alloc

Many broken applications don't use fsync() when
replacing existing files via patterns such as
fd = open("foo.new")/write(fd,..)/close(fd)/
rename("foo.new", "foo"), or worse yet,
fd = open("foo", O_TRUNC)/write(fd,..)/close(fd).
If auto_da_alloc is enabled, ext4 will detect
the replace-via-rename and replace-via-truncate
patterns and force that any delayed allocation
blocks are allocated such that at the next
journal commit, in the default data=ordered
mode, the data blocks of the new file are forced
to disk before the rename() operation is
committed. This provides roughly the same level
of guarantees as ext3, and avoids the
"zero-length" problem that can happen when a
system crashes before the delayed allocation
blocks are forced to disk.

so setting noauto_da_alloc allows for some data loss because it does not force the commit of replace via rename patterns, so no wonder the fsyncs are way higher
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!