[squid-users] SQUID memory error after vm.swappines changed from 60 to 10

Bike dernikov1 dernikov1 at gmail.com
Tue Nov 14 15:41:04 UTC 2017


On Mon, Nov 13, 2017 at 4:36 PM, Alex Rousskov
<rousskov at measurement-factory.com> wrote:
> On 11/13/2017 02:34 AM, Bike dernikov1 wrote:
>> On Fri, Nov 10, 2017 at 4:43 PM, Alex Rousskov wrote:
>>> Squid swapping in production is an arguably worse disaster, as you have
>>> learned. In many cases, it is better to deal with a lack of swap than to
>>> rely on swap's magical effects that most humans poorly understand. YMMV.
>
>> In this scenario, swap is backup cache (as I understand)?
>
> In this scenario, swap is not a cache! In fact it is pretty much the
> opposite:
>
> * A cache is, by definition, an optional unreliable "fast" storage meant
> to reduce the need to go to some "slow" storage.
>
> * When in active use, swap is required reliable slow storage meant to
> extend fast storage (RAM) capacity.
>
> Do you see how almost every adjective in the first bullet is replaced
> with an antonym in the second one?

Yes, definitely mixed up, I meant right but wrote wrong.

> Some services, including many databases, over allocate RAM to store
> rarely used (computed and/or preloaded) data. When that data is swapped
> out, the service often continues to operate normally because the data is
> rarely accessed (and/or because swapping it in is still cheaper than
> computing it from scratch).
>
> With Squid, it is very difficult for the OS to correctly identify the
> rarely used RAM areas to swap out. When the OS swaps out the wrong area,
> Squid slows down (to access that area), which only increases the number
> of concurrent transactions and, hence, the amount of RAM Squid needs to
> operate, which triggers more wrong swap outs, creating a vicious cycle.

That is why best solution would be swap of. Definitely testing swapoff
next week, if we won't have new problems.

>> Swap could be used  to translate back data to mem if used, but it
>> stays on disk and purge after some time if not used ?
>
> The purging bit is wrong. Think of swap as very very very slow RAM.
>
> Alex.

So, when squid need something from swap, it will load that data back to ram.
For purge, data then  stay in swap forever ?

Swap very slow ram, best explanation. Use that metaphor during
mentoring younger coworkers :).
Thanks for explaining swap memory problems.


More information about the squid-users mailing list