Re: To Swap, or not to Swap

From: Mladen Gogala <gogala.mladen_at_gmail.com>
Date: Thu, 30 Mar 2023 22:13:55 -0400
Message-ID: <796419b9-9168-570f-505c-3f08a6dc3ae5_at_gmail.com>



On 3/30/23 20:25, Tim Gorman wrote:
> Are there no longer any scenarios where the swapfile allows the system
> to recover, without failing or hanging?
>
> For example, in Azure, VMs can use remote storage (a.k.a. OsDisk) for
> the swapfile, or VMs can locate the swapfile on optional
> direct-attached SSD storage that is considered "temporary" or
> ephemeral, because when the VM is stopped and deallocated, the
> direct-attached storage has to be erased, because another VM may be
> allocated to it in future.  It is not quality of storage that makes it
> "ephemeral", just the use-case.  Anyway, the OsDisk has I/O latency
> averaging 0.70 ms for both reads and writes, but the so-called
> "ephemeral" disk provides less than 0.05 ms I/O latency, which is
> about 14x faster.
>
> Clearly the performance of the storage on which the swapfile resides
> is going to make a difference in its usefulness.  If your testing
> involved slow storage, then I can see where the machine would take 7-8
> mins to fail.  I'm not trying to denigrate the resources you used, but
> I'm trying to ask if the swapfile is on fast storage, then perhaps
> could it be more helpful, even in extreme situations?
>
> In other words, shouldn't we ensure that a swapfile is fast, as well
> as big enough?  Wouldn't more performant storage allow the swapfile to
> recover the situation?
>
> Thanks so much for the thought exercise!
>
> -Tim

Tim, you made some excellent points. The numbers for Azure are, frankly speaking, amazing. However, I do _*believe*_ that somewhere in its entrails, Linux needs swap for proper functioning of the virtual memory system. The word "believe" is shown in the bold underlined font because I have no proof for my claim. It's just an OS religion of an old system administrator. In other words, when running without swap, you may be lucky enough to uncover a kernel bug.

There is a debate to be had about the purpose of the virtual memory system in the age of memories that can easily span terabytes and solid state disks which are, in essence, just another form of memory. This thread (and not just this thread) makes it perfectly obvious that there definitely is a need for the new generation of operating systems. However, I don't believe that I'm going to live long enough to see Linux and Windows displaced by something newer and better. Maybe, if ByteDance comes up with something useful, for a change. When I come to think of it, Oracle RDBMS has changed much more profoundly than Linux. I  believe that the next generation of the operating systems will necessarily have to include some AI features, something like Siri, but for data processing. Until that is available, I will stick with the good, old principles invented by Ma Bell in its time.

-- 
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
https://dbwhisperer.wordpress.com

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Mar 31 2023 - 04:13:55 CEST

Original text of this message