<div dir="ltr">Hi Dan,<div><br></div><div>It sounds like you might be running into [1]. The patch has been posted upstream and the fix should be in the next release.</div><div>In the meantime, I&#39;m afraid there is no way to get around this without restarting the process.</div><div><br></div><div>Regards,</div><div>Nithya</div><div><br></div><div>[1]<a href="https://bugzilla.redhat.com/show_bug.cgi?id=1541264">https://bugzilla.redhat.com/show_bug.cgi?id=1541264</a></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 2 February 2018 at 02:57, Dan Ragle <span dir="ltr">&lt;<a href="mailto:daniel@biblestuph.com" target="_blank">daniel@biblestuph.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
<br>
On 1/30/2018 6:31 AM, Raghavendra Gowdappa wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
----- Original Message -----<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
From: &quot;Dan Ragle&quot; &lt;daniel@Biblestuph.com&gt;<br>
To: &quot;Raghavendra Gowdappa&quot; &lt;<a href="mailto:rgowdapp@redhat.com" target="_blank">rgowdapp@redhat.com</a>&gt;, &quot;Ravishankar N&quot; &lt;<a href="mailto:ravishankar@redhat.com" target="_blank">ravishankar@redhat.com</a>&gt;<br>
Cc: <a href="mailto:gluster-users@gluster.org" target="_blank">gluster-users@gluster.org</a>, &quot;Csaba Henk&quot; &lt;<a href="mailto:chenk@redhat.com" target="_blank">chenk@redhat.com</a>&gt;, &quot;Niels de Vos&quot; &lt;<a href="mailto:ndevos@redhat.com" target="_blank">ndevos@redhat.com</a>&gt;, &quot;Nithya<br>
Balachandran&quot; &lt;<a href="mailto:nbalacha@redhat.com" target="_blank">nbalacha@redhat.com</a>&gt;<br>
Sent: Monday, January 29, 2018 9:02:21 PM<br>
Subject: Re: [Gluster-users] Run away memory with gluster mount<br>
<br>
<br>
<br>
On 1/29/2018 2:36 AM, Raghavendra Gowdappa wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
----- Original Message -----<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
From: &quot;Ravishankar N&quot; &lt;<a href="mailto:ravishankar@redhat.com" target="_blank">ravishankar@redhat.com</a>&gt;<br>
To: &quot;Dan Ragle&quot; &lt;daniel@Biblestuph.com&gt;, <a href="mailto:gluster-users@gluster.org" target="_blank">gluster-users@gluster.org</a><br>
Cc: &quot;Csaba Henk&quot; &lt;<a href="mailto:chenk@redhat.com" target="_blank">chenk@redhat.com</a>&gt;, &quot;Niels de Vos&quot; &lt;<a href="mailto:ndevos@redhat.com" target="_blank">ndevos@redhat.com</a>&gt;,<br>
&quot;Nithya Balachandran&quot; &lt;<a href="mailto:nbalacha@redhat.com" target="_blank">nbalacha@redhat.com</a>&gt;,<br>
&quot;Raghavendra Gowdappa&quot; &lt;<a href="mailto:rgowdapp@redhat.com" target="_blank">rgowdapp@redhat.com</a>&gt;<br>
Sent: Saturday, January 27, 2018 10:23:38 AM<br>
Subject: Re: [Gluster-users] Run away memory with gluster mount<br>
<br>
<br>
<br>
On 01/27/2018 02:29 AM, Dan Ragle wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
On 1/25/2018 8:21 PM, Ravishankar N wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
On 01/25/2018 11:04 PM, Dan Ragle wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
*sigh* trying again to correct formatting ... apologize for the<br>
earlier mess.<br>
<br>
Having a memory issue with Gluster 3.12.4 and not sure how to<br>
troubleshoot. I don&#39;t *think* this is expected behavior.<br>
<br>
This is on an updated CentOS 7 box. The setup is a simple two node<br>
replicated layout where the two nodes act as both server and<br>
client.<br>
<br>
The volume in question:<br>
<br>
Volume Name: GlusterWWW<br>
Type: Replicate<br>
Volume ID: 8e9b0e79-f309-4d9b-a5bb-45d065<wbr>faaaa3<br>
Status: Started<br>
Snapshot Count: 0<br>
Number of Bricks: 1 x 2 = 2<br>
Transport-type: tcp<br>
Bricks:<br>
Brick1: vs1dlan.mydomain.com:/glusterf<wbr>s_bricks/brick1/www<br>
Brick2: vs2dlan.mydomain.com:/glusterf<wbr>s_bricks/brick1/www<br>
Options Reconfigured:<br>
nfs.disable: on<br>
cluster.favorite-child-policy: mtime<br>
transport.address-family: inet<br>
<br>
I had some other performance options in there, (increased<br>
cache-size, md invalidation, etc) but stripped them out in an<br>
attempt to<br>
isolate the issue. Still got the problem without them.<br>
<br>
The volume currently contains over 1M files.<br>
<br>
When mounting the volume, I get (among other things) a process as such:<br>
<br>
/usr/sbin/glusterfs --volfile-server=localhost<br>
--volfile-id=/GlusterWWW /var/www<br>
<br>
This process begins with little memory, but then as files are<br>
accessed in the volume the memory increases. I setup a script that<br>
simply reads the files in the volume one at a time (no writes). It&#39;s<br>
been running on and off about 12 hours now and the resident<br>
memory of the above process is already at 7.5G and continues to grow<br>
slowly. If I stop the test script the memory stops growing,<br>
but does not reduce. Restart the test script and the memory begins<br>
slowly growing again.<br>
<br>
This is obviously a contrived app environment. With my intended<br>
application load it takes about a week or so for the memory to get<br>
high enough to invoke the oom killer.<br>
</blockquote>
<br>
Can you try debugging with the statedump<br>
(<a href="https://gluster.readthedocs.io/en/latest/Troubleshooting/statedump/#read-a-statedump" rel="noreferrer" target="_blank">https://gluster.readthedocs.i<wbr>o/en/latest/Troubleshooting/st<wbr>atedump/#read-a-statedump</a>)<br>
of<br>
the fuse mount process and see what member is leaking? Take the<br>
statedumps in succession, maybe once initially during the I/O and<br>
once the memory gets high enough to hit the OOM mark.<br>
Share the dumps here.<br>
<br>
Regards,<br>
Ravi<br>
</blockquote>
<br>
Thanks for the reply. I noticed yesterday that an update (3.12.5) had<br>
been posted so I went ahead and updated and repeated the test<br>
overnight. The memory usage does not appear to be growing as quickly<br>
as is was with 3.12.4, but does still appear to be growing.<br>
<br>
I should also mention that there is another process beyond my test app<br>
that is reading the files from the volume. Specifically, there is an<br>
rsync that runs from the second node 2-4 times an hour that reads from<br>
the GlusterWWW volume mounted on node 1. Since none of the files in<br>
that mount are changing it doesn&#39;t actually rsync anything, but<br>
nonetheless it is running and reading the files in addition to my test<br>
script. (It&#39;s a part of my intended production setup that I forgot was<br>
still running.)<br>
<br>
The mount process appears to be gaining memory at a rate of about 1GB<br>
every 4 hours or so. At that rate it&#39;ll take several days before it<br>
runs the box out of memory. But I took your suggestion and made some<br>
statedumps today anyway, about 2 hours apart, 4 total so far. It looks<br>
like there may already be some actionable information. These are the<br>
only registers where the num_allocs have grown with each of the four<br>
samples:<br>
<br>
[mount/fuse.fuse - usage-type gf_fuse_mt_gids_t memusage]<br>
   ---&gt; num_allocs at Fri Jan 26 08:57:31 2018: 784<br>
   ---&gt; num_allocs at Fri Jan 26 10:55:50 2018: 831<br>
   ---&gt; num_allocs at Fri Jan 26 12:55:15 2018: 877<br>
   ---&gt; num_allocs at Fri Jan 26 14:58:27 2018: 908<br>
<br>
[mount/fuse.fuse - usage-type gf_common_mt_fd_lk_ctx_t memusage]<br>
   ---&gt; num_allocs at Fri Jan 26 08:57:31 2018: 5<br>
   ---&gt; num_allocs at Fri Jan 26 10:55:50 2018: 10<br>
   ---&gt; num_allocs at Fri Jan 26 12:55:15 2018: 15<br>
   ---&gt; num_allocs at Fri Jan 26 14:58:27 2018: 17<br>
<br>
[cluster/distribute.GlusterWWW<wbr>-dht - usage-type gf_dht_mt_dht_layout_t<br>
memusage]<br>
   ---&gt; num_allocs at Fri Jan 26 08:57:31 2018: 24243596<br>
   ---&gt; num_allocs at Fri Jan 26 10:55:50 2018: 27902622<br>
   ---&gt; num_allocs at Fri Jan 26 12:55:15 2018: 30678066<br>
   ---&gt; num_allocs at Fri Jan 26 14:58:27 2018: 33801036<br>
<br>
Not sure the best way to get you the full dumps. They&#39;re pretty big,<br>
over 1G for all four. Also, I noticed some filepath information in<br>
there that I&#39;d rather not share. What&#39;s the recommended next step?<br>
</blockquote></blockquote>
<br>
Please run the following query on statedump files and report us the<br>
results:<br>
# grep itable &lt;client-statedump&gt; | grep active | wc -l<br>
# grep itable &lt;client-statedump&gt; | grep active_size<br>
# grep itable &lt;client-statedump&gt; | grep lru | wc -l<br>
# grep itable &lt;client-statedump&gt; | grep lru_size<br>
# grep itable &lt;client-statedump&gt; | grep purge | wc -l<br>
# grep itable &lt;client-statedump&gt; | grep purge_size<br>
</blockquote>
<br>
Had to restart the test and have been running for 36 hours now. RSS is<br>
currently up to 23g.<br>
<br>
Working on getting a bug report with link to the dumps. In the mean<br>
time, I&#39;m including the results of your above queries for the first<br>
dump, the 18 hour dump, and the 36 hour dump:<br>
<br>
# grep itable glusterdump.153904.dump.151710<wbr>4561 | grep active | wc -l<br>
53865<br>
# grep itable glusterdump.153904.dump.151716<wbr>9361 | grep active | wc -l<br>
53864<br>
# grep itable glusterdump.153904.dump.151723<wbr>4161 | grep active | wc -l<br>
53864<br>
<br>
# grep itable glusterdump.153904.dump.151710<wbr>4561 | grep active_size<br>
xlator.mount.fuse.itable.activ<wbr>e_size=53864<br>
# grep itable glusterdump.153904.dump.151716<wbr>9361 | grep active_size<br>
xlator.mount.fuse.itable.activ<wbr>e_size=53863<br>
# grep itable glusterdump.153904.dump.151723<wbr>4161 | grep active_size<br>
xlator.mount.fuse.itable.activ<wbr>e_size=53863<br>
<br>
# grep itable glusterdump.153904.dump.151710<wbr>4561 | grep lru | wc -l<br>
998510<br>
# grep itable glusterdump.153904.dump.151716<wbr>9361 | grep lru | wc -l<br>
998510<br>
# grep itable glusterdump.153904.dump.151723<wbr>4161 | grep lru | wc -l<br>
995992<br>
<br>
# grep itable glusterdump.153904.dump.151710<wbr>4561 | grep lru_size<br>
xlator.mount.fuse.itable.lru_s<wbr>ize=998508<br>
# grep itable glusterdump.153904.dump.151716<wbr>9361 | grep lru_size<br>
xlator.mount.fuse.itable.lru_s<wbr>ize=998508<br>
# grep itable glusterdump.153904.dump.151723<wbr>4161 | grep lru_size<br>
xlator.mount.fuse.itable.lru_s<wbr>ize=995990<br>
</blockquote>
<br>
Around 1 million of inodes in lru table!! These are the inodes kernel has just cached and no operation is currently progress on these inodes. This could be the reason for high memory usage. We&#39;ve a patch being worked on (merged on experimental branch currently) [1], that will help in these sceanrios. In the meantime can you remount glusterfs with options --entry-timeout=0 and --attribute-timeout=0? This will make sure that kernel won&#39;t cache inodes/attributes of the file and should bring down the memory usage.<br>
<br>
I am curious to know what is your data-set like? Is it the case of too many directories and files present in deep directories? I am wondering whether a significant number of inodes cached by kernel are there to hold dentry structure in kernel.<br>
<br>
[1] <a href="https://review.gluster.org/#/c/18665/" rel="noreferrer" target="_blank">https://review.gluster.org/#/c<wbr>/18665/</a><br>
<br>
</blockquote>
<br></div></div>
OK, remounted with your recommended attributes and repeated the test. Now the mount process looks like this:<br>
<br>
/usr/sbin/glusterfs --attribute-timeout=0 --entry-timeout=0 --volfile-server=localhost --volfile-id=/GlusterWWW /var/www<br>
<br>
However after running for 36 hours it&#39;s again at about 23g (about the same place it was on the first test).<br>
<br>
A few metrics from the 36 hour mark:<br>
<br>
num_allocs for [cluster/distribute.GlusterWWW<wbr>-dht - usage-type gf_dht_mt_dht_layout_t memusage] is 109140094. Seems at least somewhat similar to the original test, which had 117901593 at the 36 hour mark.<br>
<br>
The dump file at the 36 hour mark had nothing for lru or lru_size. However, at the dump two hours prior it had:<br>
<br>
# grep itable glusterdump.67299.dump.1517493<wbr>361 | grep lru | wc -l<br>
998510<br>
# grep itable glusterdump.67299.dump.1517493<wbr>361 | grep lru_size<br>
xlator.mount.fuse.itable.lru_s<wbr>ize=998508<br>
<br>
and the same thing for the dump four hours later. Are these values only relevant when the ls -R is actually running? I&#39;m thinking the 36 hour dump may have caught the ls -R between runs there (?)<br>
<br>
The data set is multiple Web sites. I know there&#39;s some litter there we can clean up, but I&#39;d guess not more than 200-300k files or so. The biggest culprit is a single directory that we use as a multi-purpose file store, with filenames stored as GUIDs and linked to a DB. That directory currently has 500k+ files. Another directory serves a similar purpose and has about 66k files in it. The rest is generally distributed more &quot;normally&quot;, I.E., a mixed nesting of directories and files.<br>
<br>
Cheers!<span class="HOEnZb"><font color="#888888"><br>
<br>
Dan</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
# grep itable glusterdump.153904.dump.151710<wbr>4561 | grep purge | wc -l<br>
1<br>
# grep itable glusterdump.153904.dump.151716<wbr>9361 | grep purge | wc -l<br>
1<br>
# grep itable glusterdump.153904.dump.151723<wbr>4161 | grep purge | wc -l<br>
1<br>
<br>
# grep itable glusterdump.153904.dump.151710<wbr>4561 | grep purge_size<br>
xlator.mount.fuse.itable.purge<wbr>_size=0<br>
# grep itable glusterdump.153904.dump.151716<wbr>9361 | grep purge_size<br>
xlator.mount.fuse.itable.purge<wbr>_size=0<br>
# grep itable glusterdump.153904.dump.151723<wbr>4161 | grep purge_size<br>
xlator.mount.fuse.itable.purge<wbr>_size=0<br>
<br>
Cheers,<br>
<br>
Dan<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I&#39;ve CC&#39;d the fuse/ dht devs to see if these data types have potential<br>
leaks. Could you raise a bug with the volume info and a (dropbox?) link<br>
from which we can download the dumps? You can remove/replace the<br>
filepaths from them.<br>
<br>
Regards.<br>
Ravi<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Cheers!<br>
<br>
Dan<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Is there potentially something misconfigured here?<br>
<br>
I did see a reference to a memory leak in another thread in this<br>
list, but that had to do with the setting of quotas, I don&#39;t have<br>
any quotas set on my system.<br>
<br>
Thanks,<br>
<br>
Dan Ragle<br>
daniel@Biblestuph.com<br>
<br>
On 1/25/2018 11:04 AM, Dan Ragle wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Having a memory issue with Gluster 3.12.4 and not sure how to<br>
troubleshoot. I don&#39;t *think* this is expected behavior. This is on an<br>
updated CentOS 7 box. The setup is a simple two node replicated layout<br>
where the two nodes act as both server and client. The volume in<br>
question: Volume Name: GlusterWWW Type: Replicate Volume ID:<br>
8e9b0e79-f309-4d9b-a5bb-45d065<wbr>faaaa3 Status: Started Snapshot Count: 0<br>
Number of Bricks: 1 x 2 = 2 Transport-type: tcp Bricks: Brick1:<br>
vs1dlan.mydomain.com:/glusterf<wbr>s_bricks/brick1/www Brick2:<br>
vs2dlan.mydomain.com:/glusterf<wbr>s_bricks/brick1/www Options<br>
Reconfigured:<br>
nfs.disable: on cluster.favorite-child-policy: mtime<br>
transport.address-family: inet I had some other performance options in<br>
there, (increased cache-size, md invalidation, etc) but stripped them<br>
out in an attempt to isolate the issue. Still got the problem without<br>
them. The volume currently contains over 1M files. When mounting the<br>
volume, I get (among other things) a process as such:<br>
/usr/sbin/glusterfs --volfile-server=localhost<br>
--volfile-id=/GlusterWWW<br>
/var/www This process begins with little memory, but then as files are<br>
accessed in the volume the memory increases. I setup a script that<br>
simply reads the files in the volume one at a time (no writes). It&#39;s<br>
been running on and off about 12 hours now and the resident memory of<br>
the above process is already at 7.5G and continues to grow slowly.<br>
If I<br>
stop the test script the memory stops growing, but does not reduce.<br>
Restart the test script and the memory begins slowly growing again.<br>
This<br>
is obviously a contrived app environment. With my intended application<br>
load it takes about a week or so for the memory to get high enough to<br>
invoke the oom killer. Is there potentially something misconfigured<br>
here? Thanks, Dan Ragle daniel@Biblestuph.com<br>
<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
Gluster-users mailing list<br>
<a href="mailto:Gluster-users@gluster.org" target="_blank">Gluster-users@gluster.org</a><br>
<a href="http://lists.gluster.org/mailman/listinfo/gluster-users" rel="noreferrer" target="_blank">http://lists.gluster.org/mailm<wbr>an/listinfo/gluster-users</a><br>
<br>
</blockquote>
______________________________<wbr>_________________<br>
Gluster-users mailing list<br>
<a href="mailto:Gluster-users@gluster.org" target="_blank">Gluster-users@gluster.org</a><br>
<a href="http://lists.gluster.org/mailman/listinfo/gluster-users" rel="noreferrer" target="_blank">http://lists.gluster.org/mailm<wbr>an/listinfo/gluster-users</a><br>
</blockquote>
<br>
</blockquote>
______________________________<wbr>_________________<br>
Gluster-users mailing list<br>
<a href="mailto:Gluster-users@gluster.org" target="_blank">Gluster-users@gluster.org</a><br>
<a href="http://lists.gluster.org/mailman/listinfo/gluster-users" rel="noreferrer" target="_blank">http://lists.gluster.org/mailm<wbr>an/listinfo/gluster-users</a><br>
</blockquote>
<br>
<br>
</blockquote>
<br>
</blockquote>
<br>
</blockquote>
<br>
</blockquote>
</div></div></blockquote></div><br></div>