diff options
author | Harshavardhana Ranganath <harsha@gluster.com> | 2010-01-21 05:36:42 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-01-21 07:45:40 -0800 |
commit | ab8cabcd30bbb5dde4cb8a35d4fd88136994f526 (patch) | |
tree | 5a0dd495b054f39c71de67ae580dd7a6b939fbac /extras/volgen/CreateVolfile.py | |
parent | 27399cc92d62a168f768c490fc19c935e7e513f1 (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
Diffstat (limited to 'extras/volgen/CreateVolfile.py')
-rw-r--r-- | extras/volgen/CreateVolfile.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/extras/volgen/CreateVolfile.py b/extras/volgen/CreateVolfile.py index 2cca8903b..84de1a9cd 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") |