<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 03/05/2016 03:45 PM, Oleksandr
      Natalenko wrote:<br>
    </div>
    <blockquote cite="mid:6654860.27arEydKdA@spock" type="cite">
      <pre wrap="">In order to estimate GlusterFS arbiter brick size, I've deployed test setup 
with replica 3 arbiter 1 volume within one node. Each brick is located on 
separate HDD (XFS with inode size == 512). Using GlusterFS v3.7.6 + memleak 
patches. Volume options are kept default.

Here is the script that creates files and folders in mounted volume: [1]

The script creates 1M of files of random size (between 1 and 32768 bytes) and 
some amount of folders. After running it I've got 1036637 folders. So, in 
total it is 2036637 files and folders.

The initial used space on each brick is 42M . After running script I've got:

replica brick 1 and 2: 19867168 kbytes == 19G
arbiter brick: 1872308 kbytes == 1.8G

The amount of inodes on each brick is 3139091. So here goes estimation.

Dividing arbiter used space by files+folders we get:

(1872308 - 42000)/2036637 == 899 bytes per file or folder

Dividing arbiter used space by inodes we get:

(1872308 - 42000)/3139091 == 583 bytes per inode

Not sure about what calculation is correct.</pre>
    </blockquote>
    <br>
    I think the first one is right because you still haven't used up all
    the inodes.(2036637 used vs. the max. permissible 3139091). But
    again this is an approximation because not all files would be 899
    bytes. For example if there are a thousand files present in a
    directory, then du &lt;dirname&gt; would be more than du
    &lt;file&gt; because the directory will take some disk space to
    store the dentries.<br>
    <br>
    <blockquote cite="mid:6654860.27arEydKdA@spock" type="cite">
      <pre wrap=""> I guess we should consider the one 
that accounts inodes because of .glusterfs/ folder data.

Nevertheless, in contrast, documentation [2] says it should be 4096 bytes per 
file. Am I wrong with my calculations?
</pre>
    </blockquote>
    <br>
    The 4KB is a conservative estimate considering the fact that though
    the arbiter brick does not store data, it still keeps a copy of both
    user and gluster xattrs. For example, if the application sets a lot
    of xattrs, it can consume a data block if they cannot be
    accommodated on the inode itself.  Also there is the .glusterfs
    folder like you said which would take up some space. Here is what I
    tried on an XFS brick:<br>
    <tt>[root@ravi4 brick]# touch file</tt><tt><br>
      <br>
    </tt><tt>[root@ravi4 brick]# ls -l file</tt><tt><br>
    </tt><tt>-rw-r--r-- 1 root root 0 Mar  8 12:54 file</tt><tt><br>
    </tt><tt><br>
      [root@ravi4 brick]# du file</tt><tt><br>
    </tt><b><tt>0       file</tt></b><b><tt><br>
      </tt></b><tt><br>
      [root@ravi4 brick]# for i in {1..100}</tt><tt><br>
    </tt><tt>&gt; do</tt><tt><br>
    </tt><tt>&gt; setfattr -n user.value$i -v value$i file</tt><tt><br>
    </tt><tt>&gt; done</tt><tt><br>
    </tt><tt><br>
      [root@ravi4 brick]# ll -l file</tt><tt><br>
    </tt><tt>-rw-r--r-- 1 root root 0 Mar  8 12:54 file</tt><tt><br>
    </tt><tt><br>
      [root@ravi4 brick]# du -h file</tt><tt><br>
    </tt><b><tt>4.0K    file</tt></b><b><br>
    </b><br>
    Hope this helps,<br>
    Ravi<br>
    <br>
    <br>
    <blockquote cite="mid:6654860.27arEydKdA@spock" type="cite">
      <pre wrap="">
Pranith?

[1] <a class="moz-txt-link-freetext" href="http://termbin.com/ka9x">http://termbin.com/ka9x</a>
[2] <a class="moz-txt-link-freetext" href="http://gluster.readthedocs.org/en/latest/Administrator%20Guide/arbiter-volumes-and-quorum/">http://gluster.readthedocs.org/en/latest/Administrator%20Guide/arbiter-volumes-and-quorum/</a>
_______________________________________________
Gluster-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Gluster-devel@gluster.org">Gluster-devel@gluster.org</a>
<a class="moz-txt-link-freetext" href="http://www.gluster.org/mailman/listinfo/gluster-devel">http://www.gluster.org/mailman/listinfo/gluster-devel</a>
</pre>
    </blockquote>
    <br>
    <br>
  </body>
</html>