Using SSD as cache in openSuSE 42.1 Leap

Hi,

I have a 60GB OZC Agility SSD and a 2TB HDD. In Windows I use the Intel Smart Response to use the SSD as cache.

Now I want to switch to openSuSE 42.1 Leap. I tried the installation first in Oracle Virtual Box. I know that Intel Smart Response is not supported in GNU/Linux but I
expected to see something alternative in the installer of openSuSE 42.1 Leap, but there was no such an option.

Is it possible to setup openSuSE 42.1 to use SSD as cache?
How we do it?

Thanks

I wouldn’t know for sure,

But as far as the OS goes, I clearly don’t see any benefit.
Whereas even the current Windows 10 writes temporary files to disk, most leading edge distros like openSUSE 13.x and LEAP mount temporary file directory directories into RAM, so never touch a disk.

Whether individual applications benefit the same way as the OS probably depends on how they are written but I would guess if the application <data> is written to standard relative temporary directories instead of hard coded to locations should also be written to RAM.

So,
Although it can’t be said for all scenarios, I would guess that besides the OS, many if not most <well written> applications automatically don’t need to be re-directed to SSD.

Now, for your wrinkle… You’re installing in a VirtualBox Guest.
All current paravirtualization technologies currently write their “memory” to files which by default are located in the same directory as the Guest virtual disk. Obviously, those files won’t be written to RAM, so it might be worth deploying those VirtualBox Guests on SSDs.

I haven’t tested running virtualization guests on different storage media so don’t really know for sure those effects, so am just speculating.

TSU

Thanks for your answer. I did try to install openSuSE to Virtual Box in order to see if the installation wizard provides me with option for enabling SSD as cache not for permanent installation.
Intel SRT makes your HDD + SSD to look like your are having a hybrid disk and there are performance benefits not only for quick booting but also for all the applications as if you had a real hybrid disk.
I have seen in other GNU/Linux forums that people do not use SSD as cache but they mount on it part of their filesystem. This is happening because in all distributions there is no an easy way to install
SSD as cache from the installation phase. But also I know that big companies like Facebook have created their own solutions for SSD as cache in order to accelerate their HDDs.
So do you suggest to use my SSD to mount some directories of the filesystem? Considering that my SSD is a little bit old and only 60GB which would be a good scheme to use?

If you’re installing on bare metal (not virtualized),
The default install will automatically mount all temporary and runtime files/folders in RAM.
If you have an SSD and a HDD,
The general recommendation is to mount your root partition (/) on the SSD and your home directory (/home) on the HDD. That way all of your OSS and the majority of your applications will initially be read from your SSD. Your User’s configuration files and personal data files will generally be read from your HDD into RAM as necessary.

TSU

On Wed, 10 Feb 2016 20:36:01 +0000, tsu2 wrote:

> Now, for your wrinkle… You’re installing in a VirtualBox Guest.
> All current paravirtualization technologies currently write their
> “memory”
> to files which by default are located in the same directory as the Guest
> virtual disk. Obviously, those files won’t be written to RAM, so it
> might be worth deploying those VirtualBox Guests on SSDs.

I’m not sure I understand what you’re saying here - VM memory allocations
can be swapped to disk, but in terms of real memory usage, system memory
is allocated for VM RAM.

But what you’ve written could be read as meaning that no system RAM is
allocated at all, and disk storage is used for RAM, meaning that
execution instructions are read from disk (as memory space) and executed,
which would lead to absolutely horrible performance (which is why I
don’t think that’s what you actually mean to say.)

But for clarity and an example - I have my 32 GB desktop here with 10 VMs
running currently, and while the virtual footprint is larger than the
resident footprint (according to htop), no swap space is used.

Additionally, in none of the VM directories do I have any file that’s
used to represent the current memory state of any of the VMs (I’m using
VirtualBox here).

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

it is possible, but

  • it is not integrated in installer, you would need to configure it manually. What follows, it may not be tested well how it works with other system components
  • you cannot have both Intel Smart Response and Linux caching. Linux does not support SRT so it can only use SSD as independent disk which will destroy any information put there by controller/Windows.

