| Summary: | NFS directory access is too slow with ACL | ||
|---|---|---|---|
| Product: | [Community] GlusterFS | Reporter: | santosh pradhan <spradhan> |
| Component: | nfs | Assignee: | santosh pradhan <spradhan> |
| Status: | CLOSED NOTABUG | QA Contact: | |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | mainline | CC: | bengland, gluster-bugs, pcuzner, rhs-bugs, shaines, steved, vagarwal, vbellur, vraman, vsomyaju |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | 965400 | Environment: | |
| Last Closed: | 2014-01-30 11:38:08 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Bug Depends On: | 965400 | ||
| Bug Blocks: | |||
|
Description
santosh pradhan
2013-12-17 03:25:08 UTC
REVIEW: http://review.gluster.org/6523 (gNFS: Client cache invalidation with bad fsid) posted (#1) for review on master by Santosh Pradhan (spradhan) REVIEW: http://review.gluster.org/6523 (gNFS: Client cache invalidation with bad fsid) posted (#2) for review on master by Santosh Pradhan (spradhan)
Results with the FIX: (with 50k files)
1. 1st run:
======
[root@santosh-new-4 glnfs]# time ls |wc -l
50000
real 0m5.634s
user 0m0.445s
sys 0m0.108s
[root@spradhan glusterfs]# gluster v profile nfsperf info nfs
NFS Server : localhost
----------------------
Cumulative Stats:
%-latency Avg-latency Min-Latency Max-Latency No. of calls Fop
--------- ----------- ----------- ----------- ------------ ----
0.00 0.00 us 0.00 us 0.00 us 50001 RELEASE
0.00 0.00 us 0.00 us 0.00 us 11 RELEASEDIR
0.00 598.00 us 598.00 us 598.00 us 1 STATFS
0.00 664.50 us 615.00 us 714.00 us 2 LOOKUP
0.00 600.33 us 458.00 us 1147.00 us 6 OPENDIR
0.00 519.67 us 237.00 us 666.00 us 9 ACCESS
0.00 515.18 us 304.00 us 913.00 us 28 STAT
0.53 496.30 us 125.00 us 1357.00 us 3210 FSTAT
99.46 92418.16 us 1002.00 us 1728777.00 us 3210 READDIRP
Duration: 3600 seconds
Data Read: 0 bytes
Data Written: 0 bytes
Interval 11 Stats:
%-latency Avg-latency Min-Latency Max-Latency No. of calls Fop
--------- ----------- ----------- ----------- ------------ ----
0.00 0.00 us 0.00 us 0.00 us 1 RELEASEDIR
0.01 458.00 us 458.00 us 458.00 us 1 OPENDIR
0.02 543.50 us 469.00 us 618.00 us 2 STAT
5.28 450.75 us 125.00 us 1357.00 us 535 FSTAT
94.68 8077.19 us 1478.00 us 18099.00 us 535 READDIRP
Duration: 19 seconds
Data Read: 0 bytes
Data Written: 0 bytes
2. 2nd run with attr cache:
============================
[root@santosh-new-4 glnfs]# time ls |wc -l
50000
real 0m0.466s
user 0m0.429s
sys 0m0.036s
[root@spradhan glusterfs]# gluster v profile nfsperf info nfs
NFS Server : localhost
----------------------
Cumulative Stats:
%-latency Avg-latency Min-Latency Max-Latency No. of calls Fop
--------- ----------- ----------- ----------- ------------ ----
0.00 0.00 us 0.00 us 0.00 us 50001 RELEASE
0.00 0.00 us 0.00 us 0.00 us 11 RELEASEDIR
0.00 598.00 us 598.00 us 598.00 us 1 STATFS
0.00 664.50 us 615.00 us 714.00 us 2 LOOKUP
0.00 600.33 us 458.00 us 1147.00 us 6 OPENDIR
0.00 528.40 us 237.00 us 666.00 us 10 ACCESS
0.01 516.90 us 304.00 us 913.00 us 30 STAT
0.53 496.30 us 125.00 us 1357.00 us 3210 FSTAT
99.46 92418.16 us 1002.00 us 1728777.00 us 3210 READDIRP
Duration: 3612 seconds
Data Read: 0 bytes
Data Written: 0 bytes
Interval 12 Stats:
%-latency Avg-latency Min-Latency Max-Latency No. of calls Fop
--------- ----------- ----------- ----------- ------------ ----
35.94 607.00 us 607.00 us 607.00 us 1 ACCESS
64.06 541.00 us 523.00 us 559.00 us 2 STAT
Duration: 12 seconds
Data Read: 0 bytes
Data Written: 0 bytes
3. dropped the attr cache:
[root@santosh-new-4 glnfs]# echo 3 > /proc/sys/vm/drop_caches
[root@santosh-new-4 glnfs]# time ls |wc -l
50000
real 0m5.643s
user 0m0.441s
sys 0m0.129s
[root@spradhan glusterfs]# gluster v profile nfsperf info nfs
NFS Server : localhost
----------------------
Cumulative Stats:
%-latency Avg-latency Min-Latency Max-Latency No. of calls Fop
--------- ----------- ----------- ----------- ------------ ----
0.00 0.00 us 0.00 us 0.00 us 50001 RELEASE
0.00 0.00 us 0.00 us 0.00 us 12 RELEASEDIR
0.00 598.00 us 598.00 us 598.00 us 1 STATFS
0.00 664.50 us 615.00 us 714.00 us 2 LOOKUP
0.00 543.43 us 202.00 us 1147.00 us 7 OPENDIR
0.00 497.18 us 185.00 us 666.00 us 11 ACCESS
0.01 498.33 us 165.00 us 913.00 us 33 STAT
0.61 489.29 us 125.00 us 1357.00 us 3745 FSTAT
99.39 80366.99 us 1002.00 us 1728777.00 us 3745 READDIRP
Duration: 3753 seconds
Data Read: 0 bytes
Data Written: 0 bytes
Interval 13 Stats:
%-latency Avg-latency Min-Latency Max-Latency No. of calls Fop
--------- ----------- ----------- ----------- ------------ ----
0.00 0.00 us 0.00 us 0.00 us 1 RELEASEDIR
0.00 185.00 us 185.00 us 185.00 us 1 ACCESS
0.00 202.00 us 202.00 us 202.00 us 1 OPENDIR
0.02 312.67 us 165.00 us 573.00 us 3 STAT
5.26 447.23 us 152.00 us 692.00 us 535 FSTAT
94.72 8059.91 us 1348.00 us 18544.00 us 535 READDIRP
Duration: 141 seconds
Data Read: 0 bytes
Data Written: 0 bytes
There is no LOOKUP storm anymore :)
COMMIT: http://review.gluster.org/6523 committed in master by Vijay Bellur (vbellur) ------ commit 329e38d4ab5af1a675b4d5651eda983f8a924418 Author: Santosh Kumar Pradhan <spradhan> Date: Tue Dec 17 08:43:50 2013 +0530 gNFS: Client cache invalidation with bad fsid 1. Problem: Couple of issues are seen when NFS-ACL is turned ON. i.e. i) NFS directory access is too slow, impacting customer workflows with ACL ii)dbench fails with 100 directories. 2. Root cause: Frequent cache invalidation in the client side when ACL is turned ON with NFS because NFS server getacl() code returns the wrong fsid to the client. 3. This attr-cache invlaidation triggers the frequent LOOKUP ops for each file instead of relying on the readdir or readdirp data. As a result performance gets impacted. 4. In case of dbench workload, the problem is more severe. e.g. Client side rpcdebug output: =========================== Dec 16 10:16:53 santosh-3 kernel: NFS: nfs_update_inode(0:1b/12061953567282551806 ct=2 info=0x7e7f) Dec 16 10:16:53 santosh-3 kernel: NFS: nfs_fhget(0:1b/12061953567282551806 ct=2) Dec 16 10:16:53 santosh-3 kernel: <-- nfs_xdev_get_sb() = -116 [splat] Dec 16 10:16:53 santosh-3 kernel: nfs_do_submount: done Dec 16 10:16:53 santosh-3 kernel: <-- nfs_do_submount() = ffffffffffffff8c Dec 16 10:16:53 santosh-3 kernel: <-- nfs_follow_mountpoint() = ffffffffffffff8c Dec 16 10:16:53 santosh-3 kernel: NFS: dentry_delete(clients/client77, 20008) As per Jeff Layton, This occurs when the client detects that the fsid on a filehandle is different from its parent. At that point, it tries to do a new submount of the new filesystem onto the correct point. It means client got a superblock reference for the new fs and is now looking to set up the root of the mount. It calls nfs_get_root to do that, which basically takes the superblock and a filehandle and returns a dentry. The problem here is that the dentry->d_inode you're getting back looks wrong. It's not a directory as expected -- it's something else. So the client gives up and tosses back an ESTALE. Which clearly says that, In getacl() code while it does the stat() call to get the attrs, it forgets to populate the deviceid or fsid before going ahead and does getxattr(). FIX: 1. Fill the deviceid in iatt. 2. Do bit more clean up for the confusing part of the code. NB: Many many thanks to Niels de Vos and Jeff Layton for their help to debug the issue. Change-Id: I8d3c2a844c9d1761051a883b5ebaeb84062a11c8 BUG: 1043737 Signed-off-by: Santosh Kumar Pradhan <spradhan> Reviewed-on: http://review.gluster.org/6523 Reviewed-by: Rajesh Joseph <rjoseph> Reviewed-by: Niels de Vos <ndevos> Tested-by: Gluster Build System <jenkins.com> Reviewed-by: Vijay Bellur <vbellur> REVIEW: http://review.gluster.org/6526 (gNFS: Client cache invalidation with bad fsid) posted (#1) for review on release-3.5 by Santosh Pradhan (spradhan) REVIEW: http://review.gluster.org/6526 (gNFS: Client cache invalidation with bad fsid) posted (#2) for review on release-3.5 by Santosh Pradhan (spradhan) COMMIT: http://review.gluster.org/6526 committed in release-3.5 by Vijay Bellur (vbellur) ------ commit 54201dd0495e52e0722898ab7fdad007d28d1676 Author: Santosh Kumar Pradhan <spradhan> Date: Tue Dec 17 17:32:14 2013 +0530 gNFS: Client cache invalidation with bad fsid 1. Problem: Couple of issues are seen when NFS-ACL is turned ON. i.e. i) NFS directory access is too slow, impacting customer workflows with ACL ii)dbench fails with 100 directories. 2. Root cause: Frequent cache invalidation in the client side when ACL is turned ON with NFS because NFS server getacl() code returns the wrong fsid to the client. 3. This attr-cache invlaidation triggers the frequent LOOKUP ops for each file instead of relying on the readdir or readdirp data. As a result performance gets impacted. 4. In case of dbench workload, the problem is more severe. e.g. Client side rpcdebug output: =========================== Dec 16 10:16:53 santosh-3 kernel: NFS: nfs_update_inode(0:1b/12061953567282551806 ct=2 info=0x7e7f) Dec 16 10:16:53 santosh-3 kernel: NFS: nfs_fhget(0:1b/12061953567282551806 ct=2) Dec 16 10:16:53 santosh-3 kernel: <-- nfs_xdev_get_sb() = -116 [splat] Dec 16 10:16:53 santosh-3 kernel: nfs_do_submount: done Dec 16 10:16:53 santosh-3 kernel: <-- nfs_do_submount() = ffffffffffffff8c Dec 16 10:16:53 santosh-3 kernel: <-- nfs_follow_mountpoint() = ffffffffffffff8c Dec 16 10:16:53 santosh-3 kernel: NFS: dentry_delete(clients/client77, 20008) As per Jeff Layton, This occurs when the client detects that the fsid on a filehandle is different from its parent. At that point, it tries to do a new submount of the new filesystem onto the correct point. It means client got a superblock reference for the new fs and is now looking to set up the root of the mount. It calls nfs_get_root to do that, which basically takes the superblock and a filehandle and returns a dentry. The problem here is that the dentry->d_inode you're getting back looks wrong. It's not a directory as expected -- it's something else. So the client gives up and tosses back an ESTALE. Which clearly says that, In getacl() code while it does the stat() call to get the attrs, it forgets to populate the deviceid or fsid before going ahead and does getxattr(). FIX: 1. Fill the deviceid in iatt. 2. Do bit more clean up for the confusing part of the code. NB: Many many thanks to Niels de Vos and Jeff Layton for their help to debug the issue. Change-Id: I44d8d2fa3ec7fb33a67dfdd4bbe2c45cdf67db8c BUG: 1043737 Signed-off-by: Santosh Kumar Pradhan <spradhan> Reviewed-on: http://review.gluster.org/6526 Reviewed-by: Niels de Vos <ndevos> Tested-by: Gluster Build System <jenkins.com> Reviewed-by: Vijay Bellur <vbellur> |