<div dir="auto"><div dir="ltr"><div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr">On Wed, Sep 5, 2018, 11:55 AM D. Hugh Redelmeier via talk <<a href="mailto:talk@gtalug.org" rel="noreferrer noreferrer" target="_blank">talk@gtalug.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">| From: Russell Reiter via talk <<a href="mailto:talk@gtalug.org" rel="noreferrer noreferrer noreferrer" target="_blank">talk@gtalug.org</a>><br>
<br>
| Desktop freezing can be an issue if you don't get the ratios in line with<br>
| the hw.<br>
<br>
Really?  swappiness values (except for 0) should only affect<br>
performance.  Not something binary like freezing.  Of course really<br>
really really bad performance can appear to be freezing.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Perhaps I should have said stuttering instead. </div><div dir="auto"><br></div><div dir="auto">Evans question was coined in some general observations, albeit as related to apparent latency issues and some apparently negative effects. I assumed some bad performance there and also perhaps incorrectly assumed an onboard video card which draws down on system ram. </div><div dir="auto"><br></div><div>Evans question was simple enough. "I have a desktop that, to me, seems like it's running to swap just a little to often and coming back to RAM just a little slower than I'd like. What are the ill effects, on a desktop, of lowering swappiness down from the default of 60?"</div><div><br></div><div>There wasn't much helpful commentary about those perceived issues, so I answered with one link which I thought to be, if not absolutely true, perhaps demonstratively so, however anecdotal or subjective.</div><div><br></div><div>It's always helpful to know the exact hw in use however vague specifications in questions do lead to vague speculations, like mine. </div><div> </div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
| I've been considering this a bit for my own desktop. In order to mitigate<br>
| possible write amplification issues on my SSD running RH F27, at this time</blockquote></div></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">| I have 8gib ram with a 4gib swap.<br>
<br>
swappiness should not have a direct effect on write amplification.<br>
The obvious way of affecting write amplification is by<br>
overprovisioning (as we've discussed before).<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">I did provide some, not unsubstantial unallocated space as you described in that previous thread. 15gib on a 512gib SSD. The Fedora automatic installer only allowed 56mb on the M.2 install. I scheduled an fstrim for once a week based on the info you posted.</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
swappiness could and would change the number of writes.  Except in<br>
pathological cases I would not expect swap to challenge the lifetime<br>
of an SSD.<br></blockquote></div></div></div></div><div dir="auto"><br></div><div dir="auto">I'm unsure of the term pathalogical in respect of electro-mechanical devices. However it is a very human trait to humanize objects so that the terms of reference are ... well  more humane. Ships are she, land is mother/father etc. Even lower order mammals are not imnune to our liberal use of metaphore.</div><div dir="auto"><br></div><div dir="auto">As an example someone might say, we took the cat out for a sail on the last dog day of summer. (That was hopefully yesterday for this year) If you don't sail, you don't know a cat is a diminutive of catamaran, a particular type of pontoon sailboat. The dog days of summer are the days so hot even the most active dogs just lie around in the heat.</div><div dir="auto"><br></div><div dir="auto">So I think of performance this way. If you drive your car at 65 mph, you get one set of outcomes. high gas consumption, higher parts wear and greater risk of accidents. If you lower your speed to 50 mph, you reduce, not insignificantly, those apparent adverse effects. I think most people understand that fairly easily, but how many of us could actually prove that fact mathematically. Anecdotally, that is an entirely different kettle of fish.</div><div dir="auto"><br></div><div dir="ltr"><div dir="auto"><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
|  Apparently, on more modern systems, if<br>
| you have greater than 2gib ram you are in a better position to play around<br>
| with the checks and balances.<br>
<br>
There is no magic number independent of workload.</blockquote></div></div><div dir="auto"><br></div><div dir="auto">That is true enough but people often coin their performance metrics casually. Simple rule of thumb advice is far easier to source than qualified details with reasonable rational explanations, like yours.</div><div dir="auto"></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I have an inexpensive RHEL 7 OpenVZ instance in the cloud with 256G of<br>
"RAM" that seems to work fine.  No desktop or X, of course.<br>
<br>
2G seems to have become too low for me to pleasantly web browse on<br>
Fedora 28.  It still works but can get sluggish with web pages that I<br>
visit (a few tabs of Ars Technica, for instance).<br>
<br>
swappiness is not a check, only a balance (except for 0).<br>
<br>
For most ordinary workloads, swappiness should only matter when memory<br>
gets tight.  2G would be a good example.<br>
<br>
swapping behariour generally follows a hockey-stick curve.  Anything<br>
you can do to stay left of where it takes off is worthwile.  Anything<br>
moving you further left from that isn't very important.<br>
<br>
(Write amplification also involves a (different) hockey stick curve.)<br>
<br>
Another interesting thing to play with might be zswap.  I've never<br>
tried it but some claim it is quite effective.  Essentially, with<br>
zswap: swap has a compressed cache in memory; actual writes may be<br>
avoided.  To me this feels like a way of bumping things towards the<br>
left on the hockey stick curve.  So it should matter on some systems<br>
and workloads and not on some others.<br>
<br>
<<a href="https://en.wikipedia.org/wiki/Zswap" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">https://en.wikipedia.org/wiki/Zswap</a>><br></blockquote></div></div><div dir="auto"><br></div><div>Thanks for that link. I also came across this the other day. Extending your metaphore, perhaps this is the right curved hockey stick of swappieness? </div><div dir="auto"><br></div><div dir="auto"><a href="https://packages.debian.org/wheezy/dphys-swapfile" rel="noreferrer noreferrer" target="_blank">https://packages.debian.org/wheezy/dphys-swapfile</a></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
| On my M.2 Nvram in the same system running RH F28 where I let the system<br>
| installer choose for me, I am experiencing certain display widget redrawing<br>
| issues in that the widget is blacked out until the mouse hovers over it.<br>
<br>
That should have nothing to do with swappiness.  Unless there is some<br>
pretty odd bug.</blockquote></div></div><div dir="auto"></div><div dir="auto"></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
| However at this time and considering all the microcode updates for my MB in<br>
| the last eight months, I'm unsure whether this is connected to the display<br>
| drivers or the swap parameters.<br>
<br>
One never knows what it is connected to until one tracks it down.  But<br>
swappiness is that last place I'd look.  Microcode updates might be<br>
the second last place.<br>
<br>
The first place I'd look is the video driver.  Those are very<br>
complicated and too often buggy.  Consider switching between X and<br>
Wayland to see if the problem follow you.</blockquote></div></div><div dir="auto"><br></div><div dir="auto">Kde Plasma seems to run fine on F27 as do Mate and Gnome. I'm not booting much from F28 on the small stick at this time, too much else on the go. I confess my original intention was to use the M.2 for its original design purpose, as a caching drive for a fixed disk running Windows 10. I'm almost completely unaware of the M$ desktop these days and I thought I'd have a look. However spectre, meltdown and the drop in prices for SSD's changed that plan.</div><div dir="auto"></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Of course the zeroth step would be to discover how to create the glitch<br>
reliably.<br></blockquote><div><br></div><div>From my understanding, celestial navigation was somewhat problematic until Hindu scholars and mathematician's came up with a record of the zero constant, in order to describe azimuth.  </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
| I haven't had much time to hack around lately, but as I stabilize this<br>
| build, I definitely don't use hibernate and suspend as they draw heavily on<br>
| swap.<br>
<br>
As I understand it (imperfectly) hibernate uses swap (and common sense<br>
says you need enough swap to hold all dirty pages) and suspend uses no<br>
more than the system did before suspension.  So only hibernate draws<br>
heavily on swap.<br>
<br>
Generally speaking, hibernate isn't done often enough to challenge SSD<br>
lifetimes.<br>
<br>
You really need to think quantitatively to understand what matters in<br>
performance.  That includes SSD lifetime issues.  Hockey stick curves<br>
drive one into non-linear systems, something a little harder to deal<br>
with.  "The Tipping Point"</blockquote></div></div></div></div><div dir="auto"><br></div><div dir="auto">Thanks for all your tips, most helpful and enlightening, as always. Most especially your descriptions help to wade through the somewhat archaic and obscure technical language which can be so problematic. Especially when you want stuff to just work as designed, not to mention, as advertised.</div><div dir="auto"><br></div><div dir="ltr"></div><div dir="ltr"><div dir="auto"><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
---<br>
Talk Mailing List<br>
<a href="mailto:talk@gtalug.org" rel="noreferrer noreferrer noreferrer" target="_blank">talk@gtalug.org</a><br>
<a href="https://gtalug.org/mailman/listinfo/talk" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">https://gtalug.org/mailman/listinfo/talk</a><br>
</blockquote></div></div></div>
</div></div>