So for dual boot answer is likely “no”. If you want to run Linux only, answer is “yes” (search for bcache).

Is 60GB enough for the root partition? Could the OS update download updates that exceed the 60GB?

60GB might be considered inadequate due to how snapper automatically snapshots and retains BTRFS images.
I’d recommend over 100GB (120GB ?) nowadays, and that generally would be for only moderate file changes. YMMV.
Of course, BTRFS is only the default disk format for the root partition, you can select something else but BTRFS can provide benefits including rollbacks to previous images for recovery.
Or, you can manually manage your BTRFS images, which is what I’m currently doing for some very small but moderately active systems.

bcache looks interesting, particularly with the new alpha code recently posted as first steps to kernel integration.

But,
IMO that would generally not be as necessary as in Windows due to the difference in OS architecture I described.
I can imagine bcache possibly used in a database disk array if cost prevents deploying entirely on SSD.

TSU

Hi
I’m happily using 40GB / partitons with btrfs, snapper needs configuring though…

As to bcache, I’m running it here (not on 13.2 anymore), but use writethough not writeback (similar to SRT)
https://forums.opensuse.org/entry.php/159-Setting-up-bcache-on-openSUSE-13-2

Be aware that a 40GB partition for your system partition is probably OK for <normal> use.
You will want to make sure that you’re not storing anything that rapidly and constantly changes, so for instance as vitualization Host you <must> make sure your Guest files are stored on a different partition.

TSU

Hi
Yes, here is my current setup;


 lsblk
NAME          MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda             8:0    0 298.1G  0 disk
└─sda1          8:1    0 298.1G  0 part
  └─md0         9:0    0 298.1G  0 raid1
    └─bcache1 254:1    0 298.1G  0 disk  /kvm
sdb             8:16   0 465.8G  0 disk
└─sdb1          8:17   0 465.8G  0 part
  └─md1         9:1    0 465.8G  0 raid1
    └─bcache0 254:0    0 465.8G  0 disk  /data
sdc             8:32   0 298.1G  0 disk
└─sdc1          8:33   0 298.1G  0 part
  └─md0         9:0    0 298.1G  0 raid1
    └─bcache1 254:1    0 298.1G  0 disk  /kvm
sdd             8:48   0 465.8G  0 disk
└─sdd1          8:49   0 465.8G  0 part
  └─md1         9:1    0 465.8G  0 raid1
    └─bcache0 254:0    0 465.8G  0 disk  /data
sde             8:64   0 111.8G  0 disk
├─sde1          8:65   0   512M  0 part  /boot
├─sde2          8:66   0    16G  0 part
│ └─bcache1   254:1    0 298.1G  0 disk  /kvm
├─sde3          8:67   0    25G  0 part
│ └─bcache0   254:0    0 465.8G  0 disk  /data
├─sde4          8:68   0     1K  0 part
├─sde5          8:69   0  62.3G  0 part  /
└─sde6          8:70   0     8G  0 part  [SWAP]
sdf             8:80   0 698.7G  0 disk
└─sdf1          8:81   0 698.7G  0 part  /backup

 btrfs fi df /
Data, single: total=23.00GiB, used=14.25GiB
System, single: total=32.00MiB, used=16.00KiB
Metadata, single: total=2.00GiB, used=991.88MiB
GlobalReserve, single: total=336.00MiB, used=0.00B

You’re right,
I re-inspected my current VBox Guests and unlike some other virt technologies, I don’t see a memory backing file by default. I don’t remember at the moment if such a file ever did exist in VBox, I thought I did see them awhile back but could be mistaken.

A memory backing file can be a performance issue (YMMV) if it exists, it’s a mirror of what exists in real RAM and usually implemented in “write-back” mode which means that disk writes are usually lazy and <should not> affect what is happening in RAM… but of course isn’t always the case so can be disabled if it becomes an issue.

But,
This doesn’t seem to be an issue with <current> versions of Virtualbox.

TSU