summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMohit Agrawal <moagrawal@redhat.com>2019-12-19 08:32:19 +0530
committerXavi Hernandez <xhernandez@redhat.com>2020-04-06 10:43:26 +0000
commitf2d90013aaa4652dbcc1e6e3d62a0d31ada89d5d (patch)
tree6a7fc163392ab73d05204c0d7b9fc333135cc062 /tests
parent28299f7852229be333102e08aae9b7fd4ad3338a (diff)
Posix: Optimize posix code to improve file creation
Problem: Before executing a fop in POSIX xlator it builds an internal path based on GFID.To validate the path it call's (l)stat system call and while .glusterfs is heavily loaded kernel takes time to lookup inode and due to that performance drops Solution: In this patch we followed two ways to improve the performance. 1) Keep open fd specific to first level directory(gfid[0]) in .glusterfs, it would force to kernel keep the inodes from all those files in cache. In case of memory pressure kernel won't uncache first level inodes. We need to open 256 fd's per brick to access the entry faster. 2) Use at based call's to access relative path to reduce path based lookup time. Note: To verify the patch we have executed kernel untar 100 times on 6 different clients after enabling metadata group-cache and some other option.We were getting more than 20 percent improvement in kenel untar after applying the patch. Credits: Xavi Hernandez <xhernandez@redhat.com> Change-Id: I1643e6b01ed669b2bb148d02f4e6a8e08da45343 updates: #891 Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/basic/ec/gfapi-ec-open-truncate.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/basic/ec/gfapi-ec-open-truncate.c b/tests/basic/ec/gfapi-ec-open-truncate.c
index 22f17f436b6..fb16807003a 100644
--- a/tests/basic/ec/gfapi-ec-open-truncate.c
+++ b/tests/basic/ec/gfapi-ec-open-truncate.c
@@ -150,7 +150,8 @@ main(int argc, char *argv[])
for (i = 0; i < 20; i++) {
ret = system(
"[ $(for i in $(pgrep glusterfsd); do ls -l /proc/$i/fd | grep "
- "\"[.]glusterfs\" | grep -v health_check; done | wc -l) == 3 ]");
+ "\"[.]glusterfs\" | grep -v \".glusterfs/[0-9a-f][0-9a-f]\" | grep "
+ "-v health_check; done | wc -l) == 3 ]");
if (WIFEXITED(ret) && WEXITSTATUS(ret)) {
printf("Ret value of system: %d\n, ifexited: %d, exitstatus: %d",
ret, WIFEXITED(ret), WEXITSTATUS(ret));