RE: Recommendations on how to combine SSD and HDD drives in bare metal PostgreSQL server [SEC=UNOFFICIAL]

From: "Pilling, Michael DR" <michael(dot)pilling(at)defence(dot)gov(dot)au>
To: "Pilling, Michael DR" <michael(dot)pilling(at)defence(dot)gov(dot)au>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, "pgsql-novice(at)lists(dot)postgresql(dot)org" <pgsql-novice(at)lists(dot)postgresql(dot)org>
Subject: RE: Recommendations on how to combine SSD and HDD drives in bare metal PostgreSQL server [SEC=UNOFFICIAL]
Date: 2024-10-18 00:22:12
Message-ID: ME3P282MB39352883F44BCF859F27995DCA402@ME3P282MB3935.AUSP282.PROD.OUTLOOK.COM
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-novice

UNOFFICIAL
Further to this, the advantages of using the SSD as a cache in the hardware/file system/operating system are:
* You don't have to understand the deep system performance issues of PostgreSQL or your application
* The result will be optimal or near optimal
* The system will self tune even as your usage of your PostgreSQL database changes overtime

The main thing you will need to monitor is the health of the SSD (and of course also the HDDs) but hopefully you will have the HDDs in a RAID configuration anyway.

Do not forget to do backups.

Here are some links that go into further detail which will hopefully help.

https://robots.net/tech/how-to-use-a-solid-state-drive-as-a-cache/
https://superuser.com/questions/390071/how-can-i-use-my-small-ssd-as-a-cache-for-a-larger-hard-disk
https://bytebitebit.com/tips-tricks/how-to-use-ssd-as-cache-for-hdd/

Happy configuring
Cheers,
Michael

Dr Michael Pilling (him / they)
Defence Analyst / Software Specialist
_____________________________________________________________________________
Defence acknowledges the Traditional Custodians of the Country throughout Australia. We recognise their continuing connection to land, waters and community. We pay our respects to them, their culture and to their Elders past and present. 

-----Original Message-----
From: Pilling, Michael DR <michael(dot)pilling(at)defence(dot)gov(dot)au>
Sent: Thursday, 17 October 2024 1:57 PM
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>; Onni Hakala <onni(at)fyff(dot)ee>; pgsql-novice(at)lists(dot)postgresql(dot)org
Subject: RE: Recommendations on how to combine SSD and HDD drives in bare metal PostgreSQL server [SEC=UNOFFICIAL]

EXTERNAL EMAIL: Do not click any links or open any attachments unless you trust the sender and know the content is safe.

UNOFFICIAL
I would say the best way to handle this would be to do it in the hardware drivers or file system components of the OS so that the SSD drives were used as a cache for the HDDs. This would generally result in all the active indices of the tables residing on the SSDs. It all depends whether your OS and its files systems are to the job. Certainly, Reisier4 file system aimed for all of its indices to be held in memory with only writes going to the HDDs - by using the SSDs for swap space this would have the desired effect under Reiser4.

Dr Michael Pilling (him / they)
Defence Analyst / Software Specialist
Human and Decision Sciences Division | Analytical Wargaming | Capability Analysis and Design Defence Science and Technology Group _____________________________________________________________________________
Department of Defence | Edinburgh  | 23L Bay 35 PO Box 1500 | EDINBURGH SA 5111
M: 0414 405 711 | www.defence.gov.au
E: michael(dot)pilling(at)defence(dot)gov(dot)au

Defence acknowledges the Traditional Custodians of the Country throughout Australia. We recognise their continuing connection to land, waters and community. We pay our respects to them, their culture and to their Elders past and present. 

-----Original Message-----
From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Sent: Thursday, 17 October 2024 2:53 AM
To: Onni Hakala <onni(at)fyff(dot)ee>; pgsql-novice(at)lists(dot)postgresql(dot)org
Subject: Re: Recommendations on how to combine SSD and HDD drives in bare metal PostgreSQL server

EXTERNAL EMAIL: Do not click any links or open any attachments unless you trust the sender and know the content is safe.

On Wed, 2024-10-16 at 17:06 +0300, Onni Hakala wrote:
> I have a large dataset of > 100TB which would be very expensive to store solely into SSD drives.
>
> I have access to a server which has 2x 3.84TB NVME SSD disks and large array of HDD drives 8 x 22TB.
>
> Most of the data that I have in my dataset is very rarely accessed and is stored only for archival purposes.
>
> What would be the de-facto way to use both SSD and HDD together in a
> way use where commonly used data would be fast to access and old data would eventually only be stored in compressed format in the HDDs?
>
> I was initially looking into building zpool using zfs with raidz3 and
> zstd compression for my HDDs but I’m unsure how to add the SSDs into
> this equation and I thought that this is probably a common scenario and wanted to ask opinions from here.

The traditionalway to handle that would be to create an extra tablespace on a file system built on the slow disks. You'd move tables that are no longer hot to that slow tablespace.
If you cannot move the whole table, use partitioning and move old partitions to the slow tablespace.

Yours,
Laurenz Albe

Browse pgsql-novice by date

  From Date Subject
Next Message Andrew Jackson 2024-11-19 19:33:05 Commitfest cooldown
Previous Message Pilling, Michael DR 2024-10-17 03:26:51 RE: Recommendations on how to combine SSD and HDD drives in bare metal PostgreSQL server [SEC=UNOFFICIAL]