summaryrefslogtreecommitdiffstats
path: root/ufo/gluster/swift/common/utils.py
diff options
context:
space:
mode:
authorMohammed Junaid <junaid@redhat.com>2013-04-07 06:05:56 +0530
committerPeter Portante <peter.portante@redhat.com>2013-04-29 16:35:57 -0400
commit08b7da19a3e5c261776b8c2c5d9af08fb459c0d3 (patch)
treead857b496d59dc469e0ef4d96210cc306b3c83ce /ufo/gluster/swift/common/utils.py
parentca97ef5f52640b734140fb273647b8fc03835554 (diff)
object-storage: turn off stat() for container list
Turn of stat() system calls used to fetch the file size during a container listing operation since these system calls can swamp Gluster and the result is most often not used. When a GET or HEAD request is made on a container, stat() system calls are made during the Python standard library method, os.walk, to determine if a given directory entry is another directory to recurse into, and then utils._update_list() will stat() each file to get it size, and finally utils.get_container_details_from_fs() will stat() each directory encountered. For most installations we have seen so far, we don't need the container listing to accurately return the size of all the objects in the container, so we can reduce the number of stat() system calls by not fetching the size of the object. For now, turn it off by default, and provide an /etc/swift/fs.conf configuration parameter to turn it back on: accurate_size_in_listing = yes The default for the above is "no". Change-Id: I7dde11e14bb32ecafa3eabb08852f1ffc4366b35 BUG: 903396 Signed-off-by: Mohammed Junaid <junaid@redhat.com> Reviewed-on: http://review.gluster.org/4787 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'ufo/gluster/swift/common/utils.py')
-rw-r--r--ufo/gluster/swift/common/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/ufo/gluster/swift/common/utils.py b/ufo/gluster/swift/common/utils.py
index 7e9f8a6..f2cd8de 100644
--- a/ufo/gluster/swift/common/utils.py
+++ b/ufo/gluster/swift/common/utils.py
@@ -241,7 +241,7 @@ def _update_list(path, cont_path, src_list, reg_file=True, object_count=0,
object_count += 1
- if reg_file:
+ if Glusterfs._do_getsize and reg_file:
bytes_used += os_path.getsize(os.path.join(path, obj_name))
sleep()