| From: | Justin <zzzzz(dot)graf(at)gmail(dot)com> |
|---|---|
| To: | KK <knickknack(at)moppix(dot)de> |
| Cc: | pgsql-novice(at)lists(dot)postgresql(dot)org |
| Subject: | Re: Disk layout for parallel instances |
| Date: | 2026-08-26 13:17:51 |
| Message-ID: | CALL-XeOQU18aOm5pig6OPGHByy8J31exoEhOqcrJQvuN-uYmvQ@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-novice |
On Wed, Aug 26, 2026 at 2:20 AM KK <knickknack(at)moppix(dot)de> wrote:
>
> Am 25.08.26 um 17:49 schrieb Justin:
>
> Without additional details, it is hard to make concrete recommendations
> for the disk setup. Key missing details include:
>
> -
>
> Total database size
> -
>
> Whether a single VM is running multiple PostgreSQL clusters
> -
>
> Expected read/write workloads
> -
>
> Storage redundancy and RAID configuration
> -
>
> Underlying storage architecture (SSD, NVMe, SAN/NAS, or spinning disks)
>
>
> Am 26.08.26 um 07:09 schrieb Laurenz Albe:
>
> I recommend three file systems for a database cluster: one for the data directory, one for
> pg_wal, and one for the log files. The main reason is not performance, but to avoid that
> lots of data or log messages written can fill up the WAL disk and crash the server.
>
>
> Good morning, everyone.
>
> First of all, thank you for the very detailed response.
>
> The machine is a VM running within a Proxmox cluster. The Proxmox nodes
> are interconnected via dual 10 Gbit 802.3ad links in the primary ring and a
> 1 Gbit link in the secondary ring. Ceph is used for storage. Each Proxmox
> node accesses Ceph via dual 10 Gbit 802.3ad links.
>
> The PostgreSQL data directory is intended to reside on a virtual disk in
> Ceph backed by SAS SSDs.
>
> Following Laurenz's suggestion, I plan to create two additional virtual
> disks in Ceph (for pg_wal and logs), but place them in the SATA pool. Or
> should this data also be stored on native SSDs?
>
> In general, I was considering using LVM. The question is: XFS or Ext4? Or
> does it not really matter?
>
> The Ceph nodes themselves are physically separated across the campus and
> interconnected by high-capacity links.
>
> The databases vary in size—though "large" is likely defined differently by
> everyone. In any case, they are smaller than 500 GB.
> At the moment, nothing specific can be said about the number of databases;
> as is often the case, the approach will be to start small and scale up.
>
> Regarding criticality: the system needs to store data with very long
> retention periods (radiation protection)—at least 30 years—as well as
> short-term data (e.g., six-month retention), and everything in between.
> There are also databases containing data from a laboratory system. This
> data consists of analyses of various types of samples; this means records
> are written every second. At the same time, there are read requests from
> medical practices accessing this data during the day.
>
> Essentially, the system stores both highly sensitive data and technical
> data—such as information for authentication (RADIUS) or a ticketing system.
> The question that arises for me, then, is whether it wouldn't be better to
> physically separate this data into two VMs—and, in conjunction with that,
> move the VM containing particularly sensitive data into a separate VLAN.
>
> Best regards,
> Michael
>
Hi Michael
I am not a fan of breaking out the WAL, tables and logs into separate
disks. It adds a big complexity. The more VMs and LUNs laying around means
more things have to be tracked and kept together.
The point on the logs filling up the disk shutting PG down is not a really
valid argument to me because PG logs should be compressed and shipped off
to a logging/monitoring server continuously. The local logs should only be
a few hours or days worth. Even if not doing that, the OS should be
configured to compress and delete the older logs.
Filling up tables' or the WAL disks will cause PG to panic and shut down.
This should be monitored, throwing alerts at 5% or 10% of disk usage.
I honestly don’t know if filling up the log disk will shut down PG when the
log collector is ON. I would argue it should, because logging is part of
the audit trail and losing the logs is bad in many use cases—something to
keep in mind. The default configuration for PostgreSQL is to send the logs
to stderr/stdout so the OS will silently drop log entries if the log disk
fills up. However, with the log collector on I do not know what PG does if
the logs are on a different disk and it fills up. I don’t configure things
that way. All the PGs I configure, WAL, data and logs are equally
important. I also don’t leave the logs on the PG disk for any length of
time; they get shipped off for a 90-day retention period.
You are using Ceph, which is good because it supports crash-consistent
snapshots across multiple disks. Proxmox I am not sure what it supports—you
need to check on that.
Using LVM means the disk format XFS vs EXT4 is a moot point. The EXT4 disk
can be expanded online and can use snapshots at the VM level. I typically
just use EXT4 with LVM.
Want to point out that a cluster and a database are not the same thing in
PG. In PG a cluster is one or many databases, and those databases share the
WAL and PG catalog. If you isolate a database using tablespaces to
different disks then use disk snapshots as backups minus the catalog and
WAL disks, the backup is NOT consistent—it is missing part of the catalog
and WAL.
You bring up long-term archiving for 30 years. This is a completely
different problem and should not factor into deciding how to set up disks
for VMs. A 30-year retention period is a really long time—that is people’s
entire careers—so anyone around today when the data needs to be accessed in
30 years is probably not going to be around, and none of the software or
hardware is going to be around.
Long-term archiving must be done in a data format that is very accessible.
I would not leave the data in PG table format; I would dump the data out
with pg_dump using the plain format. Reason being, in 30 years will
PostgreSQL be around, will Linux be around, will there be a VM that will
boot a 30-year-old Linux distro? This is a real problem we face today
running really old hardware to keep CNCs alive or software on current
hardware. Look at the amount of effort put into keeping DOS alive today and
how expensive it is.
There is a real industrial need to keep 30- and 40-year-old software
running and it is not an easy problem to solve.
To repeat myself, archiving data for a 30-year retention period is a
separate problem with completely different requirements and issues to
resolve.
Thank you
Justin
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Laurenz Albe | 2026-08-26 19:21:52 | Re: Disk layout for parallel instances |
| Previous Message | KK | 2026-08-26 06:20:29 | Re: Disk layout for parallel instances |