[DRBD-user] Performance with DRBD + iSCSI (offtopic)

Leroy van Logchem leroy.vanlogchem at wldelft.nl
Thu Feb 22 15:47:34 CET 2007

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


> Read-ahead is tunable as above, write-back is handled transparently by
> the page cache, but can be tuned to a degree using VFS API features,
> mainly size is a concern, as if the write-back gets too big then there
> is a substantial performance penalty to other i/o ops in flight when it
> finally flushes.
>   
Since we're quite off-topic anyway, here's a small patch which enables 
Samba 3.0.x
to avoid filling the page cache while gig's of writes are flushed to the 
filesystem.
Without this patch a system would totally get stuck since it's expires 
all the most
valuable dentry, inodecache and shared libs if you write a larger then 
memory
file.

--- ./source/lib/system.c       2006-04-20 04:29:23.000000000 +0200
+++ ../samba-3.0.24-fadvised/./source/lib/system.c     2006-10-11 
16:23:41.000000000 +0200
@@ -102,6 +102,7 @@
        do {
                ret = write(fd, buf, count);
        } while (ret == -1 && errno == EINTR);
+       posix_fadvise(fd,0,0,POSIX_FADV_DONTNEED);
        return ret;
 }
 
@@ -142,6 +143,7 @@
                ret = pwrite(fd, buf, count, off);
 #endif
        } while (ret == -1 && errno == EINTR);
+       posix_fadvise(fd,0,0,POSIX_FADV_DONTNEED);
        return ret;
 }
 #endif

This avoids the 'substantial performance penalty' Ross referred to, at 
least for Samba.
For NFSd's I tuned the VM to flush early-and-often while holding on the 
imported
caches for as long as possible:
[sysctl kernel settings]
vm.vfs_cache_pressure = 1
vm.dirty_ratio = 2
vm.dirty_background_ratio = 1

--
Leroy



More information about the drbd-user mailing list