summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarshavardhana Ranganath <harsha@gluster.com>2010-01-21 05:39:43 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-01-22 05:21:40 -0800
commit813f9870d558512c377d4a116284d8abb58e9e63 (patch)
tree5c9ebb3fee6259c3a2495f6005f84095685d9f36
parent329f423b4779e41a1c3d0b280aea5ffc40a75fc9 (diff)
Cache size is now dynamic and is 20% of the total memory on the client side.
Signed-off-by: Harshavardhana <harsha@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 516 (cache-size should not be hard-coded to 1GB) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=516
-rw-r--r--extras/volgen/CreateVolfile.py5
-rwxr-xr-xextras/volgen/glusterfs-volgen.in4
2 files changed, 5 insertions, 4 deletions
diff --git a/extras/volgen/CreateVolfile.py b/extras/volgen/CreateVolfile.py
index 2cca890..84de1a9 100644
--- a/extras/volgen/CreateVolfile.py
+++ b/extras/volgen/CreateVolfile.py
@@ -3,7 +3,8 @@ import subprocess
num_replica = 2
num_stripe = 4
-cache_size = "1GB"
+#Cachesize calculator
+cache_size = "`grep 'MemTotal' /proc/meminfo | awk '{print $2 * 0.2}'`"
class CreateVolfile:
@@ -183,7 +184,7 @@ class CreateVolfile:
mount_fd.write ("volume iocache\n")
mount_fd.write (" type performance/io-cache\n")
- mount_fd.write (" option cache-size %s\n" % cache_size)
+ mount_fd.write (" option cache-size %sKB\n" % cache_size)
mount_fd.write (" option cache-timeout 1\n")
if self.unused:
mount_fd.write ("# option priority *.html:1,abc*:2 # Priority list for iocaching files\n")
diff --git a/extras/volgen/glusterfs-volgen.in b/extras/volgen/glusterfs-volgen.in
index bd19d12..638ba79 100755
--- a/extras/volgen/glusterfs-volgen.in
+++ b/extras/volgen/glusterfs-volgen.in
@@ -82,7 +82,7 @@ def generate_volume_files ():
group.add_option("--nfs", action="store_true", dest="need_nfs",
default=False, help="booster nfs reexport")
group.add_option("--cifs", action="store_true", dest="need_cifs",
- default=False, help="booster cifs reexport"),
+ default=False, help="booster cifs reexport")
parse.add_option_group(group)
# CIFS option list
@@ -100,7 +100,7 @@ def generate_volume_files ():
group.add_option("--ibdev", type="int", dest="ib_dev",
default=1, help="Infiniband device number <N>")
group.add_option("-c", "--conf-dir", dest="conf_dir",
- help="output directory for volume files"),
+ help="output directory for volume files")
parse.add_option_group(group)
group = OptionGroup(parse, "Extra Options")