From 3b23f9acae02e6be192c00fc410a4d15974f5343 Mon Sep 17 00:00:00 2001 From: Brian Foster Date: Tue, 2 Jul 2013 10:47:00 -0400 Subject: performance/readdir-ahead: introduce directory read-ahead translator This is a translator to improve the performance of typical, sequential directory reads (i.e., ls). readdir-ahead begins preloading the contents of a directory on open and serves readdir requests from the preloaded content. readdir-ahead is currently implemented to only handle the single threaded directory read case. readdir-ahead is currently disabled by default. It can be enabled with the following command: gluster volume set readdir-ahead on The following are results of a getdents test on a single brick volume. Test info: - Single VM, gluster client/server. - Volume mounted with native client using --gid-timeout=2. - getdents on single directory with 100k 0-byte files. Test results: - !readdir-ahead read 3120080 bytes from offset 0 3 MiB, 4348 ops, 0:00:07.00 (416.590 KiB/sec and 594.4737 ops/sec) - readdir-ahead read 3120080 bytes from offset 0 3 MiB, 4348 ops, 0:00:03.00 (820.116 KiB/sec and 1170.3043 ops/sec) BUG: 980517 Change-Id: Ieceb9e1eb47d1d5b5af8da2bf03839537364653f Signed-off-by: Brian Foster Reviewed-on: http://review.gluster.org/4519 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- tests/features/readdir-ahead.t | 44 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 tests/features/readdir-ahead.t (limited to 'tests') diff --git a/tests/features/readdir-ahead.t b/tests/features/readdir-ahead.t new file mode 100755 index 000000000..c7ee637f0 --- /dev/null +++ b/tests/features/readdir-ahead.t @@ -0,0 +1,44 @@ +#!/bin/bash +# +# Test basic readdir-ahead functionality. Verify that readdir-ahead can be +# enabled, create a set of files and run some ls tests. +# +### + +. $(dirname $0)/../include.rc + +cleanup; + +TEST glusterd + +TEST $CLI volume create $V0 $H0:$B0/$V0 +TEST $CLI volume start $V0 + +TEST $CLI volume set $V0 readdir-ahead on + +TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 $M0 + +TEST mkdir $M0/test +for i in $(seq 0 99) +do + touch $M0/test/$i +done + +count=`ls -1 $M0/test | wc -l` +TEST [ $count -eq 100 ] + +count=`ls -1 $M0/test | wc -l` +TEST [ $count -eq 100 ] + +TEST rm -rf $M0/test/* + +count=`ls -1 $M0/test | wc -l` +TEST [ $count -eq 0 ] + +TEST rmdir $M0/test + +TEST umount -l $M0; +TEST $CLI volume stop $V0 +TEST $CLI volume delete $V0 + +cleanup; -- cgit