<div dir="auto"><div>Hello<div dir="auto"><br></div><div dir="auto">I too have IO and swap issues on 8.8.8 release when users delete a lot of email because Zimbra does not implement the IMAP &quot;move&quot; fonction. It&#39;s not mandatory because Zimbra uses symlink so copying and deleting rather than moving is fine.</div><div dir="auto"><br></div><div dir="auto">BUT I found out in August that when zextras powerstore module is enabled Zimbra does not use the symlink system anymore ! Another java class is used.</div><div dir="auto"><br></div><div dir="auto">After disabling the powerstore module the IO load was lowered about 20 %.</div><div dir="auto"><br></div><div dir="auto">Zextras is ahead of this issue, but I dont know if a fix was released.</div><div dir="auto"><br></div><div dir="auto">Regards</div><div dir="auto">Victor</div><br><br><div class="gmail_quote"><div dir="ltr">Le jeu. 17 janv. 2019 à 00:00, L Mark Stone &lt;<a href="mailto:lmstone@lmstone.com">lmstone@lmstone.com</a>&gt; a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div dir="ltr">
<div id="m_2646567832212406257divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p style="margin-top:0;margin-bottom:0">If you are running Zimbra 8.8 and seeing unexpected swap file usage, I have a suggestion you may want to try.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">After doing a number of migrations of older Zimbra systems that never touched the swap file, I started seeing that these systems were now using the swap file a fair amount -- even with vm.swappiness set to 0.  A 16GB
 server with under 400 mailboxes after just a few minutes would start using the swap file, and after a day or so would be using several GB of swap.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">At first I suspected something in Zimbra/ZeXtras, but after I rebooted two small servers and increased their instance sizes to go from 16GB of RAM to 64GB of RAM, and they too started swapping within a few minutes, I
 felt this wasn&#39;t likely to be a Zimbra/ZeXtras issue.  Even when these systems had 16GB RAM and were using a lot of swap, none of the users were complaining about reduced performance.  The systems remained quite snappy at both RAM inventories.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">After a week or so of research, last night I ran a test on few systems, and this morning those systems&#39; swap file usage is about half or less of what it has historically been.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">So I wanted to share what I&#39;ve done, and ask for others who know more about this to provide feedback as to whether what I&#39;ve done is optimal/appropriate -- or not.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">By way of background, modern distros/kernels now make greater use of what top reports as &quot;buff(ers)/cache&quot;.  /var/run for example now is a symlink to /run on tmpfs, and this lives in that memory space.  If you run a ram
 disk for Amavis&#39;s tmp directory as I do, that memory also as I understand it is living in what top reports as buff/cache.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">But on the Zimbra systems that were swapping heavily, buff/cache was unexpectedly large.  Even a 32GB server with under 500 users would report 20GB or more as buff/cache, and maybe 5-10GB of swap file usage.  A 500-mailbox
 server should easily be performant with 12GB-16GB of RAM.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">What I came across was /proc/sys/vm/<span>vfs_cache_pressure</span></p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">This setting, which ranges from 0 to 200 and has a default of 100, controls how much &quot;pressure&quot; is put on the kernel to release memory from the buff/cache pools.  The higher the number, the more aggressively the kernel
 is &quot;pressed&quot; to release memory from the buff/cache pools.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">This to me seems not so dissimilar from vm.swappiness, which controls how aggressively the kernel is &quot;pressed&quot; to move data out of RAM and into swap.  The default there is 60 (lots of swap file usage) and Zimbra&#39;s best
 practice is to set this to zero.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">So last night I ran as root &quot;<span>sysctl -w vm.vfs_cache_pressure=150</span>&quot; on a few systems, followed by &quot;swapoff -a &amp;&amp; swapon -a&quot;</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">This morning, swap file usage was cut in at least half of what it is has been of late on all the systems on which I have made this change.  More importantly, end users continue to report the systems remain highly performant.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Anecdotally, I&#39;ve noticed on one system that an IMAPSYNC that had been running for a few days, and which had averaged ~3.75-4.0 messages per second through most mailboxes, has been running this morning through the remaining
 mailboxes at more than 5 messages per second.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">I would be grateful if your Zimbra system(s) are using the swap file more heavily than expected, if you wouldn&#39;t mind trying this adjustment and report back.  If you have experience with this setting either with Zimbra
 or other applications, please share -- especially if you feel, like setting vm.swappiness to zero, we should set
<span>vfs_cache_pressure</span> to its max value of 200.<br>
<br>
On next week&#39;s Zeta Alliance call I intend to add this to the agenda (and if you&#39;d like an invite to that call, send me an email to mark.stone@MissionCriticalEmail.com).  So if you are seeing unexpected swap file usage and want to try this, you can share your
 results on the call next week and/or on this list.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Thanks,</p>
<p style="margin-top:0;margin-bottom:0">Mark<br>
</p>
<div id="m_2646567832212406257Signature">

<div id="m_2646567832212406257divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:Calibri,Arial,Helvetica,sans-serif,&quot;EmojiFont&quot;,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,NotoColorEmoji,&quot;Segoe UI Symbol&quot;,&quot;Android Emoji&quot;,EmojiSymbols">
<p><strong>_________________________________________________</strong></p>
<p><strong>Another Message From...   L. Mark Stone</strong></p>
<p><br>
</p>
</div>
</div>
</div>
</div>

</blockquote></div></div></div>